From: Mike Rylander Date: Thu, 30 Oct 2014 14:38:15 +0000 (-0400) Subject: Add the ability (and action) to uncancel holds X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=32329b75da94ed9909b57dfe30121067a63d7d1b;p=working%2FEvergreen.git Add the ability (and action) to uncancel holds Signed-off-by: Mike Rylander --- diff --git a/Open-ILS/src/templates/staff/cat/catalog/t_holds.tt2 b/Open-ILS/src/templates/staff/cat/catalog/t_holds.tt2 index b21146d9ea..13d5bf91bc 100644 --- a/Open-ILS/src/templates/staff/cat/catalog/t_holds.tt2 +++ b/Open-ILS/src/templates/staff/cat/catalog/t_holds.tt2 @@ -50,6 +50,8 @@ label="[% l('Find Another Target') %]"> + + + + + + + diff --git a/Open-ILS/web/js/ui/default/staff/circ/services/holds.js b/Open-ILS/web/js/ui/default/staff/circ/services/holds.js index a22201818c..77e4fb9db4 100644 --- a/Open-ILS/web/js/ui/default/staff/circ/services/holds.js +++ b/Open-ILS/web/js/ui/default/staff/circ/services/holds.js @@ -107,6 +107,49 @@ function($modal , $q , egCore , egUser , egConfirmDialog , egAlertDialog) { }).result; } + service.uncancel_holds = function(hold_ids) { + + return $modal.open({ + templateUrl : './circ/share/t_uncancel_hold_dialog', + controller : + ['$scope', '$modalInstance', + function($scope, $modalInstance) { + $scope.args = { + num_holds : hold_ids.length + }; + + $scope.cancel = function($event) { + $modalInstance.dismiss(); + $event.preventDefault(); + } + + $scope.ok = function() { + + function uncancel_one() { + var hold_id = hold_ids.pop(); + if (!hold_id) { + $modalInstance.close(); + return; + } + egCore.net.request( + 'open-ils.circ', 'open-ils.circ.hold.uncancel', + egCore.auth.token(), hold_id + ).then(function(resp) { + if (evt = egCore.evt.parse(resp)) { + console.error('unable to uncancel hold: ' + + evt.toString()); + } + uncancel_one(); + }); + } + + uncancel_one(); + } + } + ] + }).result; + } + service.get_cancel_reasons = function() { if (egCore.env.ahrcc) return $q.when(egCore.env.ahrcc.list); return egCore.pcrud.retrieveAll('ahrcc', {}, {atomic : true})