PM-2104 Se visualiza una "," en el Loguot ,Administrador en el nuevo instalador de PM3-RC3

This commit is contained in:
dheeyi
2015-04-14 15:10:41 -04:00
parent a2560de0b1
commit 8ae1404851
2 changed files with 19 additions and 13 deletions

View File

@@ -320,8 +320,24 @@ class Configurations // extends Configuration
if ($usrUid != '') {
$oUser = UsersPeer::retrieveByPK($usrUid);
$aux = str_replace('@userName', trim($username), $this->UserConfig['format']);
$aux = str_replace('@firstName', $oUser->getUsrFirstname(), $aux);
$aux = str_replace('@lastName', $oUser->getUsrLastname(), $aux);
if(($aux === "@lastName @firstName" || $aux === "@lastName, @firstName") && strlen($oUser->getUsrFirstname())==0 && strlen($oUser->getUsrLastname())==0){
return $oUser->getUsrUsername();
}
if (strlen($oUser->getUsrFirstname())!=0) {
$aux = str_replace('@firstName', $oUser->getUsrFirstname(), $aux);
}else{
$aux = str_replace('@firstName', "", $aux);
}
if (strlen($oUser->getUsrLastname())!=0) {
$aux = str_replace('@lastName', $oUser->getUsrLastname(), $aux);
}else{
$aux = str_replace('@lastName', "", $aux);
}
if (strlen(strstr($aux, ","))>0 && (strlen($oUser->getUsrFirstname())==0 || strlen($oUser->getUsrLastname())==0)) {
$aux = substr ($aux, ((strpos ($aux, ","))+1));
}
}
return $aux;
}

View File

@@ -753,16 +753,6 @@ class SkinEngine
$smarty->assign('udate', G::getformatedDate(date('Y-m-d H:i:s'), 'M d, yyyy', SYS_LANG));
}
$name = $conf->userNameFormat(isset($_SESSION['USR_USERNAME']) ? $_SESSION['USR_USERNAME']: '', isset($_SESSION['USR_FULLNAME']) ? htmlentities($_SESSION['USR_FULLNAME'] , ENT_QUOTES, 'UTF-8'): '', isset($_SESSION['USER_LOGGED']) ? $_SESSION['USER_LOGGED'] : '');
$countSpacesOfName = substr_count($name, ' ');
$letter=",";
$searchLetter = strstr($name, $letter);
if ($countSpacesOfName>1 && strlen($searchLetter)>0) {
if ($name[0]==" ") {
$positionLetter = strpos ($name, $letter);
$removeLetter = substr ($name, ($positionLetter+1));
$name = $removeLetter;
}
}
$smarty->assign('user',$name);
}