[open-ils-commits] [GIT] Evergreen ILS branch master updated. 7de40306a12f46c271441ce2ceac0708d4f56c4e

Evergreen Git git at git.evergreen-ils.org
Thu Sep 8 01:45:11 EDT 2011


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, master has been updated
       via  7de40306a12f46c271441ce2ceac0708d4f56c4e (commit)
       via  47fdb4c815166fa3630ed22bddd6a1dfa1cc8b70 (commit)
       via  e166e2a2db389ab376b3b2bf474e723205fc7b3d (commit)
       via  6cb15c141b5a6d8c4e1a4c4402ae6bcc75de16ce (commit)
       via  353e6ce078a37a2f5b8c3c581602bd9fa36ce0c7 (commit)
      from  6402ef9d74cb09a40dc964eca8511bd87723f919 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 7de40306a12f46c271441ce2ceac0708d4f56c4e
Author: Jason Etheridge <jason at esilibrary.com>
Date:   Thu Sep 8 01:44:38 2011 -0400

    tweak description for "Patron: password from phone #" setting
    
    Signed-off-by: Jason Etheridge <jason at esilibrary.com>

diff --git a/Open-ILS/src/sql/Pg/950.data.seed-values.sql b/Open-ILS/src/sql/Pg/950.data.seed-values.sql
index e63bb58..56dafa5 100644
--- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql
+++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql
@@ -2478,7 +2478,7 @@ INSERT into config.org_unit_setting_type
 
 ( 'patron.password.use_phone',
     oils_i18n_gettext('patron.password.use_phone', 'Patron: password from phone #', 'coust', 'label'),
-    oils_i18n_gettext('patron.password.use_phone', 'Use the last 4 digits of the patrons phone number as the default password when creating new users', 'coust', 'description'),
+    oils_i18n_gettext('patron.password.use_phone', 'By default, use the last 4 alphanumeric characters of the patrons phone number as the default password when creating new users.  The exact characters used may be configured via the "GUI: Regex for day_phone field on patron registration" setting.', 'coust', 'description'),
     'bool'),
 
 ( 'circ.charge_on_damaged',
diff --git a/Open-ILS/src/sql/Pg/upgrade/0618.data.org-setting-phone_pw.sql b/Open-ILS/src/sql/Pg/upgrade/0618.data.org-setting-phone_pw.sql
index 6351aa8..d3f74d2 100644
--- a/Open-ILS/src/sql/Pg/upgrade/0618.data.org-setting-phone_pw.sql
+++ b/Open-ILS/src/sql/Pg/upgrade/0618.data.org-setting-phone_pw.sql
@@ -6,4 +6,6 @@ UPDATE config.org_unit_setting_type SET description = E'The Regular Expression f
 
 UPDATE config.org_unit_setting_type SET description = 'The Regular Expression for validation on phone fields in patron registration. Applies to all phone fields without their own setting. NOTE: See description of the day_phone regex for important information about capture groups with it.' WHERE name = 'ui.patron.edit.phone.regex';
 
+UPDATE config.org_unit_setting_type SET description = oils_i18n_gettext('patron.password.use_phone', 'By default, use the last 4 alphanumeric characters of the patrons phone number as the default password when creating new users.  The exact characters used may be configured via the "GUI: Regex for day_phone field on patron registration" setting.', 'coust', 'description') WHERE name = 'patron.password.use_phone';
+
 COMMIT;

commit 47fdb4c815166fa3630ed22bddd6a1dfa1cc8b70
Author: Jason Etheridge <jason at esilibrary.com>
Date:   Thu Sep 8 01:26:34 2011 -0400

    lp#794153 stamping upgrade script for phone pw
    
    Signed-off-by: Jason Etheridge <jason at esilibrary.com>

diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql
index 94f82dd..bc00d9b 100644
--- a/Open-ILS/src/sql/Pg/002.schema.config.sql
+++ b/Open-ILS/src/sql/Pg/002.schema.config.sql
@@ -86,7 +86,7 @@ CREATE TRIGGER no_overlapping_deps
     BEFORE INSERT OR UPDATE ON config.db_patch_dependencies
     FOR EACH ROW EXECUTE PROCEDURE evergreen.array_overlap_check ('deprecates');
 
-INSERT INTO config.upgrade_log (version, applied_to) VALUES ('0617', :eg_version); -- miker/jeff-davis
+INSERT INTO config.upgrade_log (version, applied_to) VALUES ('0618', :eg_version); -- phasefx/tsbere
 
 CREATE TABLE config.bib_source (
 	id		SERIAL	PRIMARY KEY,
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.phone_pw.sql b/Open-ILS/src/sql/Pg/upgrade/0618.data.org-setting-phone_pw.sql
similarity index 89%
rename from Open-ILS/src/sql/Pg/upgrade/XXXX.phone_pw.sql
rename to Open-ILS/src/sql/Pg/upgrade/0618.data.org-setting-phone_pw.sql
index b39ff97..6351aa8 100644
--- a/Open-ILS/src/sql/Pg/upgrade/XXXX.phone_pw.sql
+++ b/Open-ILS/src/sql/Pg/upgrade/0618.data.org-setting-phone_pw.sql
@@ -1,3 +1,9 @@
+BEGIN;
+
+SELECT evergreen.upgrade_deps_block_check('0618', :eg_version);
+
 UPDATE config.org_unit_setting_type SET description = E'The Regular Expression for validation on the day_phone field in patron registration. Note: The first capture group will be used for the "last 4 digits of phone number" feature, if enabled. Ex: "[2-9]\\d{2}-\\d{3}-(\\d{4})( x\\d+)?" will ignore the extension on a NANP number.' WHERE name = 'ui.patron.edit.au.day_phone.regex';
 
 UPDATE config.org_unit_setting_type SET description = 'The Regular Expression for validation on phone fields in patron registration. Applies to all phone fields without their own setting. NOTE: See description of the day_phone regex for important information about capture groups with it.' WHERE name = 'ui.patron.edit.phone.regex';
+
+COMMIT;

commit e166e2a2db389ab376b3b2bf474e723205fc7b3d
Author: Thomas Berezansky <tsbere at mvlc.org>
Date:   Tue Aug 2 14:15:44 2011 -0400

    Unwrapped upgrade script for descripition changes
    
    Signed-off-by: Thomas Berezansky <tsbere at mvlc.org>
    Signed-off-by: Jason Etheridge <jason at esilibrary.com>

diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.phone_pw.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.phone_pw.sql
new file mode 100644
index 0000000..b39ff97
--- /dev/null
+++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.phone_pw.sql
@@ -0,0 +1,3 @@
+UPDATE config.org_unit_setting_type SET description = E'The Regular Expression for validation on the day_phone field in patron registration. Note: The first capture group will be used for the "last 4 digits of phone number" feature, if enabled. Ex: "[2-9]\\d{2}-\\d{3}-(\\d{4})( x\\d+)?" will ignore the extension on a NANP number.' WHERE name = 'ui.patron.edit.au.day_phone.regex';
+
+UPDATE config.org_unit_setting_type SET description = 'The Regular Expression for validation on phone fields in patron registration. Applies to all phone fields without their own setting. NOTE: See description of the day_phone regex for important information about capture groups with it.' WHERE name = 'ui.patron.edit.phone.regex';

commit 6cb15c141b5a6d8c4e1a4c4402ae6bcc75de16ce
Author: Thomas Berezansky <tsbere at mvlc.org>
Date:   Tue Aug 2 14:15:06 2011 -0400

    Seed data update for regex descriptions
    
    Mention capture group stuff in day_phone
    Add note about day_phone to generic phone
    
    Signed-off-by: Thomas Berezansky <tsbere at mvlc.org>
    Signed-off-by: Jason Etheridge <jason at esilibrary.com>

diff --git a/Open-ILS/src/sql/Pg/950.data.seed-values.sql b/Open-ILS/src/sql/Pg/950.data.seed-values.sql
index a8084a2..e63bb58 100644
--- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql
+++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql
@@ -3151,7 +3151,7 @@ INSERT into config.org_unit_setting_type
     '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'),
+    oils_i18n_gettext('ui.patron.edit.au.day_phone.regex', E'The Regular Expression for validation on the day_phone field in patron registration. Note: The first capture group will be used for the "last 4 digits of phone number" feature, if enabled. Ex: "[2-9]\\d{2}-\\d{3}-(\\d{4})( x\\d+)?" will ignore the extension on a NANP number.', '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'),
@@ -3311,7 +3311,7 @@ INSERT into config.org_unit_setting_type
     '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'),
