LP#1691861 - make Item Status edit items in batch in volcopy
authorCesar Velez <cesar.velez@equinoxinitiative.org>
Tue, 24 Oct 2017 18:16:33 +0000 (14:16 -0400)
committerKathy Lussier <klussier@masslnc.org>
Thu, 4 Jan 2018 17:02:37 +0000 (12:02 -0500)
This makes the Item Status grid action of "Edit Items" work
like the Copy Buckets grid "Edit Selected Items", in that the
copies open in the volcopy editor in batch, with no record summary.

Signed-off by: Cesar Velez <cesar.velez@equinoxinitiative.org>

Signed-off-by: Kathy Lussier <klussier@masslnc.org>

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

index afbc474..79a8b0f 100644 (file)
@@ -674,26 +674,30 @@ function(egCore , egCirc , $uibModal , $q , $timeout , $window , egConfirmDialog
     }
 
     service.spawnHoldingsEdit = function (items,hide_vols,hide_copies){
-        angular.forEach(service.gatherSelectedRecordIds(items), function (r) {
-            egCore.net.request(
-                'open-ils.actor',
-                'open-ils.actor.anon_cache.set_value',
-                null, 'edit-these-copies', {
-                    record_id: r,
-                    copies: service.gatherSelectedHoldingsIds(items,r),
-                    raw: {},
-                    hide_vols : hide_vols,
-                    hide_copies : hide_copies
-                }
-            ).then(function(key) {
-                if (key) {
-                    var url = egCore.env.basePath + 'cat/volcopy/' + key;
-                    $timeout(function() { $window.open(url, '_blank') });
-                } else {
-                    alert('Could not create anonymous cache key!');
-                }
-            });
+        var item_ids = [];
+        angular.forEach(items, function(i){
+           item_ids.push(i.id);
         });
+       
+       egCore.net.request(
+           'open-ils.actor',
+           'open-ils.actor.anon_cache.set_value',
+           null,
+           'edit-these-copies',
+           {
+               record_id: 0,  // disables record summary
+               copies: item_ids,
+               raw: {},
+               hide_vols : hide_vols,
+               hide_copies : hide_copies
+            }).then(function(key) {
+               if (key) {
+                   var url = egCore.env.basePath + 'cat/volcopy/' + key;
+                   $timeout(function() { $window.open(url, '_blank') });
+               } else {
+                   alert('Could not create anonymous cache key!');
+               }
+           });
     }
 
     service.replaceBarcodes = function(items) {