From b4caf695febc075ea385b46816e1ce476e4739f1 Mon Sep 17 00:00:00 2001 From: Kyle Huckins Date: Tue, 25 Jun 2019 16:47:04 +0000 Subject: [PATCH] lp1437103 - Suppress Popups based on OU Setting - Allow OU setting to suppress checkin popups to properly take effect. Signed-off-by: Kyle Huckins Changes to be committed: modified: Open-ILS/web/js/ui/default/staff/circ/services/circ.js Signed-off-by: Bill Erickson --- Open-ILS/web/js/ui/default/staff/circ/services/circ.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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 8c104ccd13..502b96aa40 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 @@ -459,7 +459,7 @@ function($uibModal , $q , egCore , egAlertDialog , egConfirmDialog, egAddCopyAl } - if (options.suppress_checkin_popups + if (options.suppress_popups && evt.filter(function(e){return service.checkin_suppress_overrides.indexOf(e.textcode) == -1;}).length == 0) { // Events are suppressed. Re-run the checkin w/ override. options.override = true; @@ -1606,7 +1606,7 @@ function($uibModal , $q , egCore , egAlertDialog , egConfirmDialog, egAddCopyAl var copy = evt && evt.payload ? evt.payload.copy : null; - if (copy && !options.suppress_checkin_popups + if (copy && !options.suppress_popups && copy.location().checkin_alert() == 't') { return egAlertDialog.open( @@ -1685,7 +1685,7 @@ function($uibModal , $q , egCore , egAlertDialog , egConfirmDialog, egAddCopyAl case 11: /* CATALOGING */ egCore.audio.play('info.checkin.cataloging'); evt[0].route_to = egCore.strings.ROUTE_TO_CATALOGING; - if (options.no_precat_alert) + if (options.no_precat_alert || options.suppress_popups) return $q.when(final_resp); return egAlertDialog.open( egCore.strings.PRECAT_CHECKIN_MSG, params) @@ -1712,6 +1712,7 @@ function($uibModal , $q , egCore , egAlertDialog , egConfirmDialog, egAddCopyAl case 'ASSET_COPY_NOT_FOUND': egCore.audio.play('error.checkin.not_found'); + if (options.suppress_popups) return $q.when(final_resp); return egAlertDialog.open( egCore.strings.UNCAT_ALERT_DIALOG, params) .result.then(function() {return final_resp}); @@ -1719,7 +1720,7 @@ function($uibModal , $q , egCore , egAlertDialog , egConfirmDialog, egAddCopyAl case 'ITEM_NOT_CATALOGED': egCore.audio.play('error.checkin.not_cataloged'); evt[0].route_to = egCore.strings.ROUTE_TO_CATALOGING; - if (options.no_precat_alert) + if (options.no_precat_alert || options.suppress_popups) return $q.when(final_resp); return egAlertDialog.open( egCore.strings.PRECAT_CHECKIN_MSG, params) @@ -1778,6 +1779,7 @@ function($uibModal , $q , egCore , egAlertDialog , egConfirmDialog, egAddCopyAl } service.route_dialog = function(tmpl, evt, params, options) { + if (options.suppress_popups) return; if (angular.isArray(evt)) evt = evt[0]; return service.collect_route_data(tmpl, evt, params, options) -- 2.11.0