webstaff: add Print Labels to Holdings View
authorJason Etheridge <jason@esilibrary.com>
Tue, 11 Apr 2017 18:32:38 +0000 (14:32 -0400)
committerJason Etheridge <jason@esilibrary.com>
Fri, 14 Apr 2017 03:35:13 +0000 (23:35 -0400)
Signed-off-by: Jason Etheridge <jason@esilibrary.com>
Open-ILS/src/templates/staff/cat/catalog/t_holdings.tt2
Open-ILS/web/js/ui/default/staff/cat/catalog/app.js

index c7247c7..555ce6c 100644 (file)
@@ -57,6 +57,8 @@
       label="[% l('Triggered Events') %]"></eg-grid-action>
     <eg-grid-action handler="selectedHoldingsItemStatusHolds" group="[% l('Show') %]"
       label="[% l('Item Holds') %]"></eg-grid-action>
+    <eg-grid-action handler="selectedHoldingsPrintLabels" group="[% l('Show') %]"
+      label="[% l('Print Labels') %]"></eg-grid-action>
 
     <eg-grid-action handler="selectedHoldingsDamaged" group="[% l('Mark') %]"
       label="[% l('Item as Damaged') %]"></eg-grid-action>
index 531dd74..c02c783 100644 (file)
@@ -1414,6 +1414,23 @@ function($scope , $routeParams , $location , $window , $q , egCore , egHolds , e
         );
     }
 
+    $scope.selectedHoldingsPrintLabels = function() {
+        egCore.net.request(
+            'open-ils.actor',
+            'open-ils.actor.anon_cache.set_value',
+            null, 'print-labels-these-copies', {
+                copies : gatherSelectedHoldingsIds()
+            }
+        ).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!');
+            }
+        });
+    }
+
     $scope.selectedHoldingsDamaged = function () {
         egCirc.mark_damaged(gatherSelectedHoldingsIds()).then(function() {
             holdingsSvcInst.fetchAgain().then(function() {