From: Jason Stephenson Date: Sun, 20 Mar 2016 00:36:55 +0000 (-0400) Subject: LP 1507807: Show Alert dialogs in browser staff client. X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=fd5df4a699a2de74d13274d9f231f30a2d000182;p=evergreen%2Fpines.git 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 --- 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 7946ce5ba0..fd894156c4 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 0904c94fdb..99930793ff 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; }); }); @@ -85,6 +91,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}