- Added check for unique customer numbers (empty customer numbers are allowed as well).
- Extended UNIQUE validator to allow empty values if "allowempty" option is set to "y".
| | |
| | | } |
| | | break; |
| | | case 'UNIQUE': |
| | | if($validator['allowempty'] != 'y') $validator['allowempty'] = 'n'; |
| | | if($validator['allowempty'] == 'n' || ($validator['allowempty'] == 'y' && $field_value != '')){ |
| | | if($this->action == 'NEW') { |
| | | $num_rec = $app->db->queryOneRecord("SELECT count(*) as number FROM ".$escape.$this->formDef['db_table'].$escape. " WHERE $field_name = '".$app->db->quote($field_value)."'"); |
| | | if($num_rec["number"] > 0) { |
| | |
| | | } |
| | | } |
| | | } |
| | | } |
| | | break; |
| | | case 'NOTEMPTY': |
| | | if(empty($field_value)) { |
| | |
| | | 'customer_no' => array ( |
| | | 'datatype' => 'VARCHAR', |
| | | 'formtype' => 'TEXT', |
| | | 'validators' => array ( 0 => array ( 'type' => 'UNIQUE', |
| | | 'errmsg'=> 'customer_no_error_unique', |
| | | 'allowempty' => 'y'), |
| | | ), |
| | | 'default' => '', |
| | | 'value' => '', |
| | | 'separator' => '', |
| | |
| | | 'customer_no' => array ( |
| | | 'datatype' => 'VARCHAR', |
| | | 'formtype' => 'TEXT', |
| | | 'validators' => array ( 0 => array ( 'type' => 'UNIQUE', |
| | | 'errmsg'=> 'customer_no_error_unique', |
| | | 'allowempty' => 'y'), |
| | | ), |
| | | 'default' => '', |
| | | 'value' => '', |
| | | 'separator' => '', |
| | |
| | | $wb['repeat_password_txt'] = "Passwort wiederholen"; |
| | | $wb['password_mismatch_txt'] = "Die Passwörter stimmen nicht überein."; |
| | | $wb['password_match_txt'] = "Die Passwörter stimmen überein."; |
| | | $wb["customer_no_error_unique"] = 'Die Kundennummer muß einzigartig sein (oder leer).'; |
| | | ?> |
| | | |
| | |
| | | $wb['repeat_password_txt'] = "Passwort wiederholen"; |
| | | $wb['password_mismatch_txt'] = "Die Passwörter stimmen nicht überein."; |
| | | $wb['password_match_txt'] = "Die Passwörter stimmen überein."; |
| | | $wb["customer_no_error_unique"] = 'Die Kundennummer muß einzigartig sein (oder leer).'; |
| | | ?> |
| | | |
| | |
| | | $wb['password_mismatch_txt'] = 'The passwords do not match.'; |
| | | $wb['password_match_txt'] = 'The passwords do match.'; |
| | | $wb['email_error_isemail'] = 'Please enter a valid email address.'; |
| | | $wb["customer_no_error_unique"] = 'The customer no. must be unique (or empty).'; |
| | | ?> |
| | |
| | | $wb['password_mismatch_txt'] = 'The passwords do not match.'; |
| | | $wb['password_match_txt'] = 'The passwords do match.'; |
| | | $wb['email_error_isemail'] = 'Please enter a valid email address.'; |
| | | $wb["customer_no_error_unique"] = 'The customer no. must be unique (or empty).'; |
| | | ?> |