LP#1685929: adjust egItem.print_spine_labels()
authorGalen Charlton <gmc@equinoxinitiative.org>
Fri, 25 Aug 2017 19:17:25 +0000 (15:17 -0400)
committerGalen Charlton <gmc@equinoxinitiative.org>
Fri, 25 Aug 2017 19:52:22 +0000 (15:52 -0400)
Make egItem.print_spine_labels() accept a list of copy
IDs and make the caller responsible for putting that list together.

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 7f86eb3..bbc8bbe 100644 (file)
@@ -376,7 +376,11 @@ function($scope , $q , $window , $location , $timeout , egCore , checkinSvc , eg
     }
 
     $scope.printSpineLabels = function(items){
-        itemSvc.print_spine_labels(items);
+        var copy_ids = [];
+        angular.forEach(items, function(item) {
+            if (item.acp) copy_ids.push(item.acp.id());
+        });
+        itemSvc.print_spine_labels(copy_ids);
     }
 }])
 
index 278e433..28eae2a 100644 (file)
@@ -887,12 +887,12 @@ function(egCore , egCirc , $uibModal , $q , $timeout , $window , egConfirmDialog
         });
     }
 
-    service.print_spine_labels = function(copies){
+    service.print_spine_labels = function(copy_ids){
         egCore.net.request(
             'open-ils.actor',
             'open-ils.actor.anon_cache.set_value',
             null, 'print-labels-these-copies', {
-                copies : service.gatherSelectedHoldingsIds(copies)
+                copies : copy_ids
             }
         ).then(function(key) {
             if (key) {