[open-ils-commits] r17583 - in branches/rel_2_0/Open-ILS: src/sql/Pg src/sql/Pg/upgrade web/js/dojo/openils/actor/nls web/js/ui/default/actor/user (phasefx)
svn at svn.open-ils.org
svn at svn.open-ils.org
Fri Sep 10 14:18:25 EDT 2010
Author: phasefx
Date: 2010-09-10 14:18:21 -0400 (Fri, 10 Sep 2010)
New Revision: 17583
Added:
branches/rel_2_0/Open-ILS/src/sql/Pg/upgrade/0392.data.org-setting-ui.patron.editor_address_requirement.sql
Modified:
branches/rel_2_0/Open-ILS/src/sql/Pg/002.schema.config.sql
branches/rel_2_0/Open-ILS/src/sql/Pg/950.data.seed-values.sql
branches/rel_2_0/Open-ILS/web/js/dojo/openils/actor/nls/register.js
branches/rel_2_0/Open-ILS/web/js/ui/default/actor/user/register.js
Log:
merge r17582 from trunk for ui.patron.registration.require_address setting
Modified: branches/rel_2_0/Open-ILS/src/sql/Pg/002.schema.config.sql
===================================================================
--- branches/rel_2_0/Open-ILS/src/sql/Pg/002.schema.config.sql 2010-09-10 18:17:20 UTC (rev 17582)
+++ branches/rel_2_0/Open-ILS/src/sql/Pg/002.schema.config.sql 2010-09-10 18:18:21 UTC (rev 17583)
@@ -68,7 +68,7 @@
install_date TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()
);
-INSERT INTO config.upgrade_log (version) VALUES ('0391'); -- miker
+INSERT INTO config.upgrade_log (version) VALUES ('0392'); -- phasefx
CREATE TABLE config.bib_source (
id SERIAL PRIMARY KEY,
Modified: branches/rel_2_0/Open-ILS/src/sql/Pg/950.data.seed-values.sql
===================================================================
--- branches/rel_2_0/Open-ILS/src/sql/Pg/950.data.seed-values.sql 2010-09-10 18:17:20 UTC (rev 17582)
+++ branches/rel_2_0/Open-ILS/src/sql/Pg/950.data.seed-values.sql 2010-09-10 18:18:21 UTC (rev 17583)
@@ -6889,4 +6889,20 @@
'string'
);
+-- 0392.data.org-setting-ui.patron.editor_address_requirement.sql
+INSERT INTO config.org_unit_setting_type ( name, label, description, datatype ) VALUES (
+ 'ui.patron.registration.require_address',
+ oils_i18n_gettext(
+ 'ui.patron.registration.require_address',
+ 'GUI: Require at least one address for Patron Registration',
+ 'coust',
+ 'label'),
+ oils_i18n_gettext(
+ 'ui.patron.registration.require_address',
+ 'Enforces a requirement for having at least one address for a patron during registration.',
+ 'coust',
+ 'description'),
+ 'bool'
+);
+
Copied: branches/rel_2_0/Open-ILS/src/sql/Pg/upgrade/0392.data.org-setting-ui.patron.editor_address_requirement.sql (from rev 17582, trunk/Open-ILS/src/sql/Pg/upgrade/0392.data.org-setting-ui.patron.editor_address_requirement.sql)
===================================================================
--- branches/rel_2_0/Open-ILS/src/sql/Pg/upgrade/0392.data.org-setting-ui.patron.editor_address_requirement.sql (rev 0)
+++ branches/rel_2_0/Open-ILS/src/sql/Pg/upgrade/0392.data.org-setting-ui.patron.editor_address_requirement.sql 2010-09-10 18:18:21 UTC (rev 17583)
@@ -0,0 +1,20 @@
+BEGIN;
+
+INSERT INTO config.upgrade_log (version) VALUES ('0392'); -- phasefx
+
+INSERT INTO config.org_unit_setting_type ( name, label, description, datatype ) VALUES (
+ 'ui.patron.registration.require_address',
+ oils_i18n_gettext(
+ 'ui.patron.registration.require_address',
+ 'GUI: Require at least one address for Patron Registration',
+ 'coust',
+ 'label'),
+ oils_i18n_gettext(
+ 'ui.patron.registration.require_address',
+ 'Enforces a requirement for having at least one address for a patron during registration.',
+ 'coust',
+ 'description'),
+ 'bool'
+);
+
+COMMIT;
Modified: branches/rel_2_0/Open-ILS/web/js/dojo/openils/actor/nls/register.js
===================================================================
--- branches/rel_2_0/Open-ILS/web/js/dojo/openils/actor/nls/register.js 2010-09-10 18:17:20 UTC (rev 17582)
+++ branches/rel_2_0/Open-ILS/web/js/dojo/openils/actor/nls/register.js 2010-09-10 18:18:21 UTC (rev 17583)
@@ -1,4 +1,6 @@
{
+ "DELETE_ADDRESS" : "Delete address ${0}?",
+ "NEED_ADDRESS" : "An address is required during registration.",
"DUPE_PATRON_NAME" : "Found ${0} patron(s) with the same name",
"DUPE_PATRON_EMAIL" : "Found ${0} patron(s) with the same email address",
"DUPE_PATRON_IDENT" : "Found ${0} patron(s) with the same identification",
Modified: branches/rel_2_0/Open-ILS/web/js/ui/default/actor/user/register.js
===================================================================
--- branches/rel_2_0/Open-ILS/web/js/ui/default/actor/user/register.js 2010-09-10 18:17:20 UTC (rev 17582)
+++ branches/rel_2_0/Open-ILS/web/js/ui/default/actor/user/register.js 2010-09-10 18:18:21 UTC (rev 17583)
@@ -84,6 +84,7 @@
'ui.patron.default_inet_access_level',
'ui.patron.default_ident_type',
'ui.patron.default_country',
+ 'ui.patron.registration.require_address',
'circ.holds.behind_desk_pickup_supported',
'circ.patron_edit.clone.copy_address'
]);
@@ -1348,8 +1349,14 @@
function uEditDeleteAddr(id, noAlert) {
+ if (patron.isnew() && orgSettings['ui.patron.registration.require_address']) {
+ if (dojo.query('tr[name=uedit-addr-divider]').length < 2) {
+ alert(localeStrings.NEED_ADDRESS);
+ return;
+ }
+ }
if(!noAlert) {
- if(!confirm('Delete address ' + id)) return; /* XXX i18n */
+ if(!confirm(dojo.string.substitute(localeStrings.DELETE_ADDRESS, [id]))) return;
}
var addr = patron.addresses().filter(function(i){return (i.id() == id)})[0];
if (addr) { addr.isdeleted(1); }
More information about the open-ils-commits
mailing list