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,
'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'
+);
--- /dev/null
+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;
{
+ "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",
'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'
]);
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); }