LP#1685929: add implementation print spine labels to checkin grid
authorCesar Velez <Cesar.Velez@equinoxinitiative.org>
Tue, 1 Aug 2017 21:42:00 +0000 (22:42 +0100)
committerGalen Charlton <gmc@equinoxinitiative.org>
Fri, 25 Aug 2017 19:52:22 +0000 (15:52 -0400)
Signed-off by: Cesar Velez <cesar.velez@equinoxinitiative.org>
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>

Open-ILS/web/js/ui/default/staff/circ/checkin/app.js
Open-ILS/web/js/ui/default/staff/circ/services/item.js

index e3bf69a..7f86eb3 100644 (file)
@@ -374,5 +374,9 @@ function($scope , $q , $window , $location , $timeout , egCore , checkinSvc , eg
             itemSvc.mark_missing_pieces(i.acp);
         });
     }
+
+    $scope.printSpineLabels = function(items){
+        itemSvc.print_spine_labels(items);
+    }
 }])
 
index 3c0953f..278e433 100644 (file)
@@ -887,5 +887,22 @@ function(egCore , egCirc , $uibModal , $q , $timeout , $window , egConfirmDialog
         });
     }
 
+    service.print_spine_labels = function(copies){
+        egCore.net.request(
+            'open-ils.actor',
+            'open-ils.actor.anon_cache.set_value',
+            null, 'print-labels-these-copies', {
+                copies : service.gatherSelectedHoldingsIds(copies)
+            }
+        ).then(function(key) {
+            if (key) {
+                var url = egCore.env.basePath + 'cat/printlabels/' + key;
+                $timeout(function() { $window.open(url, '_blank') });
+            } else {
+                alert('Could not create anonymous cache key!');
+            }
+        });
+    }
+
     return service;
 }])