Patch from Thomas Berezansky:
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 9 Mar 2011 19:23:55 +0000 (19:23 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 9 Mar 2011 19:23:55 +0000 (19:23 +0000)
The attached patch adds a collection of settings for patron registration, as well as a new display mode.

The new display mode is "Suggested" compared to "Required" or "All". It shows everything "Required" does, but also shows fields flagged as "Suggested", stat cats, and surveys.

To control this and other things are the settings. They come in a few general categories, named ui.patron.edit.<fmclass>.<fmfield>.? where ? is one of the following:

require - Flag the field as required when it otherwise wouldn't be.
show - Show the field like required fields, but don't actually require it.
suggest - Show the field with required/shown fields in "show suggested fields" mode
example - An example string for a field
regex - A regular expression for validating a field

Not all fields have all of the above options by default, although the initial list is the main limiter compared to the code side.

Also included are the following settings:
ui.patron.edit.au.dob.calendar - If true, shows the calendar widget for the date of birth field
ui.patron.edit.phone.example - Example for all phone fields without their own
ui.patron.edit.phone.regex - Regex validator for all phone fields without their own
ui.patron.edit.default_suggested - Default to showing suggested fields instead of all fields

git-svn-id: svn://svn.open-ils.org/ILS/trunk@19663 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/sql/Pg/002.schema.config.sql
Open-ILS/src/sql/Pg/950.data.seed-values.sql
Open-ILS/src/sql/Pg/upgrade/0497.patron_registration.sql [new file with mode: 0644]
Open-ILS/web/css/skin/default/register.css
Open-ILS/web/js/dojo/openils/actor/nls/register.js
Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js
Open-ILS/web/js/ui/default/actor/user/register.js
Open-ILS/web/templates/default/actor/user/register.tt2
Open-ILS/web/templates/default/actor/user/register_table.tt2

index 76457df..daff4d7 100644 (file)
@@ -70,7 +70,7 @@ CREATE TABLE config.upgrade_log (
     install_date    TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()
 );
 
-INSERT INTO config.upgrade_log (version) VALUES ('0496'); -- dbs
+INSERT INTO config.upgrade_log (version) VALUES ('0497'); -- miker for tsbere
 
 CREATE TABLE config.bib_source (
        id              SERIAL  PRIMARY KEY,
index 957a5b2..e0727e9 100644 (file)
@@ -2190,6 +2190,227 @@ INSERT INTO config.org_unit_setting_type
         'interval'
     );
 
+-- 0XXX.patron_registration.sql
+INSERT into config.org_unit_setting_type
+( name, label, description, datatype ) VALUES
+
+( 'ui.patron.edit.au.active.show',
+    oils_i18n_gettext('ui.patron.edit.au.active.show', 'GUI: Show active field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.au.active.show', 'The active field will be shown on the patron registration screen. Showing a field makes it appear with required fields even when not required. If the field is required this setting is ignored.', 'coust', 'description'),
+    'bool'),
+( 'ui.patron.edit.au.active.suggest',
+    oils_i18n_gettext('ui.patron.edit.au.active.suggest', 'GUI: Suggest active field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.au.active.suggest', 'The active field will be suggested on the patron registration screen. Suggesting a field makes it appear when suggested fields are shown. If the field is shown or required this setting is ignored.', 'coust', 'description'),
+    'bool'),
+( 'ui.patron.edit.au.alert_message.show',
+    oils_i18n_gettext('ui.patron.edit.au.alert_message.show', 'GUI: Show alert_message field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.au.alert_message.show', 'The alert_message field will be shown on the patron registration screen. Showing a field makes it appear with required fields even when not required. If the field is required this setting is ignored.', 'coust', 'description'),
+    'bool'),
+( 'ui.patron.edit.au.alert_message.suggest',
+    oils_i18n_gettext('ui.patron.edit.au.alert_message.suggest', 'GUI: Suggest alert_message field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.au.alert_message.suggest', 'The alert_message field will be suggested on the patron registration screen. Suggesting a field makes it appear when suggested fields are shown. If the field is shown or required this setting is ignored.', 'coust', 'description'),
+    'bool'),
+( 'ui.patron.edit.au.alias.show',
+    oils_i18n_gettext('ui.patron.edit.au.alias.show', 'GUI: Show alias field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.au.alias.show', 'The alias field will be shown on the patron registration screen. Showing a field makes it appear with required fields even when not required. If the field is required this setting is ignored.', 'coust', 'description'),
+    'bool'),
+( 'ui.patron.edit.au.alias.suggest',
+    oils_i18n_gettext('ui.patron.edit.au.alias.suggest', 'GUI: Suggest alias field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.au.alias.suggest', 'The alias field will be suggested on the patron registration screen. Suggesting a field makes it appear when suggested fields are shown. If the field is shown or required this setting is ignored.', 'coust', 'description'),
+    'bool'),
+( 'ui.patron.edit.au.barred.show',
+    oils_i18n_gettext('ui.patron.edit.au.barred.show', 'GUI: Show barred field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.au.barred.show', 'The barred field will be shown on the patron registration screen. Showing a field makes it appear with required fields even when not required. If the field is required this setting is ignored.', 'coust', 'description'),
+    'bool'),
+( 'ui.patron.edit.au.barred.suggest',
+    oils_i18n_gettext('ui.patron.edit.au.barred.suggest', 'GUI: Suggest barred field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.au.barred.suggest', 'The barred field will be suggested on the patron registration screen. Suggesting a field makes it appear when suggested fields are shown. If the field is shown or required this setting is ignored.', 'coust', 'description'),
+    'bool'),
+( 'ui.patron.edit.au.claims_never_checked_out_count.show',
+    oils_i18n_gettext('ui.patron.edit.au.claims_never_checked_out_count.show', 'GUI: Show claims_never_checked_out_count field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.au.claims_never_checked_out_count.show', 'The claims_never_checked_out_count field will be shown on the patron registration screen. Showing a field makes it appear with required fields even when not required. If the field is required this setting is ignored.', 'coust', 'description'),
+    'bool'),
+( 'ui.patron.edit.au.claims_never_checked_out_count.suggest',
+    oils_i18n_gettext('ui.patron.edit.au.claims_never_checked_out_count.suggest', 'GUI: Suggest claims_never_checked_out_count field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.au.claims_never_checked_out_count.suggest', 'The claims_never_checked_out_count field will be suggested on the patron registration screen. Suggesting a field makes it appear when suggested fields are shown. If the field is shown or required this setting is ignored.', 'coust', 'description'),
+    'bool'),
+( 'ui.patron.edit.au.claims_returned_count.show',
+    oils_i18n_gettext('ui.patron.edit.au.claims_returned_count.show', 'GUI: Show claims_returned_count field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.au.claims_returned_count.show', 'The claims_returned_count field will be shown on the patron registration screen. Showing a field makes it appear with required fields even when not required. If the field is required this setting is ignored.', 'coust', 'description'),
+    'bool'),
+( 'ui.patron.edit.au.claims_returned_count.suggest',
+    oils_i18n_gettext('ui.patron.edit.au.claims_returned_count.suggest', 'GUI: Suggest claims_returned_count field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.au.claims_returned_count.suggest', 'The claims_returned_count field will be suggested on the patron registration screen. Suggesting a field makes it appear when suggested fields are shown. If the field is shown or required this setting is ignored.', 'coust', 'description'),
+    'bool'),
+( 'ui.patron.edit.au.day_phone.example',
+    oils_i18n_gettext('ui.patron.edit.au.day_phone.example', 'GUI: Example for day_phone field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.au.day_phone.example', 'The Example for validation on the day_phone field in patron registration.', 'coust', 'description'),
+    'string'),
+( 'ui.patron.edit.au.day_phone.regex',
+    oils_i18n_gettext('ui.patron.edit.au.day_phone.regex', 'GUI: Regex for day_phone field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.au.day_phone.regex', 'The Regular Expression for validation on the day_phone field in patron registration.', 'coust', 'description'),
+    'string'),
+( 'ui.patron.edit.au.day_phone.require',
+    oils_i18n_gettext('ui.patron.edit.au.day_phone.require', 'GUI: Require day_phone field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.au.day_phone.require', 'The day_phone field will be required on the patron registration screen.', 'coust', 'description'),
+    'bool'),
+( 'ui.patron.edit.au.day_phone.show',
+    oils_i18n_gettext('ui.patron.edit.au.day_phone.show', 'GUI: Show day_phone field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.au.day_phone.show', 'The day_phone field will be shown on the patron registration screen. Showing a field makes it appear with required fields even when not required. If the field is required this setting is ignored.', 'coust', 'description'),
+    'bool'),
+( 'ui.patron.edit.au.day_phone.suggest',
+    oils_i18n_gettext('ui.patron.edit.au.day_phone.suggest', 'GUI: Suggest day_phone field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.au.day_phone.suggest', 'The day_phone field will be suggested on the patron registration screen. Suggesting a field makes it appear when suggested fields are shown. If the field is shown or required this setting is ignored.', 'coust', 'description'),
+    'bool'),
+( 'ui.patron.edit.au.dob.calendar',
+    oils_i18n_gettext('ui.patron.edit.au.dob.calendar', 'GUI: Show calendar widget for dob field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.au.dob.calendar', 'If set the calendar widget will appear when editing the dob field on the patron registration form.', 'coust', 'description'),
+    'bool'),
+( 'ui.patron.edit.au.dob.require',
+    oils_i18n_gettext('ui.patron.edit.au.dob.require', 'GUI: Require dob field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.au.dob.require', 'The dob field will be required on the patron registration screen.', 'coust', 'description'),
+    'bool'),
+( 'ui.patron.edit.au.dob.show',
+    oils_i18n_gettext('ui.patron.edit.au.dob.show', 'GUI: Show dob field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.au.dob.show', 'The dob field will be shown on the patron registration screen. Showing a field makes it appear with required fields even when not required. If the field is required this setting is ignored.', 'coust', 'description'),
+    'bool'),
+( 'ui.patron.edit.au.dob.suggest',
+    oils_i18n_gettext('ui.patron.edit.au.dob.suggest', 'GUI: Suggest dob field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.au.dob.suggest', 'The dob field will be suggested on the patron registration screen. Suggesting a field makes it appear when suggested fields are shown. If the field is shown or required this setting is ignored.', 'coust', 'description'),
+    'bool'),
+( 'ui.patron.edit.au.email.example',
+    oils_i18n_gettext('ui.patron.edit.au.email.example', 'GUI: Example for email field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.au.email.example', 'The Example for validation on the email field in patron registration.', 'coust', 'description'),
+    'string'),
+( 'ui.patron.edit.au.email.regex',
+    oils_i18n_gettext('ui.patron.edit.au.email.regex', 'GUI: Regex for email field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.au.email.regex', 'The Regular Expression for validation on the email field in patron registration.', 'coust', 'description'),
+    'string'),
+( 'ui.patron.edit.au.email.require',
+    oils_i18n_gettext('ui.patron.edit.au.email.require', 'GUI: Require email field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.au.email.require', 'The email field will be required on the patron registration screen.', 'coust', 'description'),
+    'bool'),
+( 'ui.patron.edit.au.email.show',
+    oils_i18n_gettext('ui.patron.edit.au.email.show', 'GUI: Show email field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.au.email.show', 'The email field will be shown on the patron registration screen. Showing a field makes it appear with required fields even when not required. If the field is required this setting is ignored.', 'coust', 'description'),
+    'bool'),
+( 'ui.patron.edit.au.email.suggest',
+    oils_i18n_gettext('ui.patron.edit.au.email.suggest', 'GUI: Suggest email field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.au.email.suggest', 'The email field will be suggested on the patron registration screen. Suggesting a field makes it appear when suggested fields are shown. If the field is shown or required this setting is ignored.', 'coust', 'description'),
+    'bool'),
+( 'ui.patron.edit.au.evening_phone.example',
+    oils_i18n_gettext('ui.patron.edit.au.evening_phone.example', 'GUI: Example for evening_phone field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.au.evening_phone.example', 'The Example for validation on the evening_phone field in patron registration.', 'coust', 'description'),
+    'string'),
+( 'ui.patron.edit.au.evening_phone.regex',
+    oils_i18n_gettext('ui.patron.edit.au.evening_phone.regex', 'GUI: Regex for evening_phone field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.au.evening_phone.regex', 'The Regular Expression for validation on the evening_phone field in patron registration.', 'coust', 'description'),
+    'string'),
+( 'ui.patron.edit.au.evening_phone.require',
+    oils_i18n_gettext('ui.patron.edit.au.evening_phone.require', 'GUI: Require evening_phone field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.au.evening_phone.require', 'The evening_phone field will be required on the patron registration screen.', 'coust', 'description'),
+    'bool'),
+( 'ui.patron.edit.au.evening_phone.show',
+    oils_i18n_gettext('ui.patron.edit.au.evening_phone.show', 'GUI: Show evening_phone field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.au.evening_phone.show', 'The evening_phone field will be shown on the patron registration screen. Showing a field makes it appear with required fields even when not required. If the field is required this setting is ignored.', 'coust', 'description'),
+    'bool'),
+( 'ui.patron.edit.au.evening_phone.suggest',
+    oils_i18n_gettext('ui.patron.edit.au.evening_phone.suggest', 'GUI: Suggest evening_phone field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.au.evening_phone.suggest', 'The evening_phone field will be suggested on the patron registration screen. Suggesting a field makes it appear when suggested fields are shown. If the field is shown or required this setting is ignored.', 'coust', 'description'),
+    'bool'),
+( 'ui.patron.edit.au.ident_value.show',
+    oils_i18n_gettext('ui.patron.edit.au.ident_value.show', 'GUI: Show ident_value field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.au.ident_value.show', 'The ident_value field will be shown on the patron registration screen. Showing a field makes it appear with required fields even when not required. If the field is required this setting is ignored.', 'coust', 'description'),
+    'bool'),
+( 'ui.patron.edit.au.ident_value.suggest',
+    oils_i18n_gettext('ui.patron.edit.au.ident_value.suggest', 'GUI: Suggest ident_value field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.au.ident_value.suggest', 'The ident_value field will be suggested on the patron registration screen. Suggesting a field makes it appear when suggested fields are shown. If the field is shown or required this setting is ignored.', 'coust', 'description'),
+    'bool'),
+( 'ui.patron.edit.au.ident_value2.show',
+    oils_i18n_gettext('ui.patron.edit.au.ident_value2.show', 'GUI: Show ident_value2 field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.au.ident_value2.show', 'The ident_value2 field will be shown on the patron registration screen. Showing a field makes it appear with required fields even when not required. If the field is required this setting is ignored.', 'coust', 'description'),
+    'bool'),
+( 'ui.patron.edit.au.ident_value2.suggest',
+    oils_i18n_gettext('ui.patron.edit.au.ident_value2.suggest', 'GUI: Suggest ident_value2 field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.au.ident_value2.suggest', 'The ident_value2 field will be suggested on the patron registration screen. Suggesting a field makes it appear when suggested fields are shown. If the field is shown or required this setting is ignored.', 'coust', 'description'),
+    'bool'),
+( 'ui.patron.edit.au.juvenile.show',
+    oils_i18n_gettext('ui.patron.edit.au.juvenile.show', 'GUI: Show juvenile field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.au.juvenile.show', 'The juvenile field will be shown on the patron registration screen. Showing a field makes it appear with required fields even when not required. If the field is required this setting is ignored.', 'coust', 'description'),
+    'bool'),
+( 'ui.patron.edit.au.juvenile.suggest',
+    oils_i18n_gettext('ui.patron.edit.au.juvenile.suggest', 'GUI: Suggest juvenile field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.au.juvenile.suggest', 'The juvenile field will be suggested on the patron registration screen. Suggesting a field makes it appear when suggested fields are shown. If the field is shown or required this setting is ignored.', 'coust', 'description'),
+    'bool'),
+( 'ui.patron.edit.au.master_account.show',
+    oils_i18n_gettext('ui.patron.edit.au.master_account.show', 'GUI: Show master_account field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.au.master_account.show', 'The master_account field will be shown on the patron registration screen. Showing a field makes it appear with required fields even when not required. If the field is required this setting is ignored.', 'coust', 'description'),
+    'bool'),
+( 'ui.patron.edit.au.master_account.suggest',
+    oils_i18n_gettext('ui.patron.edit.au.master_account.suggest', 'GUI: Suggest master_account field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.au.master_account.suggest', 'The master_account field will be suggested on the patron registration screen. Suggesting a field makes it appear when suggested fields are shown. If the field is shown or required this setting is ignored.', 'coust', 'description'),
+    'bool'),
+( 'ui.patron.edit.au.other_phone.example',
+    oils_i18n_gettext('ui.patron.edit.au.other_phone.example', 'GUI: Example for other_phone field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.au.other_phone.example', 'The Example for validation on the other_phone field in patron registration.', 'coust', 'description'),
+    'string'),
+( 'ui.patron.edit.au.other_phone.regex',
+    oils_i18n_gettext('ui.patron.edit.au.other_phone.regex', 'GUI: Regex for other_phone field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.au.other_phone.regex', 'The Regular Expression for validation on the other_phone field in patron registration.', 'coust', 'description'),
+    'string'),
+( 'ui.patron.edit.au.other_phone.require',
+    oils_i18n_gettext('ui.patron.edit.au.other_phone.require', 'GUI: Require other_phone field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.au.other_phone.require', 'The other_phone field will be required on the patron registration screen.', 'coust', 'description'),
+    'bool'),
+( 'ui.patron.edit.au.other_phone.show',
+    oils_i18n_gettext('ui.patron.edit.au.other_phone.show', 'GUI: Show other_phone field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.au.other_phone.show', 'The other_phone field will be shown on the patron registration screen. Showing a field makes it appear with required fields even when not required. If the field is required this setting is ignored.', 'coust', 'description'),
+    'bool'),
+( 'ui.patron.edit.au.other_phone.suggest',
+    oils_i18n_gettext('ui.patron.edit.au.other_phone.suggest', 'GUI: Suggest other_phone field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.au.other_phone.suggest', 'The other_phone field will be suggested on the patron registration screen. Suggesting a field makes it appear when suggested fields are shown. If the field is shown or required this setting is ignored.', 'coust', 'description'),
+    'bool'),
+( 'ui.patron.edit.au.second_given_name.show',
+    oils_i18n_gettext('ui.patron.edit.au.second_given_name.show', 'GUI: Show second_given_name field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.au.second_given_name.show', 'The second_given_name field will be shown on the patron registration screen. Showing a field makes it appear with required fields even when not required. If the field is required this setting is ignored.', 'coust', 'description'),
+    'bool'),
+( 'ui.patron.edit.au.second_given_name.suggest',
+    oils_i18n_gettext('ui.patron.edit.au.second_given_name.suggest', 'GUI: Suggest second_given_name field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.au.second_given_name.suggest', 'The second_given_name field will be suggested on the patron registration screen. Suggesting a field makes it appear when suggested fields are shown. If the field is shown or required this setting is ignored.', 'coust', 'description'),
+    'bool'),
+( 'ui.patron.edit.au.suffix.show',
+    oils_i18n_gettext('ui.patron.edit.au.suffix.show', 'GUI: Show suffix field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.au.suffix.show', 'The suffix field will be shown on the patron registration screen. Showing a field makes it appear with required fields even when not required. If the field is required this setting is ignored.', 'coust', 'description'),
+    'bool'),
+( 'ui.patron.edit.au.suffix.suggest',
+    oils_i18n_gettext('ui.patron.edit.au.suffix.suggest', 'GUI: Suggest suffix field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.au.suffix.suggest', 'The suffix field will be suggested on the patron registration screen. Suggesting a field makes it appear when suggested fields are shown. If the field is shown or required this setting is ignored.', 'coust', 'description'),
+    'bool'),
+( 'ui.patron.edit.aua.county.require',
+    oils_i18n_gettext('ui.patron.edit.aua.county.require', 'GUI: Require county field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.aua.county.require', 'The county field will be required on the patron registration screen.', 'coust', 'description'),
+    'bool'),
+( 'ui.patron.edit.aua.post_code.example',
+    oils_i18n_gettext('ui.patron.edit.aua.post_code.example', 'GUI: Example for post_code field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.aua.post_code.example', 'The Example for validation on the post_code field in patron registration.', 'coust', 'description'),
+    'string'),
+( 'ui.patron.edit.aua.post_code.regex',
+    oils_i18n_gettext('ui.patron.edit.aua.post_code.regex', 'GUI: Regex for post_code field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.aua.post_code.regex', 'The Regular Expression for validation on the post_code field in patron registration.', 'coust', 'description'),
+    'string'),
+( 'ui.patron.edit.default_suggested',
+    oils_i18n_gettext('ui.patron.edit.default_suggested', 'GUI: Default showing suggested patron registration fields', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.default_suggested', 'Instead of All fields, show just suggested fields in patron registration by default.', 'coust', 'description'),
+    'bool'),
+( 'ui.patron.edit.phone.example',
+    oils_i18n_gettext('ui.patron.edit.phone.example', 'GUI: Example for phone fields on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.phone.example', 'The Example for validation on phone fields in patron registration. Applies to all phone fields without their own setting.', 'coust', 'description'),
+    'string'),
+( 'ui.patron.edit.phone.regex',
+    oils_i18n_gettext('ui.patron.edit.phone.regex', 'GUI: Regex for phone fields on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.phone.regex', 'The Regular Expression for validation on phone fields in patron registration. Applies to all phone fields without their own setting.', 'coust', 'description'),
+    'string');
+
 -- *** Has to go below coust definition to satisfy referential integrity ***
 -- In booking, elbow room defines:
 --  a) how far in the future you must make a reservation on a given item if
diff --git a/Open-ILS/src/sql/Pg/upgrade/0497.patron_registration.sql b/Open-ILS/src/sql/Pg/upgrade/0497.patron_registration.sql
new file mode 100644 (file)
index 0000000..d5e6182
--- /dev/null
@@ -0,0 +1,225 @@
+BEGIN;
+
+INSERT INTO config.upgrade_log (version) VALUES ('0497');
+
+INSERT into config.org_unit_setting_type
+( name, label, description, datatype ) VALUES
+
+( 'ui.patron.edit.au.active.show',
+    oils_i18n_gettext('ui.patron.edit.au.active.show', 'GUI: Show active field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.au.active.show', 'The active field will be shown on the patron registration screen. Showing a field makes it appear with required fields even when not required. If the field is required this setting is ignored.', 'coust', 'description'),
+    'bool'),
+( 'ui.patron.edit.au.active.suggest',
+    oils_i18n_gettext('ui.patron.edit.au.active.suggest', 'GUI: Suggest active field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.au.active.suggest', 'The active field will be suggested on the patron registration screen. Suggesting a field makes it appear when suggested fields are shown. If the field is shown or required this setting is ignored.', 'coust', 'description'),
+    'bool'),
+( 'ui.patron.edit.au.alert_message.show',
+    oils_i18n_gettext('ui.patron.edit.au.alert_message.show', 'GUI: Show alert_message field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.au.alert_message.show', 'The alert_message field will be shown on the patron registration screen. Showing a field makes it appear with required fields even when not required. If the field is required this setting is ignored.', 'coust', 'description'),
+    'bool'),
+( 'ui.patron.edit.au.alert_message.suggest',
+    oils_i18n_gettext('ui.patron.edit.au.alert_message.suggest', 'GUI: Suggest alert_message field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.au.alert_message.suggest', 'The alert_message field will be suggested on the patron registration screen. Suggesting a field makes it appear when suggested fields are shown. If the field is shown or required this setting is ignored.', 'coust', 'description'),
+    'bool'),
+( 'ui.patron.edit.au.alias.show',
+    oils_i18n_gettext('ui.patron.edit.au.alias.show', 'GUI: Show alias field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.au.alias.show', 'The alias field will be shown on the patron registration screen. Showing a field makes it appear with required fields even when not required. If the field is required this setting is ignored.', 'coust', 'description'),
+    'bool'),
+( 'ui.patron.edit.au.alias.suggest',
+    oils_i18n_gettext('ui.patron.edit.au.alias.suggest', 'GUI: Suggest alias field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.au.alias.suggest', 'The alias field will be suggested on the patron registration screen. Suggesting a field makes it appear when suggested fields are shown. If the field is shown or required this setting is ignored.', 'coust', 'description'),
+    'bool'),
+( 'ui.patron.edit.au.barred.show',
+    oils_i18n_gettext('ui.patron.edit.au.barred.show', 'GUI: Show barred field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.au.barred.show', 'The barred field will be shown on the patron registration screen. Showing a field makes it appear with required fields even when not required. If the field is required this setting is ignored.', 'coust', 'description'),
+    'bool'),
+( 'ui.patron.edit.au.barred.suggest',
+    oils_i18n_gettext('ui.patron.edit.au.barred.suggest', 'GUI: Suggest barred field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.au.barred.suggest', 'The barred field will be suggested on the patron registration screen. Suggesting a field makes it appear when suggested fields are shown. If the field is shown or required this setting is ignored.', 'coust', 'description'),
+    'bool'),
+( 'ui.patron.edit.au.claims_never_checked_out_count.show',
+    oils_i18n_gettext('ui.patron.edit.au.claims_never_checked_out_count.show', 'GUI: Show claims_never_checked_out_count field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.au.claims_never_checked_out_count.show', 'The claims_never_checked_out_count field will be shown on the patron registration screen. Showing a field makes it appear with required fields even when not required. If the field is required this setting is ignored.', 'coust', 'description'),
+    'bool'),
+( 'ui.patron.edit.au.claims_never_checked_out_count.suggest',
+    oils_i18n_gettext('ui.patron.edit.au.claims_never_checked_out_count.suggest', 'GUI: Suggest claims_never_checked_out_count field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.au.claims_never_checked_out_count.suggest', 'The claims_never_checked_out_count field will be suggested on the patron registration screen. Suggesting a field makes it appear when suggested fields are shown. If the field is shown or required this setting is ignored.', 'coust', 'description'),
+    'bool'),
+( 'ui.patron.edit.au.claims_returned_count.show',
+    oils_i18n_gettext('ui.patron.edit.au.claims_returned_count.show', 'GUI: Show claims_returned_count field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.au.claims_returned_count.show', 'The claims_returned_count field will be shown on the patron registration screen. Showing a field makes it appear with required fields even when not required. If the field is required this setting is ignored.', 'coust', 'description'),
+    'bool'),
+( 'ui.patron.edit.au.claims_returned_count.suggest',
+    oils_i18n_gettext('ui.patron.edit.au.claims_returned_count.suggest', 'GUI: Suggest claims_returned_count field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.au.claims_returned_count.suggest', 'The claims_returned_count field will be suggested on the patron registration screen. Suggesting a field makes it appear when suggested fields are shown. If the field is shown or required this setting is ignored.', 'coust', 'description'),
+    'bool'),
+( 'ui.patron.edit.au.day_phone.example',
+    oils_i18n_gettext('ui.patron.edit.au.day_phone.example', 'GUI: Example for day_phone field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.au.day_phone.example', 'The Example for validation on the day_phone field in patron registration.', 'coust', 'description'),
+    'string'),
+( 'ui.patron.edit.au.day_phone.regex',
+    oils_i18n_gettext('ui.patron.edit.au.day_phone.regex', 'GUI: Regex for day_phone field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.au.day_phone.regex', 'The Regular Expression for validation on the day_phone field in patron registration.', 'coust', 'description'),
+    'string'),
+( 'ui.patron.edit.au.day_phone.require',
+    oils_i18n_gettext('ui.patron.edit.au.day_phone.require', 'GUI: Require day_phone field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.au.day_phone.require', 'The day_phone field will be required on the patron registration screen.', 'coust', 'description'),
+    'bool'),
+( 'ui.patron.edit.au.day_phone.show',
+    oils_i18n_gettext('ui.patron.edit.au.day_phone.show', 'GUI: Show day_phone field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.au.day_phone.show', 'The day_phone field will be shown on the patron registration screen. Showing a field makes it appear with required fields even when not required. If the field is required this setting is ignored.', 'coust', 'description'),
+    'bool'),
+( 'ui.patron.edit.au.day_phone.suggest',
+    oils_i18n_gettext('ui.patron.edit.au.day_phone.suggest', 'GUI: Suggest day_phone field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.au.day_phone.suggest', 'The day_phone field will be suggested on the patron registration screen. Suggesting a field makes it appear when suggested fields are shown. If the field is shown or required this setting is ignored.', 'coust', 'description'),
+    'bool'),
+( 'ui.patron.edit.au.dob.calendar',
+    oils_i18n_gettext('ui.patron.edit.au.dob.calendar', 'GUI: Show calendar widget for dob field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.au.dob.calendar', 'If set the calendar widget will appear when editing the dob field on the patron registration form.', 'coust', 'description'),
+    'bool'),
+( 'ui.patron.edit.au.dob.require',
+    oils_i18n_gettext('ui.patron.edit.au.dob.require', 'GUI: Require dob field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.au.dob.require', 'The dob field will be required on the patron registration screen.', 'coust', 'description'),
+    'bool'),
+( 'ui.patron.edit.au.dob.show',
+    oils_i18n_gettext('ui.patron.edit.au.dob.show', 'GUI: Show dob field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.au.dob.show', 'The dob field will be shown on the patron registration screen. Showing a field makes it appear with required fields even when not required. If the field is required this setting is ignored.', 'coust', 'description'),
+    'bool'),
+( 'ui.patron.edit.au.dob.suggest',
+    oils_i18n_gettext('ui.patron.edit.au.dob.suggest', 'GUI: Suggest dob field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.au.dob.suggest', 'The dob field will be suggested on the patron registration screen. Suggesting a field makes it appear when suggested fields are shown. If the field is shown or required this setting is ignored.', 'coust', 'description'),
+    'bool'),
+( 'ui.patron.edit.au.email.example',
+    oils_i18n_gettext('ui.patron.edit.au.email.example', 'GUI: Example for email field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.au.email.example', 'The Example for validation on the email field in patron registration.', 'coust', 'description'),
+    'string'),
+( 'ui.patron.edit.au.email.regex',
+    oils_i18n_gettext('ui.patron.edit.au.email.regex', 'GUI: Regex for email field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.au.email.regex', 'The Regular Expression for validation on the email field in patron registration.', 'coust', 'description'),
+    'string'),
+( 'ui.patron.edit.au.email.require',
+    oils_i18n_gettext('ui.patron.edit.au.email.require', 'GUI: Require email field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.au.email.require', 'The email field will be required on the patron registration screen.', 'coust', 'description'),
+    'bool'),
+( 'ui.patron.edit.au.email.show',
+    oils_i18n_gettext('ui.patron.edit.au.email.show', 'GUI: Show email field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.au.email.show', 'The email field will be shown on the patron registration screen. Showing a field makes it appear with required fields even when not required. If the field is required this setting is ignored.', 'coust', 'description'),
+    'bool'),
+( 'ui.patron.edit.au.email.suggest',
+    oils_i18n_gettext('ui.patron.edit.au.email.suggest', 'GUI: Suggest email field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.au.email.suggest', 'The email field will be suggested on the patron registration screen. Suggesting a field makes it appear when suggested fields are shown. If the field is shown or required this setting is ignored.', 'coust', 'description'),
+    'bool'),
+( 'ui.patron.edit.au.evening_phone.example',
+    oils_i18n_gettext('ui.patron.edit.au.evening_phone.example', 'GUI: Example for evening_phone field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.au.evening_phone.example', 'The Example for validation on the evening_phone field in patron registration.', 'coust', 'description'),
+    'string'),
+( 'ui.patron.edit.au.evening_phone.regex',
+    oils_i18n_gettext('ui.patron.edit.au.evening_phone.regex', 'GUI: Regex for evening_phone field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.au.evening_phone.regex', 'The Regular Expression for validation on the evening_phone field in patron registration.', 'coust', 'description'),
+    'string'),
+( 'ui.patron.edit.au.evening_phone.require',
+    oils_i18n_gettext('ui.patron.edit.au.evening_phone.require', 'GUI: Require evening_phone field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.au.evening_phone.require', 'The evening_phone field will be required on the patron registration screen.', 'coust', 'description'),
+    'bool'),
+( 'ui.patron.edit.au.evening_phone.show',
+    oils_i18n_gettext('ui.patron.edit.au.evening_phone.show', 'GUI: Show evening_phone field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.au.evening_phone.show', 'The evening_phone field will be shown on the patron registration screen. Showing a field makes it appear with required fields even when not required. If the field is required this setting is ignored.', 'coust', 'description'),
+    'bool'),
+( 'ui.patron.edit.au.evening_phone.suggest',
+    oils_i18n_gettext('ui.patron.edit.au.evening_phone.suggest', 'GUI: Suggest evening_phone field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.au.evening_phone.suggest', 'The evening_phone field will be suggested on the patron registration screen. Suggesting a field makes it appear when suggested fields are shown. If the field is shown or required this setting is ignored.', 'coust', 'description'),
+    'bool'),
+( 'ui.patron.edit.au.ident_value.show',
+    oils_i18n_gettext('ui.patron.edit.au.ident_value.show', 'GUI: Show ident_value field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.au.ident_value.show', 'The ident_value field will be shown on the patron registration screen. Showing a field makes it appear with required fields even when not required. If the field is required this setting is ignored.', 'coust', 'description'),
+    'bool'),
+( 'ui.patron.edit.au.ident_value.suggest',
+    oils_i18n_gettext('ui.patron.edit.au.ident_value.suggest', 'GUI: Suggest ident_value field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.au.ident_value.suggest', 'The ident_value field will be suggested on the patron registration screen. Suggesting a field makes it appear when suggested fields are shown. If the field is shown or required this setting is ignored.', 'coust', 'description'),
+    'bool'),
+( 'ui.patron.edit.au.ident_value2.show',
+    oils_i18n_gettext('ui.patron.edit.au.ident_value2.show', 'GUI: Show ident_value2 field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.au.ident_value2.show', 'The ident_value2 field will be shown on the patron registration screen. Showing a field makes it appear with required fields even when not required. If the field is required this setting is ignored.', 'coust', 'description'),
+    'bool'),
+( 'ui.patron.edit.au.ident_value2.suggest',
+    oils_i18n_gettext('ui.patron.edit.au.ident_value2.suggest', 'GUI: Suggest ident_value2 field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.au.ident_value2.suggest', 'The ident_value2 field will be suggested on the patron registration screen. Suggesting a field makes it appear when suggested fields are shown. If the field is shown or required this setting is ignored.', 'coust', 'description'),
+    'bool'),
+( 'ui.patron.edit.au.juvenile.show',
+    oils_i18n_gettext('ui.patron.edit.au.juvenile.show', 'GUI: Show juvenile field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.au.juvenile.show', 'The juvenile field will be shown on the patron registration screen. Showing a field makes it appear with required fields even when not required. If the field is required this setting is ignored.', 'coust', 'description'),
+    'bool'),
+( 'ui.patron.edit.au.juvenile.suggest',
+    oils_i18n_gettext('ui.patron.edit.au.juvenile.suggest', 'GUI: Suggest juvenile field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.au.juvenile.suggest', 'The juvenile field will be suggested on the patron registration screen. Suggesting a field makes it appear when suggested fields are shown. If the field is shown or required this setting is ignored.', 'coust', 'description'),
+    'bool'),
+( 'ui.patron.edit.au.master_account.show',
+    oils_i18n_gettext('ui.patron.edit.au.master_account.show', 'GUI: Show master_account field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.au.master_account.show', 'The master_account field will be shown on the patron registration screen. Showing a field makes it appear with required fields even when not required. If the field is required this setting is ignored.', 'coust', 'description'),
+    'bool'),
+( 'ui.patron.edit.au.master_account.suggest',
+    oils_i18n_gettext('ui.patron.edit.au.master_account.suggest', 'GUI: Suggest master_account field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.au.master_account.suggest', 'The master_account field will be suggested on the patron registration screen. Suggesting a field makes it appear when suggested fields are shown. If the field is shown or required this setting is ignored.', 'coust', 'description'),
+    'bool'),
+( 'ui.patron.edit.au.other_phone.example',
+    oils_i18n_gettext('ui.patron.edit.au.other_phone.example', 'GUI: Example for other_phone field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.au.other_phone.example', 'The Example for validation on the other_phone field in patron registration.', 'coust', 'description'),
+    'string'),
+( 'ui.patron.edit.au.other_phone.regex',
+    oils_i18n_gettext('ui.patron.edit.au.other_phone.regex', 'GUI: Regex for other_phone field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.au.other_phone.regex', 'The Regular Expression for validation on the other_phone field in patron registration.', 'coust', 'description'),
+    'string'),
+( 'ui.patron.edit.au.other_phone.require',
+    oils_i18n_gettext('ui.patron.edit.au.other_phone.require', 'GUI: Require other_phone field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.au.other_phone.require', 'The other_phone field will be required on the patron registration screen.', 'coust', 'description'),
+    'bool'),
+( 'ui.patron.edit.au.other_phone.show',
+    oils_i18n_gettext('ui.patron.edit.au.other_phone.show', 'GUI: Show other_phone field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.au.other_phone.show', 'The other_phone field will be shown on the patron registration screen. Showing a field makes it appear with required fields even when not required. If the field is required this setting is ignored.', 'coust', 'description'),
+    'bool'),
+( 'ui.patron.edit.au.other_phone.suggest',
+    oils_i18n_gettext('ui.patron.edit.au.other_phone.suggest', 'GUI: Suggest other_phone field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.au.other_phone.suggest', 'The other_phone field will be suggested on the patron registration screen. Suggesting a field makes it appear when suggested fields are shown. If the field is shown or required this setting is ignored.', 'coust', 'description'),
+    'bool'),
+( 'ui.patron.edit.au.second_given_name.show',
+    oils_i18n_gettext('ui.patron.edit.au.second_given_name.show', 'GUI: Show second_given_name field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.au.second_given_name.show', 'The second_given_name field will be shown on the patron registration screen. Showing a field makes it appear with required fields even when not required. If the field is required this setting is ignored.', 'coust', 'description'),
+    'bool'),
+( 'ui.patron.edit.au.second_given_name.suggest',
+    oils_i18n_gettext('ui.patron.edit.au.second_given_name.suggest', 'GUI: Suggest second_given_name field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.au.second_given_name.suggest', 'The second_given_name field will be suggested on the patron registration screen. Suggesting a field makes it appear when suggested fields are shown. If the field is shown or required this setting is ignored.', 'coust', 'description'),
+    'bool'),
+( 'ui.patron.edit.au.suffix.show',
+    oils_i18n_gettext('ui.patron.edit.au.suffix.show', 'GUI: Show suffix field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.au.suffix.show', 'The suffix field will be shown on the patron registration screen. Showing a field makes it appear with required fields even when not required. If the field is required this setting is ignored.', 'coust', 'description'),
+    'bool'),
+( 'ui.patron.edit.au.suffix.suggest',
+    oils_i18n_gettext('ui.patron.edit.au.suffix.suggest', 'GUI: Suggest suffix field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.au.suffix.suggest', 'The suffix field will be suggested on the patron registration screen. Suggesting a field makes it appear when suggested fields are shown. If the field is shown or required this setting is ignored.', 'coust', 'description'),
+    'bool'),
+( 'ui.patron.edit.aua.county.require',
+    oils_i18n_gettext('ui.patron.edit.aua.county.require', 'GUI: Require county field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.aua.county.require', 'The county field will be required on the patron registration screen.', 'coust', 'description'),
+    'bool'),
+( 'ui.patron.edit.aua.post_code.example',
+    oils_i18n_gettext('ui.patron.edit.aua.post_code.example', 'GUI: Example for post_code field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.aua.post_code.example', 'The Example for validation on the post_code field in patron registration.', 'coust', 'description'),
+    'string'),
+( 'ui.patron.edit.aua.post_code.regex',
+    oils_i18n_gettext('ui.patron.edit.aua.post_code.regex', 'GUI: Regex for post_code field on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.aua.post_code.regex', 'The Regular Expression for validation on the post_code field in patron registration.', 'coust', 'description'),
+    'string'),
+( 'ui.patron.edit.default_suggested',
+    oils_i18n_gettext('ui.patron.edit.default_suggested', 'GUI: Default showing suggested patron registration fields', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.default_suggested', 'Instead of All fields, show just suggested fields in patron registration by default.', 'coust', 'description'),
+    'bool'),
+( 'ui.patron.edit.phone.example',
+    oils_i18n_gettext('ui.patron.edit.phone.example', 'GUI: Example for phone fields on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.phone.example', 'The Example for validation on phone fields in patron registration. Applies to all phone fields without their own setting.', 'coust', 'description'),
+    'string'),
+( 'ui.patron.edit.phone.regex',
+    oils_i18n_gettext('ui.patron.edit.phone.regex', 'GUI: Regex for phone fields on patron registration', 'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.phone.regex', 'The Regular Expression for validation on phone fields in patron registration. Applies to all phone fields without their own setting.', 'coust', 'description'),
+    'string');
+
+COMMIT;
index 2aa2e14..2868ef4 100644 (file)
 
 .dijitTextBoxFocused, .dijitFocused { border:1px dashed #3e3e3e; color: #303030; font-weight:bold;}
 
-.hide-non-required tr:not([required]) {
+.hide-non-required tr:not([required]), .hide-non-required tr[required=suggested] {
+    visibility:hidden;
+    display:none;
+}
+
+.hide-non-suggested tr:not([required]) {
     visibility:hidden;
     display:none;
 }
index 5cdc023..ab1150a 100644 (file)
@@ -8,5 +8,6 @@
     "DUPE_PATRON_PHONE" : "Found ${0} patron(s) with the same phone number",
     "DUPE_PATRON_ADDR" : "Found ${0} patron(s) with the same address",
     "REPLACED_ADDRESS" : "<div>Replaces address <b>${0}</b><br/> ${1} ${2}<br/> ${3}, ${4} ${5}</div>",
-    "INVALID_FORM" : "Form is invalid.  Please edit and try again."
+    "INVALID_FORM" : "Form is invalid.  Please edit and try again.",
+    "EXAMPLE" : "Example: "
 }
index 1db121a..3fa7735 100644 (file)
@@ -271,6 +271,16 @@ if(!dojo._hasResource['openils.widget.AutoFieldWidget']) {
                     case 'timestamp':
                         dojo.require('dijit.form.DateTextBox');
                         dojo.require('dojo.date.stamp');
+                        if(!this.dijitArgs.constraints) {
+                            this.dijitArgs.constraints = {};
+                        }
+                        if(!this.dijitArgs.constraints.datePattern) {
+                            var user = new openils.User().user;
+                            if(user.ws_ou()) {
+                                var datePattern = fieldmapper.aou.fetchOrgSettingDefault(user.ws_ou(), 'format.date');
+                                if(datePattern) this.dijitArgs.constraints.datePattern = datePattern.value;
+                            }
+                        }
                         this.widget = new dijit.form.DateTextBox(this.dijitArgs, this.parentNode);
                         if (this.widgetValue != null) {
                             this.widgetValue = openils.Util.timeStampAsDateObj(
index c3070c9..4025f5c 100644 (file)
@@ -87,7 +87,62 @@ function load() {
         'ui.patron.default_country',
         'ui.patron.registration.require_address',
         'circ.holds.behind_desk_pickup_supported',
-        'circ.patron_edit.clone.copy_address'
+        'circ.patron_edit.clone.copy_address',
+        'ui.patron.edit.au.second_given_name.show',
+        'ui.patron.edit.au.second_given_name.suggest',
+        'ui.patron.edit.au.suffix.show',
+        'ui.patron.edit.au.suffix.suggest',
+        'ui.patron.edit.au.alias.show',
+        'ui.patron.edit.au.alias.suggest',
+        'ui.patron.edit.au.dob.require',
+        'ui.patron.edit.au.dob.show',
+        'ui.patron.edit.au.dob.suggest',
+        'ui.patron.edit.au.dob.calendar',
+        'ui.patron.edit.au.juvenile.show',
+        'ui.patron.edit.au.juvenile.suggest',
+        'ui.patron.edit.au.ident_value.show',
+        'ui.patron.edit.au.ident_value.suggest',
+        'ui.patron.edit.au.ident_value2.show',
+        'ui.patron.edit.au.ident_value2.suggest',
+        'ui.patron.edit.au.email.require',
+        'ui.patron.edit.au.email.show',
+        'ui.patron.edit.au.email.suggest',
+        'ui.patron.edit.au.email.regex',
+        'ui.patron.edit.au.email.example',
+        'ui.patron.edit.au.day_phone.require',
+        'ui.patron.edit.au.day_phone.show',
+        'ui.patron.edit.au.day_phone.suggest',
+        'ui.patron.edit.au.day_phone.regex',
+        'ui.patron.edit.au.day_phone.example',
+        'ui.patron.edit.au.evening_phone.require',
+        'ui.patron.edit.au.evening_phone.show',
+        'ui.patron.edit.au.evening_phone.suggest',
+        'ui.patron.edit.au.evening_phone.regex',
+        'ui.patron.edit.au.evening_phone.example',
+        'ui.patron.edit.au.other_phone.require',
+        'ui.patron.edit.au.other_phone.show',
+        'ui.patron.edit.au.other_phone.suggest',
+        'ui.patron.edit.au.other_phone.regex',
+        'ui.patron.edit.au.other_phone.example',
+        'ui.patron.edit.phone.regex',
+        'ui.patron.edit.phone.example',
+        'ui.patron.edit.au.active.show',
+        'ui.patron.edit.au.active.suggest',
+        'ui.patron.edit.au.barred.show',
+        'ui.patron.edit.au.barred.suggest',
+        'ui.patron.edit.au.master_account.show',
+        'ui.patron.edit.au.master_account.suggest',
+        'ui.patron.edit.au.claims_returned_count.show',
+        'ui.patron.edit.au.claims_returned_count.suggest',
+        'ui.patron.edit.au.claims_never_checked_out_count.show',
+        'ui.patron.edit.au.claims_never_checked_out_count.suggest',
+        'ui.patron.edit.au.alert_message.show',
+        'ui.patron.edit.au.alert_message.suggest',
+        'ui.patron.edit.aua.post_code.regex',
+        'ui.patron.edit.aua.post_code.example',
+        'ui.patron.edit.aua.county.require',
+        'format.date',
+        'ui.patron.edit.default_suggested'
     ]);
 
     for(k in orgSettings)
@@ -121,6 +176,9 @@ function load() {
 
     tbody = dojo.byId('uedit-tbody');
 
+    if(orgSettings['ui.patron.edit.default_suggested'])
+        uEditToggleRequired(2);
+
     addrTemplateRows = dojo.query('tr[type=addr-template]', tbody);
     dojo.forEach(addrTemplateRows, function(row) { row.parentNode.removeChild(row); } );
     statCatTemplate = tbody.removeChild(dojo.byId('stat-cat-row-template'));
@@ -591,6 +649,7 @@ function fleshFMRow(row, fmcls, args) {
     var wconstraints = row.getAttribute('wconstraints');
     /* use CSS to set the zindex for widgets you want to disable. */
     var disabled = dojo.style(row, 'zIndex') == -1 ? true : false;
+    var isphone = (fmcls == 'au') && (fmfield.search('_phone') != -1);
 
     var isPasswd2 = (fmfield == 'passwd2');
     if(isPasswd2) fmfield = 'passwd';
@@ -601,6 +660,7 @@ function fleshFMRow(row, fmcls, args) {
     var htd = existing[0] || row.appendChild(document.createElement('td'));
     var ltd = existing[1] || row.appendChild(document.createElement('td'));
     var wtd = existing[2] || row.appendChild(document.createElement('td'));
+    var ftd = existing[3] || row.appendChild(document.createElement('td'));
 
     openils.Util.addCSSClass(htd, 'uedit-help');
     if(fieldDoc[fmcls] && fieldDoc[fmcls][fmfield]) {
@@ -612,11 +672,22 @@ function fleshFMRow(row, fmcls, args) {
     }
 
     if(!ltd.textContent) {
-        var span = document.createElement('span');
         ltd.appendChild(document.createTextNode(fieldIdl.label));
     }
 
-    span = document.createElement('span');
+    if(!ftd.textContent) {
+        if(orgSettings['ui.patron.edit.' + fmcls + '.' + fmfield + '.example']) {
+            ftd.appendChild(document.createTextNode(localeStrings.EXAMPLE + orgSettings['ui.patron.edit.' + fmcls + '.' + fmfield + '.example']));
+        }
+        else if(isphone && orgSettings['ui.patron.edit.phone.example']) {
+            ftd.appendChild(document.createTextNode(localeStrings.EXAMPLE + orgSettings['ui.patron.edit.phone.example']));
+        }
+        else if(fieldIdl.datatype == 'timestamp') {
+            ftd.appendChild(document.createTextNode(localeStrings.EXAMPLE + dojo.date.locale.format(new Date(1970,0,31),{selector: "date", fullYear: true, datePattern: (orgSettings['format.date'] ? orgSettings['format.date'] : null)})));
+        }
+    }
+
+    var span = document.createElement('span');
     wtd.appendChild(span);
 
     var fmObject = null;
@@ -631,7 +702,19 @@ function fleshFMRow(row, fmcls, args) {
             break;
     }
 
-    var required = row.getAttribute('required') == 'required';
+    // Adjust required value by org settings
+    var curRequired = row.getAttribute('required');
+    var required = curRequired == 'required';
+    if(orgSettings['ui.patron.edit.' + fmcls + '.' + fmfield + '.require']) {
+        row.setAttribute('required', 'required');
+        required = true;
+    }
+    else if (curRequired != 'required' && orgSettings['ui.patron.edit.' + fmcls + '.' + fmfield + '.show']) {
+        row.setAttribute('required', 'show');
+    }
+    else if (curRequired != 'required' && curRequired != 'show' && orgSettings['ui.patron.edit.' + fmcls + '.' + fmfield + '.suggest']) {
+        row.setAttribute('required', 'suggested');
+    }
 
     // password data is not fetched/required/displayed for existing users
     if(!patron.isnew() && 'passwd' == fmfield)
@@ -644,14 +727,21 @@ function fleshFMRow(row, fmcls, args) {
         disabled : disabled
     };
 
+    // Org settings provided regex?
+    if(orgSettings['ui.patron.edit.' + fmcls + '.' + fmfield + '.regex']) {
+        dijitArgs.regExp = orgSettings['ui.patron.edit.' + fmcls + '.' + fmfield + '.regex'];
+    }
+    else if(isphone && orgSettings['ui.patron.edit.phone.regex']) {
+        dijitArgs.regExp = orgSettings['ui.patron.edit.phone.regex'];
+    }
+
     if(fmcls == 'au' && fmfield == 'passwd') {
         if (orgSettings['global.password_regex']) {
             dijitArgs.regExp = orgSettings['global.password_regex'];
         }
     }
 
-    // TODO RSN: Add Setting!
-    if(fmcls == 'au' && fmfield == 'dob')
+    if(fmcls == 'au' && fmfield == 'dob' && !orgSettings['ui.patron.edit.au.dob.calendar'])
         dijitArgs.popupClass = "";
 
     var value = row.getAttribute('wvalue');
@@ -913,7 +1003,7 @@ function attachWidgetEvents(fmcls, fmfield, widget) {
                 return;
 
             case 'day_phone':
-                // if configured, use the last for digits of the day phone number as the password
+                // if configured, use the last four digits of the day phone number as the password
                 if(uEditUsePhonePw && patron.isnew()) {
                     dojo.connect(widget.widget, 'onChange',
                         function(newVal) {
@@ -1498,13 +1588,29 @@ function uEditDeleteAddr(id, noAlert) {
     widgetPile = widgetPile.filter(function(w){return (w._addr != id)});
 }
 
-function uEditToggleRequired() {
-    if((tbody.className +'').match(/hide-non-required/)) 
-        openils.Util.removeCSSClass(tbody, 'hide-non-required');
-    else
-        openils.Util.addCSSClass(tbody, 'hide-non-required');
-    openils.Util.toggle('uedit-show-required');
-    openils.Util.toggle('uedit-show-all');
+function uEditToggleRequired(level) {
+    openils.Util.removeCSSClass(tbody, 'hide-non-required');
+    openils.Util.removeCSSClass(tbody, 'hide-non-suggested');
+    openils.Util.show('uedit-show-required');
+    openils.Util.show('uedit-show-required-br');
+    openils.Util.show('uedit-show-suggested');
+    openils.Util.show('uedit-show-suggested-br');
+    openils.Util.show('uedit-show-all');
+    switch(level) {
+        case 1:
+            openils.Util.hide('uedit-show-required');
+            openils.Util.hide('uedit-show-required-br');
+            openils.Util.addCSSClass(tbody, 'hide-non-required');
+            break;
+        case 2:
+            openils.Util.hide('uedit-show-suggested');
+            openils.Util.hide('uedit-show-suggested-br');
+            openils.Util.addCSSClass(tbody, 'hide-non-suggested');
+            break;
+        default:
+            openils.Util.hide('uedit-show-all');
+            break;
+    } 
 }
 
 function printable_output() {
index b843e8c..aa1dad5 100644 (file)
@@ -18,8 +18,9 @@
     <button dojoType='dijit.form.Button' jsId='saveButton' onClick='uEditSave' scrollOnFocus='false'>Save</button>
     <button dojoType='dijit.form.Button' jsId='saveCloneButton' onClick='uEditSaveClone' scrollOnFocus='false'>Save &amp; Clone</button>
     <div id='require-toggle'>
-        <a href='javascript:uEditToggleRequired();' id='uedit-show-required'>Show Only Required Fields</a>
-        <a href='javascript:uEditToggleRequired();' id='uedit-show-all' class='hidden'>Show All Fields</a>
+        <a href='javascript:uEditToggleRequired(1);' id='uedit-show-required'>Show Only Required Fields</a><br id='uedit-show-required-br'/>
+        <a href='javascript:uEditToggleRequired(2);' id='uedit-show-suggested'>Show Suggested Fields</a><br id='uedit-show-suggested-br'/>
+        <a href='javascript:uEditToggleRequired(0);' id='uedit-show-all' class='hidden'>Show All Fields</a>
     </div>
 </div>
 
index 4e9fcbe..30eeb5c 100644 (file)
     </tr>
 
     <!-- stat cats -->
-    <tr class='divider' id='stat-cat-divider'><td colspan='0'>Statistical Categories</td></tr>
-    <tr id='stat-cat-row-template'><td class='uedit-help'/><td name='name'/><td name='widget'/></tr>
+    <tr class='divider' id='stat-cat-divider' required='suggested'><td colspan='0'>Statistical Categories</td></tr>
+    <tr id='stat-cat-row-template'><td class='uedit-help' required='suggested'/><td name='name'/><td name='widget'/></tr>
 
     <!-- surveys -->
-    <tr id='survey-row-template' class='divider'><td colspan='0' name='name'/></tr>
-    <tr id='survey-question-row-template'><td class='uedit-help'/><td name='question'/><td name='answers'/></tr>
+    <tr id='survey-row-template' class='divider' required='suggested'><td colspan='0' name='name'/></tr>
+    <tr id='survey-question-row-template'><td class='uedit-help' required='suggested'/><td name='question'/><td name='answers'/></tr>
 </tbody>