From: Bill Erickson Date: Mon, 28 Mar 2016 19:30:37 +0000 (-0400) Subject: LP#1564685 Allow delete of all patron addresses X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=6ec8bd4c16eb2bed8a4c59856f5ee17137ce853f;p=evergreen%2Ftadl.git LP#1564685 Allow delete of all patron addresses 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 Signed-off-by: Kathy Lussier Signed-off-by: Galen Charlton --- diff --git a/Open-ILS/src/templates/staff/circ/patron/register.tt2 b/Open-ILS/src/templates/staff/circ/patron/register.tt2 index 3eac3ef7fe..0df6f9e5fa 100644 --- a/Open-ILS/src/templates/staff/circ/patron/register.tt2 +++ b/Open-ILS/src/templates/staff/circ/patron/register.tt2 @@ -14,6 +14,8 @@ angular.module('egCoreMod').run(['egStrings', function(s) { 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.') %]" }]); 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 534bda5f2d..37e331aa9b 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 @@ -1309,6 +1309,14 @@ function PatronRegCtrl($scope, $routeParams, $q, $modal, $window, egCore, // 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) {