[open-ils-commits] r13263 - trunk/Open-ILS/xul/staff_client/server/patron (dbs)

svn at svn.open-ils.org svn at svn.open-ils.org
Fri May 29 15:53:13 EDT 2009


Author: dbs
Date: 2009-05-29 15:53:10 -0400 (Fri, 29 May 2009)
New Revision: 13263

Modified:
   trunk/Open-ILS/xul/staff_client/server/patron/search_form.js
   trunk/Open-ILS/xul/staff_client/server/patron/ue_config.js
Log:
Use Unicode-friendly regular expressions for registering and retrieving patrons by name

This enables patrons with names like ?\195?\137tienne or ?\212?\177?\212?\178?\212?\179?\212?\177?\213?\144 to be registered and retrieved


Modified: trunk/Open-ILS/xul/staff_client/server/patron/search_form.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/patron/search_form.js	2009-05-29 18:05:29 UTC (rev 13262)
+++ trunk/Open-ILS/xul/staff_client/server/patron/search_form.js	2009-05-29 19:53:10 UTC (rev 13263)
@@ -317,7 +317,7 @@
     						case 'family_name' :
     						case 'first_given_name' :
     						case 'second_given_name' :
-    							value = value.replace(/^\W+/g,'').replace(/\W+$/g,'');
+    							value = value.replace(/^[\d\s]+/g,'').replace(/[\d\s]+$/g,'')
     						break;
     					}
     					if (value != '') {

Modified: trunk/Open-ILS/xul/staff_client/server/patron/ue_config.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/patron/ue_config.js	2009-05-29 18:05:29 UTC (rev 13262)
+++ trunk/Open-ILS/xul/staff_client/server/patron/ue_config.js	2009-05-29 19:53:10 UTC (rev 13263)
@@ -32,7 +32,7 @@
 const ssnRegex		= /^\d{3}-\d{2}-\d{4}$/;
 const dlRegex		= /^[a-zA-Z]{2}-\w+/; /* driver's license */
 const phoneRegex	= /^\d{3}-\d{3}-\d{4}(| \S+.*)$/i;
-const nonumRegex	= /^[a-zA-Z]\D*$/; /* no numbers, no beginning whitespace */
+const nonumRegex	= /^[^\d\s]+[\d]*$/; /* no numbers, no beginning whitespace */
 const dateRegex	= /^\d{4}-\d{2}-\d{2}/;
 const zipRegex		= /^\d{5}(-\d{4}|-?$)/; /* 12345 or 12345-6789 */
 



More information about the open-ils-commits mailing list