+    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. NOTE: See description of the day_phone regex for important information about capture groups with it.', 'coust', 'description'),
     'string');
 
 -- *** Has to go below coust definition to satisfy referential integrity ***

commit 353e6ce078a37a2f5b8c3c581602bd9fa36ce0c7
Author: Thomas Berezansky <tsbere at mvlc.org>
Date:   Mon Jun 13 01:01:52 2011 -0400

    Regex check for "last 4 digits of phone number"
    
    If the day_phone regex (direct or from generic phone) has a capture group use it as the "last 4 digits".
    
    For example, you might configure this for day_phone regex:
    
    [2-9]\d{2}-\d{3}-(\d{4})( x\d+)?
    
    With this patch the extension will be ignored for the last 4 digits.
    
    Note: Does not require that the "last 4 digits" capture group actually contain 4 digits.
    
    Signed-off-by: Thomas Berezansky <tsbere at mvlc.org>
    Signed-off-by: Jason Etheridge <jason at esilibrary.com>

diff --git a/Open-ILS/web/js/ui/default/actor/user/register.js b/Open-ILS/web/js/ui/default/actor/user/register.js
index ac9b45c..3fe41b8 100644
--- a/Open-ILS/web/js/ui/default/actor/user/register.js
+++ b/Open-ILS/web/js/ui/default/actor/user/register.js
@@ -1078,14 +1078,23 @@ function attachWidgetEvents(fmcls, fmfield, widget) {
 
             case 'day_phone':
                 // if configured, use the last four digits of the day phone number as the password
+                // Alt, use the first capture group of the validator regex
                 if(uEditUsePhonePw && patron.isnew()) {
-                    dojo.connect(widget.widget, 'onChange',
+                    dojo.connect(widget.widget, 'onChange', widget.widget,
                         function(newVal) {
-                            if(newVal && newVal.length >= 4) {
+                            var newPw = false;
+                            if(this.regExp) {
+                                matches = RegExp(this.regExp).exec(newVal);
+                                if(matches.length > 1) newPw = matches[1];
+                            }
+                            if(!newPw && newVal && newVal.length >= 4) {
+                                newPw = newVal.substring(newVal.length - 4);
+                            }
+                            if(newPw) {
                                 var pw1 = findWidget('au', 'passwd').widget;
                                 var pw2 = findWidget('au', 'passwd2').widget;
-                                pw1.attr('value', newVal.substring(newVal.length - 4));
-                                pw2.attr('value', newVal.substring(newVal.length - 4));
+                                pw1.attr('value', newPw);
+                                pw2.attr('value', newPw);
                             }
                         }
                     );

-----------------------------------------------------------------------

Summary of changes:
 Open-ILS/src/sql/Pg/002.schema.config.sql          |    2 +-
 Open-ILS/src/sql/Pg/950.data.seed-values.sql       |    6 +++---
 .../Pg/upgrade/0618.data.org-setting-phone_pw.sql  |   11 +++++++++++
 Open-ILS/web/js/ui/default/actor/user/register.js  |   17 +++++++++++++----
 4 files changed, 28 insertions(+), 8 deletions(-)
 create mode 100644 Open-ILS/src/sql/Pg/upgrade/0618.data.org-setting-phone_pw.sql


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list