LP#1570091: webstaff: Add Cancel Transit action to item status
authorMike Rylander <mrylander@gmail.com>
Fri, 4 Mar 2016 17:14:07 +0000 (12:14 -0500)
committerBill Erickson <berickxx@gmail.com>
Wed, 20 Apr 2016 14:51:32 +0000 (10:51 -0400)
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Bill Erickson <berickxx@gmail.com>

Open-ILS/src/templates/staff/cat/item/t_list.tt2
Open-ILS/web/js/ui/default/staff/cat/item/app.js

index 6dddad3..596a24b 100644 (file)
   <eg-grid-action handler="attach_to_peer_bib"
     label="[% l('Link as Conjoined to Previously Marked Bib Record') %]"></eg-grid-action>
   <eg-grid-action handler="selectedHoldingsCopyDelete"
-    label="[% l('Delete Copies') %]"></eg-grid-action>
+    label="[% l('Delete Items') %]"></eg-grid-action>
   <eg-grid-action handler="checkin"
-    label="[% l('Check In Copies') %]"></eg-grid-action>
+    label="[% l('Check In Items') %]"></eg-grid-action>
   <eg-grid-action handler="renew"
-    label="[% l('Renew Copies') %]"></eg-grid-action>
+    label="[% l('Renew Items') %]"></eg-grid-action>
+  <eg-grid-action handler="cancel_transit"
+    label="[% l('Cancel Transit') %]"></eg-grid-action>
     
   <eg-grid-action handler="selectedHoldingsItemStatusTgrEvt" group="[% l('Show') %]"
     label="[% l('Triggered Events') %]"></eg-grid-action>
     label="[% l('Item as Missing') %]"></eg-grid-action>
     
   <eg-grid-action handler="selectedHoldingsCopyAdd" group="[% l('Add') %]"
-    label="[% l('Copies') %]"></eg-grid-action>
+    label="[% l('Items') %]"></eg-grid-action>
   <eg-grid-action handler="selectedHoldingsVolCopyAdd" group="[% l('Add') %]"
-    label="[% l('Volumes and Copies') %]"></eg-grid-action>
+    label="[% l('Volumes and Items') %]"></eg-grid-action>
 
   <eg-grid-action handler="selectedHoldingsVolEdit" group="[% l('Edit') %]"
     label="[% l('Volumes') %]"></eg-grid-action>
   <eg-grid-action handler="selectedHoldingsCopyEdit" group="[% l('Edit') %]"
-    label="[% l('Copies') %]"></eg-grid-action>
+    label="[% l('Items') %]"></eg-grid-action>
   <eg-grid-action handler="selectedHoldingsVolCopyEdit" group="[% l('Edit') %]"
-    label="[% l('Volumes and Copies') %]"></eg-grid-action>
+    label="[% l('Volumes and Items') %]"></eg-grid-action>
   <eg-grid-action handler="replaceBarcodes" group="[% l('Edit') %]"
     label="[% l('Replace Barcodes') %]"></eg-grid-action>
 
index a2750ce..e42064b 100644 (file)
@@ -581,6 +581,15 @@ function($scope , $q , $routeParams , $location , $timeout , $window , egCore ,
             $location.path('/cat/item/' + item.id + '/holds');
     }
 
+    $scope.cancel_transit = function () {
+        var initial_list = copyGrid.selectedItems();
+        angular.forEach(copyGrid.selectedItems(), function(cp) {
+            egCirc.find_copy_transit(null, {copy_barcode:cp.barcode})
+                .then(function(t) { return egCirc.abort_transit(t.id())    })
+                .then(function()  { return add_barcode_to_list(cp.barcode) });
+        });
+    }
+
     $scope.selectedHoldingsDamaged = function () {
         var initial_list = copyGrid.selectedItems();
         egCirc.mark_damaged(gatherSelectedHoldingsIds()).then(function(){