Hide cancel/uncancel as appropriate
authorMike Rylander <mrylander@gmail.com>
Mon, 9 Feb 2015 17:51:01 +0000 (12:51 -0500)
committerMike Rylander <mrylander@gmail.com>
Mon, 9 Feb 2015 17:51:01 +0000 (12:51 -0500)
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Open-ILS/src/templates/staff/circ/patron/t_holds_list.tt2
Open-ILS/web/js/ui/default/staff/circ/patron/holds.js

index 914c52f..c2e63f5 100644 (file)
@@ -37,9 +37,9 @@
   <eg-grid-action divider="true"></eg-grid-action>
   <eg-grid-action handler="grid_actions.retarget"
     label="[% l('Find Another Target') %]"></eg-grid-action>
-  <eg-grid-action handler="grid_actions.cancel_hold"
+  <eg-grid-action handler="grid_actions.cancel_hold" hide="hide_cancel_hold"
     label="[% l('Cancel Hold') %]"></eg-grid-action>
-  <eg-grid-action handler="grid_actions.uncancel_hold"
+  <eg-grid-action handler="grid_actions.uncancel_hold" hide="hide_uncancel_hold"
     label="[% l('Uncancel Hold') %]"></eg-grid-action>
 
   <eg-grid-field label="[% l('Hold ID') %]" path='hold.id'></eg-grid-field>
index c42a162..9c2101f 100644 (file)
@@ -38,6 +38,14 @@ function($scope,  $q,  $routeParams,  egCore,  egUser,  patronSvc,
         provider.refresh();
     }
 
+    $scope.hide_cancel_hold = function(action) { 
+        return $scope.holds_display == 'alt';
+    }
+
+    $scope.hide_uncancel_hold = function(action) {
+        return !$scope.hide_cancel_hold();
+    }
+
     var provider = egGridDataProvider.instance({});
     $scope.gridDataProvider = provider;