label="[% l('Edit Notification Settings') %]"></eg-grid-action>
<eg-grid-action handler="edit_dates"
label="[% l('Edit Hold Dates') %]"></eg-grid-action>
+ <eg-grid-action handler="activate"
+ label="[% l('Activate') %]"></eg-grid-action>
+ <eg-grid-action handler="suspend"
+ label="[% l('Suspend') %]"></eg-grid-action>
<eg-grid-action handler="cancel_hold"
label="[% l('Cancel Hold') %]"></eg-grid-action>
s.HOLD_STATUS_6 = "[% l('Canceled') %]";
s.HOLD_STATUS_7 = "[% l('Suspended') %]";
s.HOLD_STATUS_8 = "[% l('Wrong Shelf') %]";
+s.ACTIVATE_HOLDS = "[% l('Activate [_1] Hold(s)?', '{{num_holds}}') %]"
+s.SUSPEND_HOLDS = "[% l('Suspend [_1] Hold(s)?', '{{num_holds}}') %]"
}]);
</script>
$scope.edit_dates = function(items) {
generic_update(items, 'edit_dates');
}
+ $scope.suspend = function(items) {
+ generic_update(items, 'suspend_holds');
+ }
+ $scope.activate = function(items) {
+ generic_update(items, 'activate_holds');
+ }
}])
}).result;
}
+ service.activate_holds = function(hold_ids) {
+ if (!hold_ids.length) return $q.when();
+ return egConfirmDialog.open(
+ egCore.strings.ACTIVATE_HOLDS, '', {num_holds : hold_ids.length})
+ .result.then(function() {
+ var vals = hold_ids.map(function(hold_id) {
+ return {id : hold_id, frozen : false}
+ });
+ return service.update_holds(vals);
+ });
+ }
+
+ service.suspend_holds = function(hold_ids) {
+ if (!hold_ids.length) return $q.when();
+ return egConfirmDialog.open(
+ egCore.strings.SUSPEND_HOLDS, '', {num_holds : hold_ids.length})
+ .result.then(function() {
+ var vals = hold_ids.map(function(hold_id) {
+ return {id : hold_id, frozen : true}
+ });
+ return service.update_holds(vals);
+ });
+ }
+
+
return service;
}])