Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

utf8 compatibility #100

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Zend/View/Helper/Grid.php
Original file line number Diff line number Diff line change
Expand Up @@ -811,10 +811,10 @@ public function generateGrid ($name, $fields = null,$paginator=null,$extracolumn
}
break;
default:
$output .= "<span ".$dataclass." title='".trim($p[$k])."' >".htmlentities($valToInclude, ENT_QUOTES, "ISO-8859-1")."</span>";
$output .= "<span ".$dataclass." title='".trim($p[$k])."' >".htmlentities($valToInclude, ENT_QUOTES, "UTF-8")."</span>";
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")
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions Zend/View/Helper/Gridtm.php
Original file line number Diff line number Diff line change
Expand Up @@ -796,10 +796,10 @@ public function generateGridTm ($name, $fields = null,$paginator=null,$extracolu
}
break;
default:
$output .= "<span ".$dataclass." title='".trim($p[$k])."' >".htmlentities($valToInclude, ENT_QUOTES, "ISO-8859-1")."</span>";
$output .= "<span ".$dataclass." title='".trim($p[$k])."' >".htmlentities($valToInclude, ENT_QUOTES, "UTF-8")."</span>";
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')
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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']));
Expand Down
4 changes: 2 additions & 2 deletions application/modules/default/forms/Myteamemployee.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.'
)
Expand All @@ -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.'
)
Expand Down
2 changes: 1 addition & 1 deletion application/modules/default/forms/cities.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.'
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.'
)
Expand Down
8 changes: 4 additions & 4 deletions application/modules/default/forms/employee.php
Original file line number Diff line number Diff line change
Expand Up @@ -328,31 +328,31 @@ public function init()
}
}
/*$userfullname->addValidator("regex",true,array(
'pattern'=>'/^([a-zA-Z.]+ ?)+$/',
'pattern'=>'/^[\p{L}- ]*$/u',
'messages'=>array(

'regexNotMatch'=>'Please enter only alphabets.'
)
));*/

$first_name->addValidator("regex",true,array(
'pattern'=>'/^([a-zA-Z.]+ ?)+$/',
'pattern'=>'/^[\p{L}- ]*$/u',
'messages'=>array(

'regexNotMatch'=>'Please enter only alphabets.'
)
));

$last_name->addValidator("regex",true,array(
'pattern'=>'/^([a-zA-Z.]+ ?)+$/',
'pattern'=>'/^[\p{L}- ]*$/u',
'messages'=>array(

'regexNotMatch'=>'Please enter only alphabets.'
)
));

$other_modeofentry->addValidator("regex",true,array(
'pattern'=>'/^([a-zA-Z.]+ ?)+$/',
'pattern'=>'/^[\p{L}- ]*$/u',
'messages'=>array(

'regexNotMatch'=>'Please enter only alphabets.'
Expand Down
2 changes: 1 addition & 1 deletion application/modules/default/forms/states.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.'
)
Expand Down
6 changes: 3 additions & 3 deletions application/modules/default/forms/viewprofile.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.'
Expand All @@ -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.'
Expand All @@ -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.'
Expand Down
4 changes: 2 additions & 2 deletions application/modules/default/library/sapp/Helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 8 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
web:
image: tutum/lamp
ports:
- "80:80"
- "443:443"
- "3306:3306"
volumes:
- .:/app
Loading