If the org setting ui.patron.registration.require_address is not true,
allow all addresses to be removed from a patron's account.
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Kathy Lussier <klussier@masslnc.org>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
s.REG_ADDR_TYPE = "[% l('Mailing') %]";
s.REG_INVALID_FIELDS =
"[% l('Please enter valid values for all required fields.') %]"
+ s.REG_ADDR_REQUIRED =
+ "[% l('An address is required during registration.') %]"
}]);
</script>
<link rel="stylesheet" href="[% ctx.base_path %]/staff/css/circ.css" />
// when the patron is updated.
deleted_addresses = [];
$scope.delete_address = function(id) {
+
+ if ($scope.patron.isnew &&
+ $scope.patron.addresses.length == 1 &&
+ $scope.org_settings['ui.patron.registration.require_address']) {
+ egAlertDialog.open(egCore.strings.REG_ADDR_REQUIRED);
+ return;
+ }
+
var addresses = [];
angular.forEach($scope.patron.addresses, function(addr) {
if (addr.id == id) {