From bb0c48a7e27e1b59cf5bd6ab3f2c10ae4d03f04a Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Sun, 25 Oct 2015 11:42:11 -0400 Subject: [PATCH 1/1] LP#1452950 patron reg additions (phone pw, hiding stuff) 1. Generate password from last 4 digits of phone number if library setting is present (patron.password.use_phone). 2. Only show "replace barcode" and invlidate buttons when editing an existing patron. 3. Address no longer defaults to within_city_limits, consistent with dojo version. Signed-off-by: Bill Erickson Signed-off-by: Galen Charlton --- Open-ILS/src/templates/staff/circ/patron/t_edit.tt2 | 8 ++++++-- Open-ILS/web/js/ui/default/staff/circ/patron/regctl.js | 8 +++++++- 2 files changed, 13 insertions(+), 3 deletions(-) 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 2d8e8c3fe6..e6ffef49f9 100644 --- a/Open-ILS/src/templates/staff/circ/patron/t_edit.tt2 +++ b/Open-ILS/src/templates/staff/circ/patron/t_edit.tt2 @@ -75,6 +75,10 @@ focus-me="focus_usrname" ng-blur="usrname_changed(patron.usrname)" class="form-control" ng-model="[% model %]"/> + [% ELSIF field == 'day_phone' %] + [% ELSE %] @@ -88,7 +92,7 @@ [% IF field == 'barcode' %] - @@ -103,7 +107,7 @@ [% IF field.match('phone') OR field.match('email') %] - [% END %] 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 40809e58e3..52dd1f8eea 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 @@ -320,7 +320,7 @@ angular.module('egCoreMod') address_type : egCore.strings.REG_ADDR_TYPE, _is_mailing : true, _is_billing : true, - within_city_limits : true + within_city_limits : false }; var card = { @@ -659,6 +659,12 @@ function PatronRegCtrl($scope, $routeParams, $scope.patron.cards.push(new_card); } + $scope.day_phone_changed = function(phone) { + if (phone && $scope.org_settings['patron.password.use_phone']) { + $scope.patron.passwd = phone.substr(-4); + } + } + $scope.barcode_changed = function(bc) { if (!bc) return; egCore.net.request( -- 2.43.2