diff --git a/db/db.code.version.txt b/db/db.code.version.txt index 1b9cba4..492dff0 100644 --- a/db/db.code.version.txt +++ b/db/db.code.version.txt @@ -1 +1 @@ -151 +152 diff --git a/db/db.update.152.sql b/db/db.update.152.sql new file mode 100644 index 0000000..53eecc1 --- /dev/null +++ b/db/db.update.152.sql @@ -0,0 +1,16 @@ +INSERT INTO `config` ( `var` , `val` , `category` , `type` , `type_values` , `ord` , `description` , `year` ) +VALUES ( +'judge_personal_fields', 'phonehome,phonecell,phonework,org,address,city,province,lang', +'Judge Registration', 'multisel', +'sex=Gender|phonehome=Home Phone|phonework=Work Phone|phonecell=Cell Phone|fax=Fax|org=Organization|birthdate=Birthdate|lang=Preferred Language|address=Address and PostalCode|city=City|province=Province', +'500', 'Personal Information to ask for on the Judge personal information page (in addition to Name and Email)', '-1'); + + +INSERT INTO `config` ( `var` , `val` , `category` , `type` , `type_values` , `ord` , `description` , `year` ) +VALUES ( +'judge_personal_required', 'phonehome,address,city,province', +'Judge Registration', 'multisel', +'sex=Gender|phonehome=Home Phone|phonework=Work Phone|phonecell=Cell Phone|fax=Fax|org=Organization|birthdate=Birthdate|lang=Preferred Language|address=Address and PostalCode|city=City|province=Province', +'600', 'Required Personal Information on the Judge personal information page (Name and Email is always required)', '-1'); + + diff --git a/user_personal.php b/user_personal.php index 938132c..2db6c0f 100644 --- a/user_personal.php +++ b/user_personal.php @@ -63,8 +63,8 @@ 'regexp' => '^[1-9][0-9]{2}-[1-9][0-9]{2}-[0-9]{4}$', 'format' => '\'NNN-NNN-NNNN\'',), 'postalcode' => array('name' => $config['postalzip'], - 'regexp' => '^(([A-Z][0-9][A-Z] [0-9][A-Z][0-9])|([0-9]{5}))$', - 'format' => '\'ANA NAN\' or \'NNNNN\'',), + 'regexp' => '^(([A-Z][0-9][A-Z]( )?[0-9][A-Z][0-9])|([0-9]{5}))$', + 'format' => '\'ANA NAN\' or \'ANANAN\' or \'NNNNN\'',), ); @@ -121,7 +121,7 @@ case 'save': /* Match the regex */ if(!ereg($user_personal_fields[$f]['regexp'], $u[$f])) { /* Bad */ - echo "bad regex match ({$user_personal_fields[$f]['regexp']})"; + error_("Invalid format for $f expecting ({$user_personal_fields[$f]['format']})"); $save = false; $errorfields[] = $f; }