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

Evergreen Git git at git.evergreen-ils.org
Mon Jul 8 10:34:14 EDT 2013


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  ab37833ff9df7fa13e86e41fb160232bdee51793 (commit)
       via  47bfda2570939d9560e1c3aac330feb1e2e735d5 (commit)
      from  19ecb62f9955f720c9cc0de61eaa47b18c2d4037 (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 ab37833ff9df7fa13e86e41fb160232bdee51793
Author: Ben Shum <bshum at biblio.org>
Date:   Mon Jul 8 10:33:12 2013 -0400

    Stamping upgrade script for user barcode regex setting
    
    Signed-off-by: Ben Shum <bshum at biblio.org>

diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql
index 00daaee..adf0b23 100644
--- a/Open-ILS/src/sql/Pg/002.schema.config.sql
+++ b/Open-ILS/src/sql/Pg/002.schema.config.sql
@@ -91,7 +91,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 ('0800', :eg_version); -- miker/dbs
+INSERT INTO config.upgrade_log (version, applied_to) VALUES ('0801', :eg_version); -- tsbere/paxed/bshum
 
 CREATE TABLE config.bib_source (
 	id		SERIAL	PRIMARY KEY,
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.check_barcode_regex.sql b/Open-ILS/src/sql/Pg/upgrade/0801.check_barcode_regex.sql
similarity index 85%
rename from Open-ILS/src/sql/Pg/upgrade/XXXX.check_barcode_regex.sql
rename to Open-ILS/src/sql/Pg/upgrade/0801.check_barcode_regex.sql
index 0d2bcef..b6b9dd7 100644
--- a/Open-ILS/src/sql/Pg/upgrade/XXXX.check_barcode_regex.sql
+++ b/Open-ILS/src/sql/Pg/upgrade/0801.check_barcode_regex.sql
@@ -1,3 +1,7 @@
+BEGIN;
+
+SELECT evergreen.upgrade_deps_block_check('0801', :eg_version);
+
 INSERT into config.org_unit_setting_type
 ( name, grp, label, description, datatype, fm_class ) VALUES
 ( 'ui.patron.edit.ac.barcode.regex', 'gui',
@@ -8,3 +12,5 @@ INSERT into config.org_unit_setting_type
         'The Regular Expression for validation on barcodes in patron registration.',
         'coust', 'description'),
     'string', null);
+
+COMMIT;

commit 47bfda2570939d9560e1c3aac330feb1e2e735d5
Author: Thomas Berezansky <tsbere at mvlc.org>
Date:   Tue Jan 31 16:50:21 2012 -0500

    Add registration/edit time barcode restrictions
    
    In the quest to not let staff put bad data into the system (losing battle,
    but hey, gotta keep trying, right?), add a barcode regex specifically for
    patron registration.
    
    This intentionally does *not* check the opac "is this a barcode?" value.
    
    Use cases for not checking that value include, but are not limited to:
    
    Special "barcodes" for staff accounts. Specific OUs may have a barcode
    regex of ".*" to ensure they can use anything for these accounts.
    
    Different prefixes per library - To prevent libraries from using another
    library's prefix, but still detect all of them as barcodes.
    
    Special case "this is a barcode" checks for the opac, like legacy barcodes
    that should no longer be assigned to new patrons, or on edits.
    
    Signed-off-by: Thomas Berezansky <tsbere at mvlc.org>
    Signed-off-by: Pasi Kallinen <pasi.kallinen at pttk.fi>
    Signed-off-by: Ben Shum <bshum at biblio.org>

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 d181ff4..fec8adb 100644
--- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql
+++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql
@@ -4196,6 +4196,15 @@ INSERT into config.org_unit_setting_type
         'coust', 'description'),
     'bool', null)
 
+,( 'ui.patron.edit.ac.barcode.regex', 'gui',
+    oils_i18n_gettext('ui.patron.edit.ac.barcode.regex',
+        'Regex for barcodes on patron registration',
+        'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.ac.barcode.regex',
+        'The Regular Expression for validation on barcodes in patron registration.',
+        'coust', 'description'),
+    'string', null)
+
 ,( 'ui.patron.edit.au.day_phone.example', 'gui',
     oils_i18n_gettext('ui.patron.edit.au.day_phone.example',
         'Example for day_phone field on patron registration',
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.check_barcode_regex.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.check_barcode_regex.sql
new file mode 100644
index 0000000..0d2bcef
--- /dev/null
+++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.check_barcode_regex.sql
@@ -0,0 +1,10 @@
+INSERT into config.org_unit_setting_type
+( name, grp, label, description, datatype, fm_class ) VALUES
+( 'ui.patron.edit.ac.barcode.regex', 'gui',
+    oils_i18n_gettext('ui.patron.edit.ac.barcode.regex',
+        'Regex for barcodes on patron registration',
+        'coust', 'label'),
+    oils_i18n_gettext('ui.patron.edit.ac.barcode.regex',
+        'The Regular Expression for validation on barcodes in patron registration.',
+        'coust', 'description'),
+    'string', null);
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 810ab3a..b62c3b6 100644
--- a/Open-ILS/web/js/ui/default/actor/user/register.js
+++ b/Open-ILS/web/js/ui/default/actor/user/register.js
@@ -132,6 +132,7 @@ function load() {
         'ui.patron.edit.au.prefix.require',
         'ui.patron.edit.au.prefix.show',
         'ui.patron.edit.au.prefix.suggest',
+        'ui.patron.edit.ac.barcode.regex',
         'ui.patron.edit.au.second_given_name.show',
         'ui.patron.edit.au.second_given_name.suggest',
         'ui.patron.edit.au.suffix.show',
@@ -1239,6 +1240,24 @@ function attachWidgetEvents(fmcls, fmfield, widget) {
 
     if(fmcls == 'ac') {
         if(fmfield == 'barcode') {
+            widget.widget.isValid = function() {
+                if(this.attr('disabled') || this.attr('readOnly')) {
+                    return true;
+                }
+                if(orgSettings['ui.patron.edit.ac.barcode.regex']) { // This serves as a master "on" for these checks
+                    // No spaces
+                    if(this.attr("value").match(/\s/)) {
+                        return false;
+                    }
+                    var test_regexp = new RegExp(orgSettings['ui.patron.edit.ac.barcode.regex']);
+                    if(test_regexp.test(this.attr("value"))) {
+                        return true;
+                    }
+                    return false;
+                }
+
+                return true;
+            }
             dojo.connect(widget.widget, 'onChange',
                 function() {
                     var barcode = this.attr('value');

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

Summary of changes:
 Open-ILS/src/sql/Pg/002.schema.config.sql          |    2 +-
 Open-ILS/src/sql/Pg/950.data.seed-values.sql       |    9 +++++++++
 .../sql/Pg/upgrade/0801.check_barcode_regex.sql    |   16 ++++++++++++++++
 Open-ILS/web/js/ui/default/actor/user/register.js  |   19 +++++++++++++++++++
 4 files changed, 45 insertions(+), 1 deletions(-)
 create mode 100644 Open-ILS/src/sql/Pg/upgrade/0801.check_barcode_regex.sql


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list