From 1a0e8b2e75ece09694810cd7f3ba8b4c0cf0cec0 Mon Sep 17 00:00:00 2001 From: Jason Stephenson Date: Sat, 19 Mar 2016 20:36:55 -0400 Subject: [PATCH] LP 1507807: Show Alert dialogs in browser staff client. If the circ.in_house_use.copy_alert org setting is true and the copy has an alert_message, then we display an alert dialog with the copy alert message when doing an in-house-use in the browser staff client. If the circ.in_house_use.checkin_alert org setting is true and the copy location checkin_alert field is also true, then we display an alert dialog with the "item needs to be routed to..." alert message when doing an in-house-use in the browser staff client. Signed-off-by: Jason Stephenson Signed-off-by: Kathy Lussier --- .../staff/circ/in_house_use/index.tt2 | 1 + .../ui/default/staff/circ/in_house_use/app.js | 22 ++++++++++++++++--- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/Open-ILS/src/templates/staff/circ/in_house_use/index.tt2 b/Open-ILS/src/templates/staff/circ/in_house_use/index.tt2 index 34b7ef0df6..254d8044ae 100644 --- a/Open-ILS/src/templates/staff/circ/in_house_use/index.tt2 +++ b/Open-ILS/src/templates/staff/circ/in_house_use/index.tt2 @@ -8,6 +8,7 @@ [% BLOCK APP_JS %] +[% INCLUDE 'staff/circ/share/circ_strings.tt2' %] [% END %] diff --git a/Open-ILS/web/js/ui/default/staff/circ/in_house_use/app.js b/Open-ILS/web/js/ui/default/staff/circ/in_house_use/app.js index 2183d96fe4..dab5420211 100644 --- a/Open-ILS/web/js/ui/default/staff/circ/in_house_use/app.js +++ b/Open-ILS/web/js/ui/default/staff/circ/in_house_use/app.js @@ -9,8 +9,8 @@ angular.module('egInHouseUseApp', }) .controller('InHouseUseCtrl', - ['$scope','egCore','egGridDataProvider','egConfirmDialog', -function($scope, egCore, egGridDataProvider , egConfirmDialog) { + ['$scope','egCore','egGridDataProvider','egConfirmDialog', 'egAlertDialog', +function($scope, egCore, egGridDataProvider , egConfirmDialog, egAlertDialog) { var countCap; var countMax; @@ -31,11 +31,17 @@ function($scope, egCore, egGridDataProvider , egConfirmDialog) { egCore.org.settings([ 'ui.circ.in_house_use.entry_cap', - 'ui.circ.in_house_use.entry_warn' + 'ui.circ.in_house_use.entry_warn', + 'circ.in_house_use.copy_alert', + 'circ.in_house_use.checkin_alert' ]).then(function(set) { countWarn = set['ui.circ.in_house_use.entry_warn'] || 20; $scope.countMax = countMax = set['ui.circ.in_house_use.entry_cap'] || 99; + $scope.copyAlert = copyAlert = + set['circ.in_house_use.copy_alert'] || false; + $scope.checkinAlert = checkinAlert = + set['circ.in_house_use.checkin_alert'] || false; }); }); @@ -86,6 +92,16 @@ function($scope, egCore, egGridDataProvider , egConfirmDialog) { coArgs.copyid = copy.id(); + // LP1507807: Display the copy alert if the setting is on. + if ($scope.copyAlert && copy.alert_message()) { + egAlertDialog.open(copy.alert_message()).result; + } + + // LP1507807: Display the location alert if the setting is on. + if ($scope.checkinAlert && copy.location().checkin_alert() == 't') { + egAlertDialog.open(egCore.strings.LOCATION_ALERT_MSG, {copy: copy}).result; + } + performCheckout( 'open-ils.circ.in_house_use.create', coArgs, {copy:copy} -- 2.43.2