From 3e113b09880f6d6df8deee8badd681f402767a45 Mon Sep 17 00:00:00 2001 From: Kyle Huckins Date: Wed, 19 Oct 2016 14:57:02 -0700 Subject: [PATCH] LP#1621947 Address Alert functionality Add Address Alert to the alerts pane when address alert is detected. Add detection for address alerts. Signed-off-by: Kyle Huckins Changes to be committed: modified: Open-ILS/src/templates/staff/circ/patron/t_edit.tt2 modified: Open-ILS/web/js/ui/default/staff/circ/patron/regctl.js --- .../src/templates/staff/circ/patron/t_edit.tt2 | 7 +++++++ .../web/js/ui/default/staff/circ/patron/regctl.js | 23 ++++++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/Open-ILS/src/templates/staff/circ/patron/t_edit.tt2 b/Open-ILS/src/templates/staff/circ/patron/t_edit.tt2 index 5543e9d8c2..b7516dc702 100644 --- a/Open-ILS/src/templates/staff/circ/patron/t_edit.tt2 +++ b/Open-ILS/src/templates/staff/circ/patron/t_edit.tt2 @@ -55,6 +55,13 @@ +
+
[% l('Address Alert') %]
+
+ {{address_alert.alert_message()}} +
+
+
diff --git a/Open-ILS/web/js/ui/default/staff/circ/patron/regctl.js b/Open-ILS/web/js/ui/default/staff/circ/patron/regctl.js index 10054530cf..f0a45cddb3 100644 --- a/Open-ILS/web/js/ui/default/staff/circ/patron/regctl.js +++ b/Open-ILS/web/js/ui/default/staff/circ/patron/regctl.js @@ -1106,6 +1106,7 @@ function($scope , $routeParams , $q , $uibModal , $window , egCore , // for existing patrons, disable barcode input by default $scope.disable_bc = $scope.focus_usrname = Boolean($scope.patron_id); $scope.focus_bc = !Boolean($scope.patron_id); + $scope.address_alerts = []; $scope.dupe_counts = {}; // map of perm name to true/false for perms the logged in user @@ -1587,6 +1588,27 @@ function($scope , $routeParams , $q , $uibModal , $window , egCore , patronRegSvc.invalidate_field($scope.patron, field); } + address_alert = function(addr) { + var args = { + street1: addr.street1, + street2: addr.street2, + city: addr.city, + state: addr.state, + county: addr.county, + country: addr.country, + post_code: addr.post_code, + mailing_address: addr._is_mailing, + billing_address: addr._is_billing + } + + egCore.net.request( + 'open-ils.actor', + 'open-ils.actor.address_alert.test', + egCore.auth.token(), egCore.auth.user().ws_ou(), args + ).then(function(res) { + $scope.address_alerts = res; + }); + } $scope.dupe_value_changed = function(type, value) { $scope.dupe_counts[type] = 0; @@ -1689,6 +1711,7 @@ function($scope , $routeParams , $q , $uibModal , $window , egCore , case 'city': // dupe search on address wants the address object as the value. $scope.dupe_value_changed('address', obj); + address_alert(obj); break; case 'post_code': -- 2.11.0