LP 1507807: Show Alert dialogs in browser staff client.
authorJason Stephenson <jason@sigio.com>
Sun, 20 Mar 2016 00:36:55 +0000 (20:36 -0400)
committerKathy Lussier <klussier@masslnc.org>
Tue, 14 Feb 2017 05:05:52 +0000 (00:05 -0500)
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 <jason@sigio.com>
Signed-off-by: Kathy Lussier <klussier@masslnc.org>
Open-ILS/src/templates/staff/circ/in_house_use/index.tt2
Open-ILS/web/js/ui/default/staff/circ/in_house_use/app.js

index 34b7ef0..254d804 100644 (file)
@@ -8,6 +8,7 @@
 [% BLOCK APP_JS %]
 <script src="[% ctx.media_prefix %]/js/ui/default/staff/services/grid.js"></script>
 <script src="[% ctx.media_prefix %]/js/ui/default/staff/services/ui.js"></script>
+[% INCLUDE 'staff/circ/share/circ_strings.tt2' %]
 <script src="[% ctx.media_prefix %]/js/ui/default/staff/circ/in_house_use/app.js"></script>
 [% END %]
 
index 2183d96..dab5420 100644 (file)
@@ -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}