webstaff: initial hook for label printing
authorJason Etheridge <jason@esilibrary.com>
Sun, 5 Mar 2017 21:07:17 +0000 (16:07 -0500)
committerJason Etheridge <jason@esilibrary.com>
Sun, 5 Mar 2017 21:07:17 +0000 (16:07 -0500)
Signed-off-by: Jason Etheridge <jason@esilibrary.com>
Open-ILS/src/templates/staff/cat/item/t_list.tt2
Open-ILS/web/js/ui/default/staff/cat/item/app.js

index 9755360..9e17623 100644 (file)
@@ -33,6 +33,8 @@
     label="[% l('Item Holds') %]"></eg-grid-action>
   <eg-grid-action handler="showBibHolds" group="[% l('Show') %]"
     label="[% l('Record Holds') %]"></eg-grid-action>
+  <eg-grid-action handler="print_labels" 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 5468daf..ee47bb2 100644 (file)
@@ -801,6 +801,23 @@ function($scope , $q , $routeParams , $location , $timeout , $window , egCore ,
         });
     }
 
+    $scope.print_labels = 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!');
+            }
+        });
+    }
+
     var spawnHoldingsEdit = function (hide_vols,hide_copies){
         angular.forEach(gatherSelectedRecordIds(), function (r) {
             egCore.net.request(