diff --git a/gulliver/system/class.g.php b/gulliver/system/class.g.php index 8e1a18cea..6eb6fff6d 100755 --- a/gulliver/system/class.g.php +++ b/gulliver/system/class.g.php @@ -1676,6 +1676,11 @@ $output = $outputHeader.$output; $format = str_replace('dd', '{DAY}', $format); $format = str_replace('d', '{day}', $format); + $format = str_replace('h', '{h}', $format); + $format = str_replace('i', '{i}', $format); + $format = str_replace('s', '{s}', $format); + + if ($lang==='') $lang=defined(SYS_LANG)?SYS_LANG:'en'; $aux = explode (' ', $date); //para dividir la fecha del dia @@ -1686,9 +1691,9 @@ $output = $outputHeader.$output; $month = (int)((isset($date[1]))?$date[1]:'0'); //month $day = (int)((isset($date[2]))?$date[2]:'0'); //day - $time[0] = (int)((isset($time[0]))?$time[0]:'0'); //hour - $time[1] = (int)((isset($time[1]))?$time[1]:'0'); //minute - $time[2] = (int)((isset($time[2]))?$time[2]:'0'); //second + $h = isset($time[0])? $time[0]: '00'; //hour + $i = isset($time[1])? $time[1]: '00'; //minute + $s = isset($time[2])? $time[2]: '00'; //second $MONTHS = Array(); for($i=1; $i<=12; $i++){ @@ -1707,8 +1712,8 @@ $output = $outputHeader.$output; $yy = substr($year,strlen($year)-2,2); $yyyy = $year; - $names = array('{day}', '{DAY}', '{month}', '{YONTH}', '{XONTH}', '{year}', '{YEAR}'); - $values = array($d, $dd, $m, $mm, $M, $yy, $yyyy); + $names = array('{day}', '{DAY}', '{month}', '{YONTH}', '{XONTH}', '{year}', '{YEAR}', '{h}', '{i}', '{s}'); + $values = array($d, $dd, $m, $mm, $M, $yy, $yyyy, $h, $i, $s); $ret = str_replace( $names, $values, $format ); diff --git a/workflow/engine/classes/model/UsersProperties.php b/workflow/engine/classes/model/UsersProperties.php index fb35d3dd1..97741f40a 100755 --- a/workflow/engine/classes/model/UsersProperties.php +++ b/workflow/engine/classes/model/UsersProperties.php @@ -16,8 +16,10 @@ require_once 'classes/model/om/BaseUsersProperties.php'; /** * @package workflow.engine.classes.model */ -class UsersProperties extends BaseUsersProperties { - function UserPropertyExists($sUserUID) { +class UsersProperties extends BaseUsersProperties +{ + function UserPropertyExists($sUserUID) + { try { $oUserProperty = UsersPropertiesPeer::retrieveByPk($sUserUID); if (is_object($oUserProperty) && get_class($oUserProperty) == 'UsersProperties') { @@ -32,7 +34,8 @@ class UsersProperties extends BaseUsersProperties { } } - public function load($sUserUID) { + public function load($sUserUID) + { try { $oUserProperty = UsersPropertiesPeer::retrieveByPK($sUserUID); if (!is_null($oUserProperty)) { @@ -49,7 +52,8 @@ class UsersProperties extends BaseUsersProperties { } } - public function create($aData) { + public function create($aData) + { $oConnection = Propel::getConnection(UsersPropertiesPeer::DATABASE_NAME); try { $oUserProperty = new UsersProperties(); @@ -75,7 +79,8 @@ class UsersProperties extends BaseUsersProperties { } } - public function update($aData) { + public function update($aData) + { $oConnection = Propel::getConnection(UsersPropertiesPeer::DATABASE_NAME); try { $oUserProperty = UsersPropertiesPeer::retrieveByPK($aData['USR_UID']); @@ -106,7 +111,8 @@ class UsersProperties extends BaseUsersProperties { } } - public function loadOrCreateIfNotExists($sUserUID, $aUserProperty = array()) { + public function loadOrCreateIfNotExists($sUserUID, $aUserProperty = array()) + { if (!$this->UserPropertyExists($sUserUID)) { $aUserProperty['USR_UID'] = $sUserUID; if (!isset($aUserProperty['USR_LAST_UPDATE_DATE'])) { @@ -123,7 +129,8 @@ class UsersProperties extends BaseUsersProperties { return $aUserProperty; } - public function validatePassword($sPassword, $sLastUpdate, $iChangePasswordNextTime) { + public function validatePassword($sPassword, $sLastUpdate, $iChangePasswordNextTime) + { if (!defined('PPP_MINIMUM_LENGTH')) { define('PPP_MINIMUM_LENGTH', 5); } @@ -219,6 +226,7 @@ class UsersProperties extends BaseUsersProperties { require_once 'classes/model/Users.php'; $u = UsersPeer::retrieveByPK($sUserUID); $uxType = $u->getUsrUx(); + $_SESSION['user_experience'] = 'NORMAL'; // find a group setting if ($uxType == '' || $uxType == 'NORMAL') { @@ -236,21 +244,21 @@ class UsersProperties extends BaseUsersProperties { switch ($uxType) { case 'SIMPLIFIED': + case 'SWITCHABLE': + $_SESSION['user_experience'] = $uxType; return '/sys' . SYS_SYS . '/' . $sLanguage . '/' . SYS_SKIN . '/' . 'home'; break; } + // end user experience redirection - - - #New feature by Erik erik@colosa.com> - #get user preferences for default redirect - #verifying if it has any preferences on the configurations table + // get user preferences for default redirect + // verifying if it has any preferences on configurations table G::loadClass('configuration'); $oConf = new Configurations; $oConf->loadConfig($x, 'USER_PREFERENCES','','',$_SESSION['USER_LOGGED'],''); - if( sizeof($oConf->aConfig) > 0) { #this user has a configuration record - - //these is for backward compatibility, because now, we dont have user and dashboard menu. + + if( sizeof($oConf->aConfig) > 0) { // this user has a configuration record + // backward compatibility, because now, we don't have user and dashboard menu. if ( $oConf->aConfig['DEFAULT_MENU'] == 'PM_USERS') $oConf->aConfig['DEFAULT_MENU'] = 'PM_SETUP'; if ( $oConf->aConfig['DEFAULT_MENU'] == 'PM_DASHBOARD') $oConf->aConfig['DEFAULT_MENU'] = 'PM_SETUP'; diff --git a/workflow/engine/controllers/admin.php b/workflow/engine/controllers/admin.php index 4b0c9d564..6ff26e231 100644 --- a/workflow/engine/controllers/admin.php +++ b/workflow/engine/controllers/admin.php @@ -11,18 +11,17 @@ class Admin extends Controller public function uxList() { + require_once PATH_CONTROLLERS . 'adminProxy.php'; $this->includeExtJS('admin/uxUsersList'); - //$this->setView('admin/calendarEdit'); - - //$this->setJSVar('fields',$fields);รง G::LoadClass('configuration'); + $c = new Configurations(); $configPage = $c->getConfiguration('usersList', 'pageSize','',$_SESSION['USER_LOGGED']); $Config['pageSize'] = isset($configPage['pageSize']) ? $configPage['pageSize'] : 20; - $this->setJSVar('CONFIG', $Config); - $this->setJSVar('FORMATS',$c->getFormats()); - + $this->setJSVar('CONFIG', $Config); + $this->setJSVar('FORMATS', $c->getFormats()); + $this->setJSVar('uxTypes', AdminProxy::getUxTypesList('list')); G::RenderPage('publish', 'extJs'); } diff --git a/workflow/engine/controllers/adminProxy.php b/workflow/engine/controllers/adminProxy.php index b62f5cd89..cd05c8663 100644 --- a/workflow/engine/controllers/adminProxy.php +++ b/workflow/engine/controllers/adminProxy.php @@ -61,12 +61,26 @@ class adminProxy extends HttpProxyController return array('success' => true, 'message'=>'done', 'groups'=>$row); } - function getUxTypesList() + function getUxTypesList($type = 'assoc') { - return Array( - 'NORMAL' => 'Normal', - 'SIMPLIFIED' => 'Simplified' - ); + $list = array(); + + if ($type == 'assoc') { + $list = array( + 'NORMAL' => 'Normal', + 'SIMPLIFIED' => 'Simplified', + 'SWITCHABLE' => 'Switchable' + ); + } + else { + $list = array( + array('NORMAL', 'Normal'), + array('SIMPLIFIED', 'Simplified'), + array('SWITCHABLE', 'Switchable') + ); + } + + return $list; } function calendarSave() diff --git a/workflow/engine/controllers/home.php b/workflow/engine/controllers/home.php index 8b3e9cfee..b56b77c9d 100644 --- a/workflow/engine/controllers/home.php +++ b/workflow/engine/controllers/home.php @@ -13,17 +13,23 @@ class Home extends Controller private $userName; private $userFullName; private $userRolName; + private $userUxType; public function __construct() { - $_SESSION['user_experience'] = 'simplified'; - + // setting as using simplified. + $_SESSION['current_ux'] = 'SIMPLIFIED'; + + // getting the ux type from user o group conf. + $this->userUxType = isset($_SESSION['user_experience'])? $_SESSION['user_experience']: $_SESSION['current_ux']; + if (isset($_SESSION['USER_LOGGED']) && !empty($_SESSION['USER_LOGGED'])) { $this->userID = isset($_SESSION['USER_LOGGED']) ? $_SESSION['USER_LOGGED'] : null; $this->userName = isset($_SESSION['USR_USERNAME']) ? $_SESSION['USR_USERNAME'] : ''; $this->userFullName = isset($_SESSION['USR_FULLNAME']) ? $_SESSION['USR_FULLNAME'] : ''; $this->userRolName = isset($_SESSION['USR_ROLENAME']) ? $_SESSION['USR_ROLENAME'] : ''; } + //g::pr($_SESSION); die; } /** @@ -52,6 +58,7 @@ class Home extends Controller $this->setVar('userName', $this->userName); $this->setVar('processList', $processList); $this->setVar('canStartCase', $case->canStartCase($_SESSION ['USER_LOGGED'])); + $this->setVar('userUxType', $this->userUxType); G::RenderPage('publish', 'mvc'); } diff --git a/workflow/engine/menus/setup.php b/workflow/engine/menus/setup.php index 6527853a5..9286dd9fe 100755 --- a/workflow/engine/menus/setup.php +++ b/workflow/engine/menus/setup.php @@ -77,7 +77,7 @@ if ($RBAC->userCanAccess('PM_SETUP') == 1 || $RBAC->userCanAccess('PM_USERS') == if ($RBAC->userCanAccess('PM_SETUP_ADVANCE') == 1) { $G_TMP_MENU->AddIdRawOption('AUTHSOURCES', '../authSources/authSources_List', G::LoadTranslation('ID_AUTH_SOURCES'), '', '', 'users'); - $G_TMP_MENU->AddIdRawOption('UX', '../admin/uxList', 'User experience (UX)', '', '', 'users'); + $G_TMP_MENU->AddIdRawOption('UX', '../admin/uxList', G::LoadTranslation('ID_USER_EXPERIENCE'), '', '', 'users'); } diff --git a/workflow/engine/methods/cases/cases_Derivate.php b/workflow/engine/methods/cases/cases_Derivate.php index 42ba41131..599f4bfaa 100755 --- a/workflow/engine/methods/cases/cases_Derivate.php +++ b/workflow/engine/methods/cases/cases_Derivate.php @@ -146,7 +146,7 @@ try { //Events - End $debuggerAvailable = true; - if (isset($_SESSION['user_experience']) && $_SESSION['user_experience'] == 'simplified') { + if (isset($_SESSION['current_ux']) && $_SESSION['current_ux'] == 'SIMPLIFIED') { $aNextStep['PAGE'] = '../home/appList'; $debuggerAvailable = false; } diff --git a/workflow/engine/methods/cases/cases_SaveData.php b/workflow/engine/methods/cases/cases_SaveData.php index f245a10f7..30e32dbc6 100755 --- a/workflow/engine/methods/cases/cases_SaveData.php +++ b/workflow/engine/methods/cases/cases_SaveData.php @@ -239,7 +239,7 @@ try { $_SESSION['BREAKSTEP']['NEXT_STEP'] = $aNextStep ['PAGE']; $debuggerAvailable = true; - if (isset($_SESSION['user_experience']) && $_SESSION['user_experience'] == 'simplified') { + if (isset($_SESSION['current_ux']) && $_SESSION['current_ux'] == 'SIMPLIFIED') { $debuggerAvailable = false; } diff --git a/workflow/engine/methods/cases/main_init.php b/workflow/engine/methods/cases/main_init.php index e8890df0c..0b56964bf 100755 --- a/workflow/engine/methods/cases/main_init.php +++ b/workflow/engine/methods/cases/main_init.php @@ -53,7 +53,7 @@ $oHeadPublisher->assign( 'defaultOption', $defaultOption); // user menu permissions $oHeadPublisher->assign( '_nodeId', isset($confDefaultOption)?$confDefaultOption:'PM_USERS'); // user menu permissions - $_SESSION['user_experience'] = 'normal'; + $_SESSION['current_ux'] = 'NORMAL'; G::RenderPage('publish', 'extJs'); \ No newline at end of file diff --git a/workflow/engine/skinEngine/base/layout.html b/workflow/engine/skinEngine/base/layout.html index c4f8432f4..e66d2e3df 100644 --- a/workflow/engine/skinEngine/base/layout.html +++ b/workflow/engine/skinEngine/base/layout.html @@ -16,12 +16,15 @@