add copy alert actions to item status page in list view
authorGalen Charlton <gmc@esilibrary.com>
Fri, 2 Sep 2016 21:51:03 +0000 (17:51 -0400)
committerGalen Charlton <gmc@equinoxinitiative.org>
Fri, 3 Nov 2017 20:19:21 +0000 (16:19 -0400)
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Open-ILS/src/templates/staff/cat/item/t_list.tt2
Open-ILS/web/js/ui/default/staff/cat/item/app.js

index eb584c9..f39878e 100644 (file)
@@ -46,6 +46,8 @@
     label="[% l('Items') %]"></eg-grid-action>
   <eg-grid-action handler="selectedHoldingsVolCopyAdd" group="[% l('Add') %]"
     label="[% l('Volumes and Items') %]"></eg-grid-action>
+  <eg-grid-action handler="selectedHoldingsCopyAlertsAdd" group="[% l('Add') %]"
+    label="[% l('Copy Alerts') %]"></eg-grid-action>
 
   <eg-grid-action handler="selectedHoldingsVolEdit" group="[% l('Edit') %]"
     label="[% l('Volumes') %]"></eg-grid-action>
@@ -55,6 +57,8 @@
     label="[% l('Volumes and Items') %]"></eg-grid-action>
   <eg-grid-action handler="replaceBarcodes" group="[% l('Edit') %]"
     label="[% l('Replace Barcodes') %]"></eg-grid-action>
+  <eg-grid-action handler="selectedHoldingsCopyAlertsEdit" group="[% l('Edit') %]"
+    label="[% l('Manage Copy Alerts') %]"></eg-grid-action>
 
   <eg-grid-action handler="changeItemOwningLib" group="[% l('Transfer') %]"
     label="[% l('Items to Previously Marked Library') %]"></eg-grid-action>
index 58a2b7a..40073ec 100644 (file)
@@ -444,6 +444,26 @@ function($scope , $q , $routeParams , $location , $timeout , $window , egCore ,
         itemSvc.spawnHoldingsAdd(copyGrid.selectedItems(),false,true);
     }
 
+    $scope.selectedHoldingsCopyAlertsAdd = function(items) {
+        var copy_ids = [];
+        angular.forEach(items, function(item) {
+            if (item.id) copy_ids.push(item.id);
+        });
+        egCirc.add_copy_alerts(copy_ids).then(function() {
+            // update grid items?
+        });
+    }
+
+    $scope.selectedHoldingsCopyAlertsEdit = function(items) {
+        var copy_ids = [];
+        angular.forEach(items, function(item) {
+            if (item.id) copy_ids.push(item.id);
+        });
+        egCirc.manage_copy_alerts(copy_ids).then(function() {
+            // update grid items?
+        });
+    }
+
     $scope.showBibHolds = function () {
         angular.forEach(gatherSelectedRecordIds(), function (r) {
             var url = egCore.env.basePath + 'cat/catalog/record/' + r + '/holds';