LP#1452950 Patron reg pass=phone on new patrons only
authorBill Erickson <berickxx@gmail.com>
Sat, 16 Jan 2016 16:39:08 +0000 (11:39 -0500)
committerGalen Charlton <gmc@esilibrary.com>
Thu, 25 Feb 2016 22:32:00 +0000 (17:32 -0500)
When changing a patron's phone number, only modify the password for new
patrons when the org setting patron.password.use_phone is enabled.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Open-ILS/web/js/ui/default/staff/circ/patron/regctl.js

index 6670b76..f03a4eb 100644 (file)
@@ -939,8 +939,9 @@ function PatronRegCtrl($scope, $routeParams,
     }
 
     $scope.day_phone_changed = function(phone) {
-        if (phone && $scope.org_settings['patron.password.use_phone']) {
-           $scope.patron.passwd = phone.substr(-4);
+        if (phone && $scope.patron.isnew && 
+            $scope.org_settings['patron.password.use_phone']) {
+            $scope.patron.passwd = phone.substr(-4);
         }
     }