[open-ils-commits] r17517 - in trunk/Open-ILS: src/sql/Pg src/sql/Pg/upgrade web/js/ui/default/actor/user (phasefx)
svn at svn.open-ils.org
svn at svn.open-ils.org
Wed Sep 8 14:10:19 EDT 2010
Author: phasefx
Date: 2010-09-08 14:10:15 -0400 (Wed, 08 Sep 2010)
New Revision: 17517
Added:
trunk/Open-ILS/src/sql/Pg/upgrade/0388.data.org-setting-ui.patron.editor_defaults.sql
Modified:
trunk/Open-ILS/src/sql/Pg/002.schema.config.sql
trunk/Open-ILS/src/sql/Pg/950.data.seed-values.sql
trunk/Open-ILS/web/js/ui/default/actor/user/register.js
Log:
org unit settings for default ident type and default country for new users and new addresses in patron editor
Modified: trunk/Open-ILS/src/sql/Pg/002.schema.config.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/002.schema.config.sql 2010-09-08 16:17:48 UTC (rev 17516)
+++ trunk/Open-ILS/src/sql/Pg/002.schema.config.sql 2010-09-08 18:10:15 UTC (rev 17517)
@@ -68,7 +68,7 @@
install_date TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()
);
-INSERT INTO config.upgrade_log (version) VALUES ('0387'); -- gmc
+INSERT INTO config.upgrade_log (version) VALUES ('0388'); -- phasefx
CREATE TABLE config.bib_source (
id SERIAL PRIMARY KEY,
Modified: trunk/Open-ILS/src/sql/Pg/950.data.seed-values.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/950.data.seed-values.sql 2010-09-08 16:17:48 UTC (rev 17516)
+++ trunk/Open-ILS/src/sql/Pg/950.data.seed-values.sql 2010-09-08 18:10:15 UTC (rev 17517)
@@ -6869,3 +6869,37 @@
'bool'
);
+-- 0388.data.org-setting-ui.patron.editor_defaults.sql
+
+INSERT INTO config.org_unit_setting_type ( name, label, description, datatype, fm_class ) VALUES (
+ 'ui.patron.default_ident_type',
+ oils_i18n_gettext(
+ 'ui.patron.default_ident_type',
+ 'GUI: Default Ident Type for Patron Registration',
+ 'coust',
+ 'label'),
+ oils_i18n_gettext(
+ 'ui.patron.default_ident_type',
+ 'This is the default Ident Type for new users in the patron editor.',
+ 'coust',
+ 'description'),
+ 'link',
+ 'cit'
+);
+
+INSERT INTO config.org_unit_setting_type ( name, label, description, datatype ) VALUES (
+ 'ui.patron.default_country',
+ oils_i18n_gettext(
+ 'ui.patron.default_country',
+ 'GUI: Default Country for New Addresses in Patron Editor',
+ 'coust',
+ 'label'),
+ oils_i18n_gettext(
+ 'ui.patron.default_country',
+ 'This is the default Country for new addresses in the patron editor.',
+ 'coust',
+ 'description'),
+ 'string'
+);
+
+
Added: trunk/Open-ILS/src/sql/Pg/upgrade/0388.data.org-setting-ui.patron.editor_defaults.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/upgrade/0388.data.org-setting-ui.patron.editor_defaults.sql (rev 0)
+++ trunk/Open-ILS/src/sql/Pg/upgrade/0388.data.org-setting-ui.patron.editor_defaults.sql 2010-09-08 18:10:15 UTC (rev 17517)
@@ -0,0 +1,36 @@
+BEGIN;
+
+INSERT INTO config.upgrade_log (version) VALUES ('0388'); -- phasefx
+
+INSERT INTO config.org_unit_setting_type ( name, label, description, datatype, fm_class ) VALUES (
+ 'ui.patron.default_ident_type',
+ oils_i18n_gettext(
+ 'ui.patron.default_ident_type',
+ 'GUI: Default Ident Type for Patron Registration',
+ 'coust',
+ 'label'),
+ oils_i18n_gettext(
+ 'ui.patron.default_ident_type',
+ 'This is the default Ident Type for new users in the patron editor.',
+ 'coust',
+ 'description'),
+ 'link',
+ 'cit'
+);
+
+INSERT INTO config.org_unit_setting_type ( name, label, description, datatype ) VALUES (
+ 'ui.patron.default_country',
+ oils_i18n_gettext(
+ 'ui.patron.default_country',
+ 'GUI: Default Country for New Addresses in Patron Editor',
+ 'coust',
+ 'label'),
+ oils_i18n_gettext(
+ 'ui.patron.default_country',
+ 'This is the default Country for new addresses in the patron editor.',
+ 'coust',
+ 'description'),
+ 'string'
+);
+
+COMMIT;
Modified: trunk/Open-ILS/web/js/ui/default/actor/user/register.js
===================================================================
--- trunk/Open-ILS/web/js/ui/default/actor/user/register.js 2010-09-08 16:17:48 UTC (rev 17516)
+++ trunk/Open-ILS/web/js/ui/default/actor/user/register.js 2010-09-08 18:10:15 UTC (rev 17517)
@@ -82,6 +82,8 @@
'global.juvenile_age_threshold',
'patron.password.use_phone',
'ui.patron.default_inet_access_level',
+ 'ui.patron.default_ident_type',
+ 'ui.patron.default_country',
'circ.holds.behind_desk_pickup_supported',
'circ.patron_edit.clone.copy_address'
]);
@@ -1003,6 +1005,7 @@
patron.card(card);
patron.cards([card]);
patron.net_access_level(orgSettings['ui.patron.default_inet_access_level'] || 1);
+ patron.ident_type(orgSettings['ui.patron.default_ident_type']);
patron.stat_cat_entries([]);
patron.survey_responses([]);
patron.addresses([]);
@@ -1060,6 +1063,7 @@
addr.id(w._addr);
addr.isnew(1);
addr.usr(patron.id());
+ addr.country(orgSettings['ui.patron.default_country']);
var t = patron.addresses();
if (!t) { t = []; }
t.push(addr);
@@ -1208,6 +1212,10 @@
if(id < 0 && row.getAttribute('fmfield') == 'valid')
widget.widget.attr('value', true);
+ // make new addresses use the org setting for default country
+ if(id < 0 && row.getAttribute('fmfield') == 'country')
+ widget.widget.attr('value',orgSettings['ui.patron.default_country']);
+
} else if(row.getAttribute('name') == 'uedit-addr-pending-row') {
// if it's a pending address, show the 'approve' button
More information about the open-ils-commits
mailing list