[open-ils-commits] [GIT] Evergreen ILS branch master updated. e763bd684550bf44093734f14fb93ce05cddd458
Evergreen Git
git at git.evergreen-ils.org
Tue Sep 11 14:12:03 EDT 2018
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".
The branch, master has been updated
via e763bd684550bf44093734f14fb93ce05cddd458 (commit)
from 1d38620f4f01444d1bf9b9485f38a9bf3f9589d1 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit e763bd684550bf44093734f14fb93ce05cddd458
Author: Bill Erickson <berickxx at gmail.com>
Date: Mon Jul 30 17:23:49 2018 -0400
LP#1724083 Webstaff approve pending patron address
Add support for approving pending patron addresses in the webstaff
patron edit interface.
To test:
[1] Enable the pending address org unit setting.
[2] Log into the catalog and "edit" an address.
[3] Edit same user in staff client and use the Approve action.
Signed-off-by: Bill Erickson <berickxx at gmail.com>
Signed-off-by: Garry Collum <gcollum at gmail.com>
Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>
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 87a1522..3a502a7 100644
--- a/Open-ILS/src/templates/staff/circ/patron/t_edit.tt2
+++ b/Open-ILS/src/templates/staff/circ/patron/t_edit.tt2
@@ -825,6 +825,35 @@ within the "form" by name for validation.
</div>
</div>
+ <div ng-if="addr.pending" class="row">
+ <div class="col-md-6 patron-reg-pending-address">
+ <div class="row">
+ <div class="col-md-6">
+ [% l('This is a pending address') %]
+ </div>
+ <div class="col-md-6">
+ <button class="btn btn-success"
+ ng-click="approve_pending_address(addr)">[% l('Approve') %]</button>
+ </div>
+ </div>
+ <div class="row" ng-if="addr._replaces">
+ <div class="col-md-6">
+ [% | l(
+ '{{addr._replaces.street1}}',
+ '{{addr._replaces.street2}}',
+ '<br/>'
+ '{{addr._replaces.city}}',
+ '{{addr._replaces.state}}',
+ '{{addr._replaces.post_code}}') %]
+ Replaces: [_1] [_2] [_3] [_4], [_5] [_6]
+ [% END %]
+ </div>
+ </div>
+ </div>
+ <!-- make sure we occupy the entire row -->
+ <div class="col-md-6"> </div>
+ </div>
+
<!-- ADDRESS_TYPE -->
<div class="row reg-field-row" ng-show="show_field('aua.address_type')">
[% draw_field_label('aua', 'address_type') %]
diff --git a/Open-ILS/src/templates/staff/css/circ.css.tt2 b/Open-ILS/src/templates/staff/css/circ.css.tt2
index cbbf509..798117e 100644
--- a/Open-ILS/src/templates/staff/css/circ.css.tt2
+++ b/Open-ILS/src/templates/staff/css/circ.css.tt2
@@ -189,6 +189,13 @@ but the ones I'm finding aren't quite cutting it..*/
background-color: rgb(215, 215, 215);
}
+.patron-reg-pending-address {
+ border:2px dashed #d9e8f9;
+ -moz-border-radius: 10px;
+ padding: 10px;
+ margin-bottom: 5px;
+}
+
/* -- end patron registration -- */
[%#
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 30f2a63..7599020 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
@@ -720,6 +720,7 @@ angular.module('egCoreMod')
addr.id == patron.mailing_address.id);
addr._is_billing = (patron.billing_address &&
addr.id == patron.billing_address.id);
+ addr.pending = addr.pending === 't';
}
/*
@@ -761,6 +762,14 @@ angular.module('egCoreMod')
angular.forEach(patron.addresses,
function(addr) { service.ingest_address(patron, addr) });
+ // Link replaced address to its pending address.
+ angular.forEach(patron.addresses, function(addr) {
+ if (addr.replaces) {
+ addr._replaces = patron.addresses.filter(
+ function(a) {return a.id == addr.replaces})[0];
+ }
+ });
+
service.get_linked_addr_users(patron.addresses);
// Remove stat cat entries that link to out-of-scope stat
@@ -1071,6 +1080,7 @@ angular.module('egCoreMod')
patron.addresses().push(addr);
addr.valid(addr.valid() ? 't' : 'f');
addr.within_city_limits(addr.within_city_limits() ? 't' : 'f');
+ addr.pending(addr.pending() ? 't' : 'f');
if (addr_hash._is_mailing) patron.mailing_address(addr);
if (addr_hash._is_billing) patron.billing_address(addr);
});
@@ -1563,6 +1573,37 @@ function($scope , $routeParams , $q , $uibModal , $window , egCore ,
$scope.patron.addresses = addresses;
}
+ $scope.approve_pending_address = function(addr) {
+
+ egCore.net.request(
+ 'open-ils.actor',
+ 'open-ils.actor.user.pending_address.approve',
+ egCore.auth.token(), addr.id
+ ).then(function(replaced_id) {
+ var evt = egCore.evt.parse(replaced_id);
+ if (evt) { alert(evt); return; }
+
+ // Remove the pending address and the replaced address
+ // from the local list of patron addresses.
+ var addresses = [];
+ angular.forEach($scope.patron.addresses, function(a) {
+ if (a.id != addr.id && a.id != replaced_id) {
+ addresses.push(a);
+ }
+ });
+ $scope.patron.addresses = addresses;
+
+ // Fetch a fresh copy of the modified address from the server.
+ // and add it back to the list.
+ egCore.pcrud.retrieve('aua', replaced_id, {}, {authoritative: true})
+ .then(null, null, function(new_addr) {
+ new_addr = egCore.idl.toHash(new_addr);
+ patronRegSvc.ingest_address($scope.patron, new_addr);
+ $scope.patron.addresses.push(new_addr);
+ });
+ });
+ }
+
$scope.post_code_changed = function(addr) {
egCore.net.request(
'open-ils.search', 'open-ils.search.zip', addr.post_code)
-----------------------------------------------------------------------
Summary of changes:
.../src/templates/staff/circ/patron/t_edit.tt2 | 29 ++++++++++++++
Open-ILS/src/templates/staff/css/circ.css.tt2 | 7 +++
.../web/js/ui/default/staff/circ/patron/regctl.js | 41 ++++++++++++++++++++
3 files changed, 77 insertions(+), 0 deletions(-)
hooks/post-receive
--
Evergreen ILS
More information about the open-ils-commits
mailing list