BUG-13324 SOLVED Al actualizar la versión de ProcessMaker v2.0.45 a ProcessMaker v2.5.1, la visualización del nombre de usuario no refleja la configuración de la sección 'ADMIN / Environment'

This commit is contained in:
Roly Gutierrez
2013-11-15 15:35:26 -04:00
parent 6521c0dadb
commit 7517c2a176
2 changed files with 16 additions and 23 deletions

View File

@@ -315,26 +315,16 @@ class Configurations // extends Configuration
}
}
public function userNameFormat($username, $fullname)
public function userNameFormat($username, $fullname, $usrUid = '')
{
try {
if (!isset($this->UserConfig)) {
$this->UserConfig = $this->getConfiguration('ENVIRONMENT_SETTINGS', '');
}
if (isset($this->UserConfig['format'])) {
$name = explode(' ',$fullname);
$aux = '';
$aux = str_replace('@userName', trim($username), $this->UserConfig['format']);
$aux = str_replace('@firstName', isset($name[0])?$name[0]:'', $aux);
$aux = str_replace('@lastName', isset($name[1])?$name[1]:'', $aux);
return $aux;
} else {
return $username;
}
} catch (Exception $oError) {
return null;
$aux = '';
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);
}
return $aux;
}
public function usersNameFormatBySetParameters($formatUserName, $userName, $firstName, $lastName)
@@ -548,7 +538,8 @@ class Configurations // extends Configuration
public function getSystemDate($dateTime)
{
$oConf = new Configurations();
$dateFormat = 'M d, Y';
$oConf->getFormats();
$dateFormat = $oConf->UserConfig['dateFormat'];
$oConf->loadConfig($obj, 'ENVIRONMENT_SETTINGS', '');
$creationDateMask = isset($oConf->aConfig['dateFormat']) ? $oConf->aConfig['dateFormat'] : '';
$creationDateMask = ($creationDateMask == '') ? $dateFormat : $creationDateMask;

View File

@@ -420,12 +420,13 @@ class SkinEngine
G::LoadClass( "configuration" );
$conf = new Configurations();
if (defined('SYS_SYS') && $conf->exists("ENVIRONMENT_SETTINGS")) {
$conf->getFormats();
if (defined('SYS_SYS')) {
$smarty->assign('udate', $conf->getSystemDate(date('Y-m-d H:i:s')));
} else {
$smarty->assign('udate', G::getformatedDate(date('Y-m-d'), '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'): '');
$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'] : '');
$smarty->assign('user',$name);
}
@@ -725,12 +726,13 @@ class SkinEngine
G::LoadClass( "configuration" );
$conf = new Configurations();
if ( defined('SYS_SYS') && $conf->exists("ENVIRONMENT_SETTINGS")) {
$conf->getFormats();
if ( defined('SYS_SYS')) {
$smarty->assign('udate', $conf->getSystemDate(date('Y-m-d H:i:s')));
} else {
$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'): '');
$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'] : '');
$smarty->assign('user',$name);
}
if(class_exists('pmLicenseManager')){