label="[% l('Find Another Target') %]"></eg-grid-action>
<eg-grid-action handler="grid_actions.cancel_hold"
label="[% l('Cancel Hold') %]"></eg-grid-action>
+ <eg-grid-action handler="grid_actions.uncancel_hold"
+ label="[% l('Uncancel Hold') %]"></eg-grid-action>
<eg-grid-field label="[% l('Hold ID') %]" path='hold.id'></eg-grid-field>
<eg-grid-field label="[% l('Current Copy') %]"
label="[% l('Find Another Target') %]"></eg-grid-action>
<eg-grid-action handler="grid_actions.cancel_hold"
label="[% l('Cancel Hold') %]"></eg-grid-action>
+ <eg-grid-action handler="grid_actions.uncancel_hold"
+ label="[% l('Uncancel Hold') %]"></eg-grid-action>
<eg-grid-field label="[% l('Hold ID') %]" path='hold.id'></eg-grid-field>
<eg-grid-field label="[% l('Current Copy') %]"
label="[% l('Find Another Target') %]"></eg-grid-action>
<eg-grid-action handler="grid_actions.cancel_hold"
label="[% l('Cancel Hold') %]"></eg-grid-action>
+ <eg-grid-action handler="grid_actions.uncancel_hold"
+ label="[% l('Uncancel Hold') %]"></eg-grid-action>
<eg-grid-field label="[% l('Hold ID') %]" path='hold.id'></eg-grid-field>
<eg-grid-field label="[% l('Current Copy') %]"
label="[% l('Find Another Target') %]"></eg-grid-action>
<eg-grid-action handler="grid_actions.cancel_hold"
label="[% l('Cancel Hold') %]"></eg-grid-action>
+ <eg-grid-action handler="grid_actions.uncancel_hold"
+ label="[% l('Uncancel Hold') %]"></eg-grid-action>
<eg-grid-field label="[% l('Hold ID') %]" path='hold.id'></eg-grid-field>
<eg-grid-field label="[% l('Current Copy') %]"
--- /dev/null
+<form ng-submit="ok()" role="form" class="form-horizontal">
+ <div class="modal-content">
+ <div class="modal-header">
+ <button type="button" class="close"
+ ng-click="cancel()" aria-hidden="true">×</button>
+ <h4 class="modal-title">
+ [% l('Uncancel [_1] Hold(s)', '{{args.num_holds}}') %]
+ </h4>
+ </div>
+ <div class="modal-body"></div>
+ <div class="modal-footer">
+ <input type="submit" class="btn btn-success" value="[% l('Uncancel Hold') %]"/>
+ <button class="btn btn-warning" ng-click="cancel($event)">[% l('Exit') %]</button>
+ </div>
+ </div>
+</div>
+
}).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})