From 46603396a83c58275c77ca8329f91d54ffc6d375 Mon Sep 17 00:00:00 2001 From: Dan Briem Date: Fri, 17 Jul 2020 16:09:54 -0400 Subject: [PATCH] LP#1887852 Pending patron passwords aren't initially set to phone # If a patron self registers with a phone # and the org unit setting to use the phone for the password is true, when the pending patron stage loads the password is initially random instead of the last 4 digits of the phone #. This branch sets the password to the last 4 digits of the phone when the patron stage loads if the phone is set and the org unit setting to use the phone # for the password is true. To test: 1. Set org unit settings for allow patron self-registration and show day_phone on registration to true 2. Go to the OPAC and request a library card (include phone #) 3. Login to the staff client, Circulation->Pending Patrons and load the patron 4. Note the password is random 5. Load patch and repeat steps 3-4 6. Note the password is the last 4 digits of the phone # Signed-off-by: Dan Briem Signed-off-by: Mike Risher Signed-off-by: Jason Stephenson --- Open-ILS/web/js/ui/default/staff/circ/patron/regctl.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 6a2a648d7d..0d6394db55 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 @@ -1305,7 +1305,12 @@ function($scope , $routeParams , $q , $uibModal , $window , egCore , function set_new_patron_defaults(prs) { if (!$scope.patron.passwd) { // passsword may originate from staged user. - $scope.generate_password(); + if ($scope.patron.day_phone && + $scope.org_settings['patron.password.use_phone']) { + $scope.patron.passwd = $scope.patron.day_phone.substr(-4); + } else { + $scope.generate_password(); + } } var notify = 'phone:email'; // hard-coded default when opac.hold_notify has no reg_default -- 2.43.2