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