From 6c0b4efeb53608b55d44343d3a6b635cc72b9f60 Mon Sep 17 00:00:00 2001 From: Mate Remias Date: Thu, 9 Feb 2017 15:27:24 +0100 Subject: [PATCH 1/3] Add docker compose --- docker-compose.yml | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 docker-compose.yml diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 000000000..85f17794c --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,8 @@ +web: + image: tutum/lamp + ports: + - "80:80" + - "443:443" + - "3306:3306" + volumes: + - .:/app From 7b11758cbae098a7263985c2855efcedc515c9c7 Mon Sep 17 00:00:00 2001 From: Mate Remias Date: Thu, 9 Feb 2017 15:31:11 +0100 Subject: [PATCH 2/3] changed all tables to unicode, allow accented characters in names --- Zend/View/Helper/Grid.php | 4 +- Zend/View/Helper/Gridtm.php | 4 +- .../default/controllers/CitiesController.php | 2 +- .../modules/default/forms/Myteamemployee.php | 4 +- .../default/forms/empcommunicationdetails.php | 2 +- .../modules/default/forms/employee.php | 8 +- .../modules/default/forms/viewprofile.php | 6 +- .../modules/default/library/sapp/Helper.php | 4 +- install/hrms.sql | 140 +++++++++--------- sql/queries.sql | 6 +- sql/queries.txt | 2 +- 11 files changed, 91 insertions(+), 91 deletions(-) diff --git a/Zend/View/Helper/Grid.php b/Zend/View/Helper/Grid.php index e8b3d3f19..8df77b1b5 100644 --- a/Zend/View/Helper/Grid.php +++ b/Zend/View/Helper/Grid.php @@ -811,10 +811,10 @@ public function generateGrid ($name, $fields = null,$paginator=null,$extracolumn } break; default: - $output .= "".htmlentities($valToInclude, ENT_QUOTES, "ISO-8859-1").""; + $output .= "".htmlentities($valToInclude, ENT_QUOTES, "UTF-8").""; break; } - // Customize grid fields data - END htmlentities(trim($p[$k]), ENT_QUOTES, "ISO-8859-1") + // Customize grid fields data - END htmlentities(trim($p[$k]), ENT_QUOTES, "UTF-8") } } } diff --git a/Zend/View/Helper/Gridtm.php b/Zend/View/Helper/Gridtm.php index 14afb82d4..a2da2cc0c 100644 --- a/Zend/View/Helper/Gridtm.php +++ b/Zend/View/Helper/Gridtm.php @@ -796,10 +796,10 @@ public function generateGridTm ($name, $fields = null,$paginator=null,$extracolu } break; default: - $output .= "".htmlentities($valToInclude, ENT_QUOTES, "ISO-8859-1").""; + $output .= "".htmlentities($valToInclude, ENT_QUOTES, "UTF-8").""; break; } - // Customize grid fields data - END htmlentities(trim($p[$k]), ENT_QUOTES, "ISO-8859-1") + // Customize grid fields data - END htmlentities(trim($p[$k]), ENT_QUOTES, "UTF-8") //echo $controllerName.'--'.$k.'--'.$p[$k]; if($controllerName == 'expenses' && $k == 'status' && $p[$k] != 'saved' && $p[$k] != 'rejected') { diff --git a/application/modules/default/controllers/CitiesController.php b/application/modules/default/controllers/CitiesController.php index 6f8cc7a66..a373d5480 100644 --- a/application/modules/default/controllers/CitiesController.php +++ b/application/modules/default/controllers/CitiesController.php @@ -112,7 +112,7 @@ public function viewAction() if(!empty($data)) { $ent=ENT_COMPAT; - $charset='ISO-8859-1'; + $charset='UTF-8'; $city_name = htmlentities($data[0]['city'], $ent, $charset); $countrieslistArr = $countriesModel->getActiveCountryName($data[0]['countryid']); $citiesform->countryid->addMultiOption($countrieslistArr[0]['country_id_org'],utf8_encode($countrieslistArr[0]['country'])); diff --git a/application/modules/default/forms/Myteamemployee.php b/application/modules/default/forms/Myteamemployee.php index 91af6952d..e9a29813d 100644 --- a/application/modules/default/forms/Myteamemployee.php +++ b/application/modules/default/forms/Myteamemployee.php @@ -87,7 +87,7 @@ public function init() $first_name->setAttrib("class", "formDataElement"); $first_name->setAttrib('maxlength', 50); $first_name->addValidator("regex",true,array( - 'pattern'=>'/^([a-zA-Z.]+ ?)+$/', + 'pattern'=>'/^[\p{L}- ]*$/u', 'messages'=>array( 'regexNotMatch'=>'Please enter only alphabets.' ) @@ -100,7 +100,7 @@ public function init() $last_name->setAttrib("class", "formDataElement"); $last_name->setAttrib('maxlength', 50); $last_name->addValidator("regex",true,array( - 'pattern'=>'/^([a-zA-Z.]+ ?)+$/', + 'pattern'=>'/^[\p{L}- ]*$/u', 'messages'=>array( 'regexNotMatch'=>'Please enter only alphabets.' ) diff --git a/application/modules/default/forms/empcommunicationdetails.php b/application/modules/default/forms/empcommunicationdetails.php index ebfa9a4e4..f78292f22 100644 --- a/application/modules/default/forms/empcommunicationdetails.php +++ b/application/modules/default/forms/empcommunicationdetails.php @@ -145,7 +145,7 @@ public function init() $emergency_name->setAttrib('maxLength', 50); $emergency_name->addFilter(new Zend_Filter_StringTrim()); $emergency_name->addValidator("regex",true,array( - 'pattern'=>'/^([a-zA-Z.]+ ?)+$/', + 'pattern'=>'/^[\p{L}- ]*$/u', 'messages'=>array( 'regexNotMatch'=>'Please enter only alphabets.' ) diff --git a/application/modules/default/forms/employee.php b/application/modules/default/forms/employee.php index e882a7a5a..f3cf26ca0 100644 --- a/application/modules/default/forms/employee.php +++ b/application/modules/default/forms/employee.php @@ -328,7 +328,7 @@ public function init() } } /*$userfullname->addValidator("regex",true,array( - 'pattern'=>'/^([a-zA-Z.]+ ?)+$/', + 'pattern'=>'/^[\p{L}- ]*$/u', 'messages'=>array( 'regexNotMatch'=>'Please enter only alphabets.' @@ -336,7 +336,7 @@ public function init() ));*/ $first_name->addValidator("regex",true,array( - 'pattern'=>'/^([a-zA-Z.]+ ?)+$/', + 'pattern'=>'/^[\p{L}- ]*$/u', 'messages'=>array( 'regexNotMatch'=>'Please enter only alphabets.' @@ -344,7 +344,7 @@ public function init() )); $last_name->addValidator("regex",true,array( - 'pattern'=>'/^([a-zA-Z.]+ ?)+$/', + 'pattern'=>'/^[\p{L}- ]*$/u', 'messages'=>array( 'regexNotMatch'=>'Please enter only alphabets.' @@ -352,7 +352,7 @@ public function init() )); $other_modeofentry->addValidator("regex",true,array( - 'pattern'=>'/^([a-zA-Z.]+ ?)+$/', + 'pattern'=>'/^[\p{L}- ]*$/u', 'messages'=>array( 'regexNotMatch'=>'Please enter only alphabets.' diff --git a/application/modules/default/forms/viewprofile.php b/application/modules/default/forms/viewprofile.php index db9cd44a6..1cfa84c5e 100644 --- a/application/modules/default/forms/viewprofile.php +++ b/application/modules/default/forms/viewprofile.php @@ -41,7 +41,7 @@ public function init() $userfullname->setRequired(true); $userfullname->addValidator('NotEmpty', false, array('messages' => 'Please enter user name.')); $userfullname->addValidator("regex",true,array( - 'pattern'=>'/^([a-zA-Z.]+ ?)+$/', + 'pattern'=>'/^[\p{L}- ]*$/u', 'messages'=>array( // 'regexNotMatch'=>'Please enter only alphabetic characters.' 'regexNotMatch'=>'Please enter only alphabets.' @@ -55,7 +55,7 @@ public function init() $firstname->setRequired(true); $firstname->addValidator('NotEmpty', false, array('messages' => 'Please enter first name.')); $firstname->addValidator("regex",true,array( - 'pattern'=>'/^([a-zA-Z.]+ ?)+$/', + 'pattern'=>'/^[\p{L}- ]*$/u', 'messages'=>array( // 'regexNotMatch'=>'Please enter only alphabetic characters.' 'regexNotMatch'=>'Please enter only alphabets.' @@ -69,7 +69,7 @@ public function init() $lastname->setRequired(true); $lastname->addValidator('NotEmpty', false, array('messages' => 'Please enter last name.')); $lastname->addValidator("regex",true,array( - 'pattern'=>'/^([a-zA-Z.]+ ?)+$/', + 'pattern'=>'/^[\p{L}- ]*$/u', 'messages'=>array( // 'regexNotMatch'=>'Please enter only alphabetic characters.' 'regexNotMatch'=>'Please enter only alphabets.' diff --git a/application/modules/default/library/sapp/Helper.php b/application/modules/default/library/sapp/Helper.php index 1b46b90b8..ba149fc9f 100644 --- a/application/modules/default/library/sapp/Helper.php +++ b/application/modules/default/library/sapp/Helper.php @@ -602,12 +602,12 @@ public static function process_emp_excel($file_name) $err_msg = "Prefix is not a valid format at row ".$i."."; break; } - if (!preg_match("/^([a-zA-Z.]+ ?)+$/", $rowData[1]) && !empty($rowData[1])) + if (!preg_match("/^[\p{L}- ]*$/u", $rowData[1]) && !empty($rowData[1])) { $err_msg = "First name is not a valid format at row ".$i."."; break; } - if (!preg_match("/^([a-zA-Z.]+ ?)+$/", $rowData[2]) && !empty($rowData[2])) + if (!preg_match("/^[\p{L}- ]*$/u", $rowData[2]) && !empty($rowData[2])) { $err_msg = "Last name is not a valid format at row ".$i."."; break; diff --git a/install/hrms.sql b/install/hrms.sql index 39f937b2b..03107efe7 100644 --- a/install/hrms.sql +++ b/install/hrms.sql @@ -49,7 +49,7 @@ DROP TABLE IF EXISTS `assets_categories`; CREATE TABLE `assets_categories` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `name` varchar(50) CHARACTER SET latin1 NOT NULL, + `name` varchar(50) CHARACTER SET utf8 NOT NULL, `parent` int(11) DEFAULT NULL, `is_active` tinyint(4) DEFAULT NULL, `created_by` int(11) DEFAULT NULL, @@ -357,7 +357,7 @@ CREATE TABLE `main_accountclasstype` ( `modifieddate` datetime DEFAULT NULL, `isactive` tinyint(1) unsigned DEFAULT '1', PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*Data for the table `main_accountclasstype` */ @@ -403,7 +403,7 @@ CREATE TABLE `main_announcements` ( `createddate` datetime DEFAULT NULL, `modifieddate` datetime DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*Data for the table `main_announcements` */ @@ -421,7 +421,7 @@ CREATE TABLE `main_assignmententryreasoncode` ( `modifieddate` datetime DEFAULT NULL, `isactive` tinyint(1) DEFAULT '1', PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*Data for the table `main_assignmententryreasoncode` */ @@ -439,7 +439,7 @@ CREATE TABLE `main_attendancestatuscode` ( `modifieddate` datetime DEFAULT NULL, `isactive` tinyint(1) unsigned DEFAULT '1', PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*Data for the table `main_attendancestatuscode` */ @@ -457,7 +457,7 @@ CREATE TABLE `main_bankaccounttype` ( `modifieddate` datetime DEFAULT NULL, `isactive` tinyint(1) DEFAULT '1', PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*Data for the table `main_bankaccounttype` */ @@ -718,7 +718,7 @@ CREATE TABLE `main_cities` ( `isactive` tinyint(1) DEFAULT '1', PRIMARY KEY (`id`), UNIQUE KEY `state_city` (`state`,`city_org_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=DYNAMIC; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=DYNAMIC; /*Data for the table `main_cities` */ @@ -736,7 +736,7 @@ CREATE TABLE `main_competencylevel` ( `modifieddate` datetime DEFAULT NULL, `isactive` tinyint(1) DEFAULT '1', PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*Data for the table `main_competencylevel` */ @@ -756,7 +756,7 @@ CREATE TABLE `main_countries` ( `isactive` tinyint(1) unsigned DEFAULT '1', `country_id_org` int(10) unsigned DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*Data for the table `main_countries` */ @@ -790,7 +790,7 @@ CREATE TABLE `main_currency` ( `modifieddate` datetime DEFAULT NULL, `isactive` tinyint(1) DEFAULT '1', PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1; +) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; /*Data for the table `main_currency` */ @@ -837,7 +837,7 @@ CREATE TABLE `main_dateformat` ( `modifieddate` datetime DEFAULT NULL, `isactive` tinyint(1) unsigned DEFAULT '1', PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=latin1; +) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8; /*Data for the table `main_dateformat` */ @@ -884,7 +884,7 @@ CREATE TABLE `main_disciplinary_history` ( `createdby` bigint(20) unsigned DEFAULT NULL, `createddate` datetime DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*Data for the table `main_disciplinary_history` */ @@ -916,7 +916,7 @@ CREATE TABLE `main_disciplinary_incident` ( `modifieddate` datetime DEFAULT NULL, `isactive` tinyint(1) DEFAULT '1', PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1; +) ENGINE=MyISAM DEFAULT CHARSET=utf8; /*Data for the table `main_disciplinary_incident` */ @@ -934,7 +934,7 @@ CREATE TABLE `main_disciplinary_violation_types` ( `modifieddate` datetime DEFAULT NULL, `isactive` tinyint(1) unsigned DEFAULT '1', PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1; +) ENGINE=MyISAM DEFAULT CHARSET=utf8; /*Data for the table `main_disciplinary_violation_types` */ @@ -952,7 +952,7 @@ CREATE TABLE `main_educationlevelcode` ( `modifieddate` datetime DEFAULT NULL, `isactive` tinyint(1) DEFAULT '1', PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*Data for the table `main_educationlevelcode` */ @@ -970,7 +970,7 @@ CREATE TABLE `main_eeoccategory` ( `modifieddate` datetime DEFAULT NULL, `isactive` tinyint(1) DEFAULT '1', PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*Data for the table `main_eeoccategory` */ @@ -1317,7 +1317,7 @@ CREATE TABLE `main_employeedocuments` ( `modifieddate` datetime DEFAULT NULL, `isactive` tinyint(1) DEFAULT '1', PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1; +) ENGINE=MyISAM DEFAULT CHARSET=utf8; /*Data for the table `main_employeedocuments` */ @@ -1361,7 +1361,7 @@ CREATE TABLE `main_employeeleavetypes` ( `modifieddate` datetime DEFAULT NULL, `isactive` tinyint(1) DEFAULT '1', PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*Data for the table `main_employeeleavetypes` */ @@ -1480,7 +1480,7 @@ CREATE TABLE `main_employmentstatus` ( `modifieddate` datetime DEFAULT NULL, `isactive` tinyint(1) DEFAULT '1', PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*Data for the table `main_employmentstatus` */ @@ -1696,7 +1696,7 @@ CREATE TABLE `main_ethniccode` ( `modifieddate` datetime DEFAULT NULL, `isactive` tinyint(1) unsigned DEFAULT '1', PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=latin1; +) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8; /*Data for the table `main_ethniccode` */ @@ -1717,7 +1717,7 @@ CREATE TABLE `main_gender` ( `modifieddate` datetime DEFAULT NULL, `isactive` tinyint(1) unsigned DEFAULT '1', PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1; +) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; /*Data for the table `main_gender` */ @@ -1741,7 +1741,7 @@ CREATE TABLE `main_geographygroup` ( `modifieddate` datetime DEFAULT NULL, `isactive` tinyint(1) DEFAULT '1', PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*Data for the table `main_geographygroup` */ @@ -1821,7 +1821,7 @@ CREATE TABLE `main_holidaygroups` ( `modifieddate` datetime DEFAULT NULL, `isactive` tinyint(1) DEFAULT '1', PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*Data for the table `main_holidaygroups` */ @@ -1841,7 +1841,7 @@ CREATE TABLE `main_hr_wizard` ( `modifieddate` datetime DEFAULT NULL, `isactive` tinyint(1) DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1; +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; /*Data for the table `main_hr_wizard` */ @@ -2001,7 +2001,7 @@ CREATE TABLE `main_jobtitles` ( `modifieddate` datetime DEFAULT NULL, `isactive` tinyint(1) DEFAULT '1', PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*Data for the table `main_jobtitles` */ @@ -2019,7 +2019,7 @@ CREATE TABLE `main_language` ( `modifieddate` datetime DEFAULT NULL, `isactive` tinyint(1) DEFAULT '1', PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*Data for the table `main_language` */ @@ -2161,7 +2161,7 @@ CREATE TABLE `main_licensetype` ( `modifieddate` datetime DEFAULT NULL, `isactive` tinyint(1) unsigned DEFAULT '1', PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*Data for the table `main_licensetype` */ @@ -2236,7 +2236,7 @@ CREATE TABLE `main_maritalstatus` ( `modifieddate` datetime DEFAULT NULL, `isactive` tinyint(1) unsigned DEFAULT '1', PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1; +) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8; /*Data for the table `main_maritalstatus` */ @@ -2267,7 +2267,7 @@ CREATE TABLE `main_menu` ( `functionName` varchar(255) DEFAULT NULL, `defaultOrderBy` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=207 DEFAULT CHARSET=latin1; +) ENGINE=InnoDB AUTO_INCREMENT=207 DEFAULT CHARSET=utf8; /*Data for the table `main_menu` */ @@ -2287,7 +2287,7 @@ CREATE TABLE `main_militaryservice` ( `modifieddate` datetime DEFAULT NULL, `isactive` tinyint(1) unsigned DEFAULT '1', PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*Data for the table `main_militaryservice` */ @@ -2306,7 +2306,7 @@ CREATE TABLE `main_monthslist` ( `modifieddate` datetime DEFAULT NULL, `isactive` tinyint(1) unsigned DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=latin1; +) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8; /*Data for the table `main_monthslist` */ @@ -2326,7 +2326,7 @@ CREATE TABLE `main_nationality` ( `modifieddate` datetime DEFAULT NULL, `isactive` tinyint(1) unsigned DEFAULT '1', PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1; +) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8; /*Data for the table `main_nationality` */ @@ -2346,7 +2346,7 @@ CREATE TABLE `main_nationalitycontextcode` ( `modifieddate` datetime DEFAULT NULL, `isactive` tinyint(1) unsigned DEFAULT '1', PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*Data for the table `main_nationalitycontextcode` */ @@ -2364,7 +2364,7 @@ CREATE TABLE `main_numberformats` ( `modifieddate` datetime DEFAULT NULL, `isactive` tinyint(1) DEFAULT '1', PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*Data for the table `main_numberformats` */ @@ -2429,7 +2429,7 @@ CREATE TABLE `main_pa_appraisalhistory` ( KEY `NewIndex3` (`desc_emp_id`), KEY `NewIndex4` (`createdby`), KEY `NewIndex5` (`modifiedby`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=DYNAMIC COMMENT='gives history of each employee''s appraisal'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=DYNAMIC COMMENT='gives history of each employee''s appraisal'; /*Data for the table `main_pa_appraisalhistory` */ @@ -2450,7 +2450,7 @@ CREATE TABLE `main_pa_category` ( PRIMARY KEY (`id`), KEY `NewIndex1` (`createdby`), KEY `NewIndex2` (`modifiedby`) -) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1 CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=DYNAMIC COMMENT='This table is used to add questions category(Questionaire)'; +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=DYNAMIC COMMENT='This table is used to add questions category(Questionaire)'; /*Data for the table `main_pa_category` */ @@ -2497,7 +2497,7 @@ CREATE TABLE `main_pa_employee_ratings` ( KEY `NewIndex1` (`pa_initialization_id`), KEY `NewIndex2` (`employee_id`), CONSTRAINT `FK_main_pa_employee_ratings` FOREIGN KEY (`pa_initialization_id`) REFERENCES `main_pa_initialization` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=latin1 CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=DYNAMIC COMMENT='Employee appraisal response is stored in this table'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=DYNAMIC COMMENT='Employee appraisal response is stored in this table'; /*Data for the table `main_pa_employee_ratings` */ @@ -2525,7 +2525,7 @@ CREATE TABLE `main_pa_ff_employee_ratings` ( `modifieddate` datetime DEFAULT NULL, `isactive` tinyint(1) DEFAULT '1', PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*Data for the table `main_pa_ff_employee_ratings` */ @@ -2547,7 +2547,7 @@ CREATE TABLE `main_pa_ff_history` ( `modifieddate` datetime DEFAULT NULL, `isactive` tinyint(1) unsigned DEFAULT '1' COMMENT '1=active,0=inactive', PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=DYNAMIC COMMENT='gives step by step history of feedforward'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=DYNAMIC COMMENT='gives step by step history of feedforward'; /*Data for the table `main_pa_ff_history` */ @@ -2582,7 +2582,7 @@ CREATE TABLE `main_pa_ff_initialization` ( `createddate` datetime DEFAULT NULL, `modifieddate` datetime DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=DYNAMIC COMMENT='initialize feedforward by management'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=DYNAMIC COMMENT='initialize feedforward by management'; /*Data for the table `main_pa_ff_initialization` */ @@ -2604,7 +2604,7 @@ CREATE TABLE `main_pa_groups` ( `createddate` datetime DEFAULT NULL, `modifieddate` datetime DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=DYNAMIC COMMENT='divide all employees into groups for easy identification for'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=DYNAMIC COMMENT='divide all employees into groups for easy identification for'; /*Data for the table `main_pa_groups` */ @@ -2627,7 +2627,7 @@ CREATE TABLE `main_pa_groups_employees` ( `createddate` datetime DEFAULT NULL, `modifieddate` datetime DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*Data for the table `main_pa_groups_employees` */ @@ -2650,7 +2650,7 @@ CREATE TABLE `main_pa_groups_employees_temp` ( `createddate` datetime DEFAULT NULL, `modifieddate` datetime DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*Data for the table `main_pa_groups_employees_temp` */ @@ -2673,7 +2673,7 @@ CREATE TABLE `main_pa_implementation` ( `createddate` datetime DEFAULT NULL, `modifieddate` datetime DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=DYNAMIC COMMENT='stores configuration of appraisal process'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=DYNAMIC COMMENT='stores configuration of appraisal process'; /*Data for the table `main_pa_implementation` */ @@ -2716,7 +2716,7 @@ CREATE TABLE `main_pa_initialization` ( `createddate` datetime DEFAULT NULL COMMENT 'created date', `modifieddate` datetime DEFAULT NULL COMMENT 'modified date', PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=DYNAMIC COMMENT='initialize appriasal process'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=DYNAMIC COMMENT='initialize appriasal process'; /*Data for the table `main_pa_initialization` */ @@ -2742,7 +2742,7 @@ CREATE TABLE `main_pa_manager_initialization` ( `modifieddate` datetime DEFAULT NULL, `isactive` tinyint(1) DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=DYNAMIC COMMENT='Manager initialized data is stored in this table'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=DYNAMIC COMMENT='Manager initialized data is stored in this table'; /*Data for the table `main_pa_manager_initialization` */ @@ -2767,7 +2767,7 @@ CREATE TABLE `main_pa_questions` ( `modifieddate` datetime DEFAULT NULL, `isused` tinyint(1) DEFAULT '0', PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=DYNAMIC COMMENT='stores questions for appraisal and feedforward'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=DYNAMIC COMMENT='stores questions for appraisal and feedforward'; /*Data for the table `main_pa_questions` */ @@ -2804,7 +2804,7 @@ CREATE TABLE `main_pa_questions_privileges` ( `modifieddate` datetime DEFAULT NULL, `isactive` tinyint(1) DEFAULT '1', PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=DYNAMIC COMMENT='Stores the privileges of questions for each employee in json'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=DYNAMIC COMMENT='Stores the privileges of questions for each employee in json'; /*Data for the table `main_pa_questions_privileges` */ @@ -2836,7 +2836,7 @@ CREATE TABLE `main_pa_questions_privileges_temp` ( `modifieddate` datetime DEFAULT NULL, `isactive` tinyint(1) unsigned DEFAULT '1', PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=DYNAMIC COMMENT='Stores the questions, privileges and groups when initialized'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=DYNAMIC COMMENT='Stores the questions, privileges and groups when initialized'; /*Data for the table `main_pa_questions_privileges_temp` */ @@ -2861,7 +2861,7 @@ CREATE TABLE `main_pa_ratings` ( `modifieddate` datetime DEFAULT NULL, `isactive` tinyint(1) DEFAULT '1', PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=DYNAMIC COMMENT='This table is used to add ratings text in json format.'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=DYNAMIC COMMENT='This table is used to add ratings text in json format.'; /*Data for the table `main_pa_ratings` */ @@ -2884,7 +2884,7 @@ CREATE TABLE `main_pa_skills` ( `isactive` tinyint(1) DEFAULT '1', `isused` tinyint(1) DEFAULT '0', PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=DYNAMIC COMMENT='This table is used to add skills.'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=DYNAMIC COMMENT='This table is used to add skills.'; /*Data for the table `main_pa_skills` */ @@ -2899,7 +2899,7 @@ CREATE TABLE `main_patches_version` ( `modifieddate` datetime DEFAULT NULL, `isactive` tinyint(1) DEFAULT '1' COMMENT '1=latest versions,0=old versions', PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1; +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; /*Data for the table `main_patches_version` */ @@ -2920,7 +2920,7 @@ CREATE TABLE `main_payfrequency` ( `modifieddate` datetime DEFAULT NULL, `isactive` tinyint(1) DEFAULT '1', PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*Data for the table `main_payfrequency` */ @@ -3000,7 +3000,7 @@ CREATE TABLE `main_prefix` ( `modifieddate` datetime DEFAULT NULL, `isactive` tinyint(1) unsigned DEFAULT '1', PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1; +) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; /*Data for the table `main_prefix` */ @@ -3027,7 +3027,7 @@ CREATE TABLE `main_privileges` ( `modifieddate` datetime DEFAULT NULL, `isactive` tinyint(1) DEFAULT '1', PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=1184 DEFAULT CHARSET=latin1; +) ENGINE=InnoDB AUTO_INCREMENT=1184 DEFAULT CHARSET=utf8; /*Data for the table `main_privileges` */ @@ -3092,7 +3092,7 @@ CREATE TABLE `main_racecode` ( `modifieddate` datetime DEFAULT NULL, `isactive` tinyint(1) unsigned DEFAULT '1', PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1; +) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; /*Data for the table `main_racecode` */ @@ -3112,7 +3112,7 @@ CREATE TABLE `main_remunerationbasis` ( `modifieddate` datetime DEFAULT NULL, `isactive` tinyint(1) DEFAULT '1', PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*Data for the table `main_remunerationbasis` */ @@ -3134,7 +3134,7 @@ CREATE TABLE `main_request_history` ( `isactive` tinyint(1) unsigned DEFAULT '1' COMMENT '1=active,0=inactive', `comments` varchar(300) DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=DYNAMIC COMMENT='for request history'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=DYNAMIC COMMENT='for request history'; /*Data for the table `main_request_history` */ @@ -3267,7 +3267,7 @@ CREATE TABLE `main_roles` ( `isactive` tinyint(1) unsigned DEFAULT '1' COMMENT '1=active,0=inactive', PRIMARY KEY (`id`), KEY `NewIndex1` (`group_id`) -) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=latin1; +) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8; /*Data for the table `main_roles` */ @@ -3377,7 +3377,7 @@ CREATE TABLE `main_sd_requests` ( `createddate` datetime DEFAULT NULL, `modifieddate` datetime DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*Data for the table `main_sd_requests` */ @@ -3429,7 +3429,7 @@ CREATE TABLE `main_sd_requests_summary` ( `createddate` datetime DEFAULT NULL, `modifieddate` datetime DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*Data for the table `main_sd_requests_summary` */ @@ -3491,7 +3491,7 @@ CREATE TABLE `main_states` ( `isactive` tinyint(1) unsigned DEFAULT '1', PRIMARY KEY (`id`), UNIQUE KEY `NewIndex1` (`countryid`,`state_id_org`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*Data for the table `main_states` */ @@ -3512,7 +3512,7 @@ CREATE TABLE `main_timeformat` ( `modifieddate` datetime DEFAULT NULL, `isactive` tinyint(1) unsigned DEFAULT '1', PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=latin1; +) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8; /*Data for the table `main_timeformat` */ @@ -3535,7 +3535,7 @@ CREATE TABLE `main_timezone` ( `modifieddate` datetime DEFAULT NULL, `isactive` tinyint(1) unsigned DEFAULT '1', PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*Data for the table `main_timezone` */ @@ -3600,7 +3600,7 @@ CREATE TABLE `main_users` ( KEY `IDX_4632B9B67F771501` (`emprole`), KEY `IDX_4632B9B6647385F4` (`rccandidatename`), KEY `IDX_4632B9B662E3F462` (`candidatereferredby`) -) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1; +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; /*Data for the table `main_users` */ @@ -3620,7 +3620,7 @@ CREATE TABLE `main_veteranstatus` ( `modifieddate` datetime DEFAULT NULL, `isactive` tinyint(1) unsigned DEFAULT '1', PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*Data for the table `main_veteranstatus` */ @@ -3640,7 +3640,7 @@ CREATE TABLE `main_weekdays` ( `modifieddate` datetime DEFAULT NULL, `isactive` tinyint(1) unsigned DEFAULT '1', PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=latin1; +) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8; /*Data for the table `main_weekdays` */ @@ -3667,7 +3667,7 @@ CREATE TABLE `main_wizard` ( `modifieddate` datetime DEFAULT NULL, `isactive` tinyint(1) DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1; +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; /*Data for the table `main_wizard` */ @@ -3688,7 +3688,7 @@ CREATE TABLE `main_workeligibilitydoctypes` ( `modifieddate` datetime DEFAULT NULL, `isactive` tinyint(1) unsigned DEFAULT '1', PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*Data for the table `main_workeligibilitydoctypes` */ @@ -3832,7 +3832,7 @@ DROP TABLE IF EXISTS `tbl_timezones`; CREATE TABLE `tbl_timezones` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, - `timezone` varchar(200) CHARACTER SET latin1 NOT NULL, + `timezone` varchar(200) CHARACTER SET utf8 NOT NULL, `timezone_abbr` varchar(10) DEFAULT NULL, `offset_value` varchar(100) NOT NULL, `isactive` tinyint(1) DEFAULT '1', diff --git a/sql/queries.sql b/sql/queries.sql index 8a7e71883..435ef79cd 100644 --- a/sql/queries.sql +++ b/sql/queries.sql @@ -302,7 +302,7 @@ CREATE TABLE `main_disciplinary_violation_types` ( `modifieddate` datetime DEFAULT NULL, `isactive` tinyint(1) unsigned DEFAULT '1', PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1; +) ENGINE=MyISAM DEFAULT CHARSET=utf8; CREATE TABLE `main_disciplinary_incident` ( @@ -331,7 +331,7 @@ CREATE TABLE `main_disciplinary_incident` ( `modifieddate` datetime DEFAULT NULL, `isactive` tinyint(1) DEFAULT '1', PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1; +) ENGINE=MyISAM DEFAULT CHARSET=utf8; CREATE TABLE `main_disciplinary_history` ( @@ -342,7 +342,7 @@ CREATE TABLE `main_disciplinary_history` ( `createdby` bigint(20) unsigned DEFAULT NULL, `createddate` datetime DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; DELIMITER $$ diff --git a/sql/queries.txt b/sql/queries.txt index d73fc48e3..c304b54ac 100644 --- a/sql/queries.txt +++ b/sql/queries.txt @@ -13,6 +13,6 @@ `modifieddate` datetime DEFAULT NULL, `isactive` tinyint(1) DEFAULT NULL, PRIMARY KEY (`id`) - ) ENGINE=InnoDB DEFAULT CHARSET=latin1; + ) ENGINE=InnoDB DEFAULT CHARSET=utf8; INSERT INTO `main_wizard` (`id`, `manage_modules`, `site_config`, `org_details`, `country`, `state`, `city`, `iscomplete`, `createdby`, `modifiedby`, `createddate`, `modifieddate`, `isactive`) VALUES (NULL, '1', '1', '1', NULL, NULL, NULL, '1', NULL, NULL, NULL, NULL, NULL); \ No newline at end of file From 4246d1e700bb249bcf82fecfe68f2cf2e8899d2a Mon Sep 17 00:00:00 2001 From: Mate Remias Date: Thu, 9 Feb 2017 16:37:21 +0100 Subject: [PATCH 3/3] allow utf8 city and state names --- application/modules/default/forms/cities.php | 2 +- application/modules/default/forms/states.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/application/modules/default/forms/cities.php b/application/modules/default/forms/cities.php index 5abc8639f..ecb93e5d5 100644 --- a/application/modules/default/forms/cities.php +++ b/application/modules/default/forms/cities.php @@ -71,7 +71,7 @@ public function init() 'validator' => 'Regex', 'breakChainOnFailure' => true, 'options' => array( - 'pattern' =>'/^[^ ][a-zA-Z\s]*$/i', + 'pattern' =>'/^[\p{L}- ]*$/u', 'messages' => array( 'regexNotMatch'=>'Please enter valid city name.' ) diff --git a/application/modules/default/forms/states.php b/application/modules/default/forms/states.php index 8284f6e64..abffb5fdc 100644 --- a/application/modules/default/forms/states.php +++ b/application/modules/default/forms/states.php @@ -59,7 +59,7 @@ public function init() 'validator' => 'Regex', 'breakChainOnFailure' => true, 'options' => array( - 'pattern' =>'/^[^ ][a-zA-Z\s]*$/i', + 'pattern' =>'/^[\p{L}- ]*$/u', 'messages' => array( 'regexNotMatch'=>'Please enter valid state name.' )