From dc6450547ae750ff473e78e86586b17217388f09 Mon Sep 17 00:00:00 2001 From: Jason Etheridge Date: Wed, 16 Aug 2017 09:05:25 -0400 Subject: [PATCH] lp1709966 webstaff: Hold Verify prompt This implements the prompt and call logic for the Hold Verify feature for copy locations. Signed-off-by: Jason Etheridge Signed-off-by: Kathy Lussier --- .../staff/circ/checkin/t_hold_verify.tt2 | 16 +++++++++ .../js/ui/default/staff/circ/services/circ.js | 34 +++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 Open-ILS/src/templates/staff/circ/checkin/t_hold_verify.tt2 diff --git a/Open-ILS/src/templates/staff/circ/checkin/t_hold_verify.tt2 b/Open-ILS/src/templates/staff/circ/checkin/t_hold_verify.tt2 new file mode 100644 index 0000000000..75e6292ece --- /dev/null +++ b/Open-ILS/src/templates/staff/circ/checkin/t_hold_verify.tt2 @@ -0,0 +1,16 @@ +
+ + + + +
diff --git a/Open-ILS/web/js/ui/default/staff/circ/services/circ.js b/Open-ILS/web/js/ui/default/staff/circ/services/circ.js index f219d57bb0..0890034ce9 100644 --- a/Open-ILS/web/js/ui/default/staff/circ/services/circ.js +++ b/Open-ILS/web/js/ui/default/staff/circ/services/circ.js @@ -109,6 +109,7 @@ function($uibModal , $q , egCore , egAlertDialog , egConfirmDialog, // these events can be overridden by staff during checkin service.checkin_overridable_events = service.checkin_suppress_overrides.concat([ + 'HOLD_CAPTURE_DELAYED', // not technically overridable, but special prompt and param 'TRANSIT_CHECKIN_INTERVAL_BLOCK' ]) @@ -396,6 +397,8 @@ function($uibModal , $q , egCore , egAlertDialog , egConfirmDialog, switch(evt[0].textcode) { case 'COPY_ALERT_MESSAGE': return service.copy_alert_dialog(evt[0], params, options, 'checkin'); + case 'HOLD_CAPTURE_DELAYED': + return service.hold_capture_delay_dialog(evt[0], params, options, 'checkin'); default: return service.override_dialog(evt, params, options, 'checkin'); } @@ -1512,6 +1515,37 @@ function($uibModal , $q , egCore , egAlertDialog , egConfirmDialog, }); } + // action == what action to take if the user confirms the alert + service.hold_capture_delay_dialog = function(evt, params, options, action) { + if (angular.isArray(evt)) evt = evt[0]; + return $uibModal.open({ + templateUrl: './circ/checkin/t_hold_verify', + controller: + ['$scope','$uibModalInstance','params', + function($scope , $uibModalInstance , params) { + $scope.copy_barcode = params.copy_barcode; + $scope.capture = function() { + params.capture = 'capture'; + $uibModalInstance.close(); + }; + $scope.nocapture = function() { + params.capture = 'nocapture'; + $uibModalInstance.close(); + }; + $scope.cancel = function() { $uibModalInstance.dismiss(); }; + }], + resolve : { + params : function() { + return params; + } + } + }).result.then( + function(r) { + return service[action](params, options); + } + ); + } + // check the barcode. If it's no good, show the warning dialog // Resolves on success, rejected on error service.test_barcode = function(bc) { -- 2.43.2