BUG 5488 "case inbox refresh time should be configurable..." SOLVED

- New feature
- Case inbox refresh time should be configurable
- Added new feature
* Available from version 2.0.45
This commit is contained in:
Victor Saisa Lopez
2012-09-26 16:28:33 -04:00
parent ea6f57fc3c
commit d3ae88672f
5 changed files with 386 additions and 321 deletions

View File

@@ -2,10 +2,10 @@
/** /**
* class.configuration.php * class.configuration.php
* @package workflow.engine.ProcessMaker * @package workflow.engine.ProcessMaker
* *
* ProcessMaker Open Source Edition * ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2011 Colosa Inc. * Copyright (C) 2004 - 2011 Colosa Inc.
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as * it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the * published by the Free Software Foundation, either version 3 of the
@@ -15,13 +15,13 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * Coral Gables, FL, 33134, USA, or email info@colosa.com.
* *
*/ */
// //
// It works with the table CONFIGURATION in a WF dataBase // It works with the table CONFIGURATION in a WF dataBase
@@ -47,29 +47,29 @@ require_once 'classes/model/Configuration.php';
* @copyright 2007 COLOSA * @copyright 2007 COLOSA
* @version Release: @package_version@ * @version Release: @package_version@
* @package workflow.engine.ProcessMaker * @package workflow.engine.ProcessMaker
*/ */
class Configurations // extends Configuration class Configurations // extends Configuration
{ {
var $aConfig = array(); var $aConfig = array();
private $Configuration = null; private $Configuration = null;
private $UserConfig = null; private $UserConfig = null;
/** /**
* Set Configurations * Set Configurations
* @return void * @return void
*/ */
function Configurations() function Configurations()
{ {
$this->Configuration = new Configuration(); $this->Configuration = new Configuration();
} }
/** /**
* arrayClone * arrayClone
* *
* @param array &$object Source array * @param array &$object Source array
* @param array &$cloneObject Array duplicate * @param array &$cloneObject Array duplicate
* @return void * @return void
*/ */
function arrayClone( &$object, &$cloneObject ) function arrayClone( &$object, &$cloneObject )
{ {
if (is_array($object)) { if (is_array($object)) {
@@ -84,56 +84,56 @@ class Configurations // extends Configuration
} }
} }
} }
/** /**
* configObject * configObject
* *
* @param object &$object * @param object &$object
* @param array &$from * @param array &$from
* @return void * @return void
*/ */
function configObject( &$object, &$from ) function configObject( &$object, &$from )
{ {
if (!(is_object($object) || is_array($object))) if (!(is_object($object) || is_array($object)))
return; return;
if (!isset($from)) if (!isset($from))
$from = &$this->aConfig; $from = &$this->aConfig;
foreach($from as $k => $v ) { foreach($from as $k => $v ) {
if (isset($v) && array_key_exists($k,$object)) { if (isset($v) && array_key_exists($k,$object)) {
if (is_object($v)) if (is_object($v))
throw new Exception( 'Object is not permited inside configuration array.' ); throw new Exception( 'Object is not permited inside configuration array.' );
if (is_object($object)) { if (is_object($object)) {
if (is_array($v)) if (is_array($v))
$this->configObject($object->{$k}, $v); $this->configObject($object->{$k}, $v);
else else
$object->{$k} = $v; $object->{$k} = $v;
} }
else { else {
if (is_array($object)) { if (is_array($object)) {
if (is_array($v)) if (is_array($v))
$this->configObject($object[$k], $v); $this->configObject($object[$k], $v);
else else
$object[$k] = $v; $object[$k] = $v;
} }
} }
} }
} }
} }
/** /**
* loadConfig * loadConfig
* *
* @param object &$object * @param object &$object
* @param string $cfg * @param string $cfg
* @param object $obj * @param object $obj
* @param string $pro * @param string $pro
* @param string $usr * @param string $usr
* @param string $app * @param string $app
* @return void * @return void
*/ */
function loadConfig(&$object, $cfg, $obj='', $pro = '', $usr = '', $app = '') function loadConfig(&$object, $cfg, $obj='', $pro = '', $usr = '', $app = '')
{ {
$this->load($cfg, $obj, $pro, $usr, $app); $this->load($cfg, $obj, $pro, $usr, $app);
@@ -143,13 +143,13 @@ class Configurations // extends Configuration
/** /**
* loadConf * loadConf
* *
* @param string $cfg * @param string $cfg
* @param object $obj * @param object $obj
* @param string $pro * @param string $pro
* @param string $usr * @param string $usr
* @param string $app * @param string $app
* @return void * @return void
*/ */
function load($cfg, $obj='', $pro = '', $usr = '', $app = '') function load($cfg, $obj='', $pro = '', $usr = '', $app = '')
{ {
$this->Fields = array(); $this->Fields = array();
@@ -158,23 +158,23 @@ class Configurations // extends Configuration
$this->Fields = $this->Configuration->load($cfg, $obj, $pro, $usr, $app); $this->Fields = $this->Configuration->load($cfg, $obj, $pro, $usr, $app);
} }
catch(Exception $e) {} // the configuration does not exist catch(Exception $e) {} // the configuration does not exist
if (isset($this->Fields['CFG_VALUE'])) if (isset($this->Fields['CFG_VALUE']))
$this->aConfig = unserialize($this->Fields['CFG_VALUE']); $this->aConfig = unserialize($this->Fields['CFG_VALUE']);
if (!is_array($this->aConfig)) if (!is_array($this->aConfig))
$this->aConfig = Array(); $this->aConfig = Array();
return $this->aConfig; return $this->aConfig;
} }
/** /**
* saveConfig * saveConfig
* *
* @param object &$object * @param object &$object
* @param array &$from * @param array &$from
* @return void * @return void
*/ */
function saveConfig($cfg,$obj,$pro='',$usr='',$app='') function saveConfig($cfg,$obj,$pro='',$usr='',$app='')
{ {
$aFields = array( $aFields = array(
@@ -192,14 +192,14 @@ class Configurations // extends Configuration
$this->Configuration->update($aFields); $this->Configuration->update($aFields);
} }
} }
/** /**
* saveObject * saveObject
* *
* @param object &$object * @param object &$object
* @param array &$from * @param array &$from
* @return void * @return void
*/ */
function saveObject(&$object,$cfg,$obj,$pro='',$usr='',$app='') function saveObject(&$object,$cfg,$obj,$pro='',$usr='',$app='')
{ {
$aFields = array( $aFields = array(
@@ -222,13 +222,13 @@ class Configurations // extends Configuration
* loadObject * loadObject
* this function is deprecated, we dont know why return an object, use the function getConfiguration below * this function is deprecated, we dont know why return an object, use the function getConfiguration below
* *
* @param string $cfg * @param string $cfg
* @param object $obj * @param object $obj
* @param string $pro * @param string $pro
* @param string $usr * @param string $usr
* @param string $app * @param string $app
* @return void * @return void
*/ */
function loadObject($cfg, $obj, $pro = '', $usr = '', $app = '') function loadObject($cfg, $obj, $pro = '', $usr = '', $app = '')
{ {
$objectContainer=array((object) array()); $objectContainer=array((object) array());
@@ -236,26 +236,26 @@ class Configurations // extends Configuration
if ($this->Configuration->exists( $cfg, $obj, $pro, $usr, $app )) if ($this->Configuration->exists( $cfg, $obj, $pro, $usr, $app ))
$this->Fields = $this->Configuration->load( $cfg, $obj, $pro, $usr, $app ); $this->Fields = $this->Configuration->load( $cfg, $obj, $pro, $usr, $app );
else else
return $objectContainer[0]; return $objectContainer[0];
if (isset($this->Fields['CFG_VALUE'])) if (isset($this->Fields['CFG_VALUE']))
$objectContainer = unserialize($this->Fields['CFG_VALUE']); $objectContainer = unserialize($this->Fields['CFG_VALUE']);
if (!is_array($objectContainer)||sizeof($objectContainer)!=1) if (!is_array($objectContainer)||sizeof($objectContainer)!=1)
return (object) array(); return (object) array();
else else
return $objectContainer[0]; return $objectContainer[0];
} }
/** /**
* getConfiguration * getConfiguration
* *
* @param string $cfg * @param string $cfg
* @param object $obj * @param object $obj
* @param string $pro * @param string $pro
* @param string $usr * @param string $usr
* @param string $app * @param string $app
* @return void * @return void
*/ */
function getConfiguration($cfg, $obj, $pro = '', $usr = '', $app = '') function getConfiguration($cfg, $obj, $pro = '', $usr = '', $app = '')
{ {
try { try {
@@ -266,7 +266,7 @@ class Configurations // extends Configuration
if ( is_array($result) && sizeof($result)==1 ) { if ( is_array($result) && sizeof($result)==1 ) {
$arrayKeys = Array_keys( $result ); $arrayKeys = Array_keys( $result );
return $result[ $arrayKeys[0]]; return $result[ $arrayKeys[0]];
} }
else { else {
return $result; return $result;
} }
@@ -279,16 +279,16 @@ class Configurations // extends Configuration
return null; return null;
} }
} }
/** /**
* usersNameFormat * usersNameFormat
* @author Enrique Ponce de Leon enrique@colosa.com * @author Enrique Ponce de Leon enrique@colosa.com
* @param string $username * @param string $username
* @param string $firstname * @param string $firstname
* @param string $lastname * @param string $lastname
* @return string User Name Well-Formatted * @return string User Name Well-Formatted
*/ */
function usersNameFormat($username, $firstname, $lastname){ function usersNameFormat($username, $firstname, $lastname){
try{ try{
if (!isset($this->UserConfig)) $this->UserConfig = $this->getConfiguration('ENVIRONMENT_SETTINGS', ''); if (!isset($this->UserConfig)) $this->UserConfig = $this->getConfiguration('ENVIRONMENT_SETTINGS', '');
@@ -297,59 +297,69 @@ class Configurations // extends Configuration
$aux = str_replace('@userName', $username, $this->UserConfig['format']); $aux = str_replace('@userName', $username, $this->UserConfig['format']);
$aux = str_replace('@firstName', $firstname, $aux); $aux = str_replace('@firstName', $firstname, $aux);
$aux = str_replace('@lastName', $lastname, $aux); $aux = str_replace('@lastName', $lastname, $aux);
return $aux; return $aux;
}else{ }else{
return $username; return $username;
} }
}catch(Exception $oError){ }catch(Exception $oError){
return null; return null;
} }
} }
/** /**
* getFormats * getFormats
* @author Enrique Ponce de Leon enrique@colosa.com * @author Enrique Ponce de Leon enrique@colosa.com
* @return FORMATS array * @return FORMATS array
*/ */
public function getFormats()
function getFormats(){ {
if (!isset($this->UserConfig)) { if (!isset($this->UserConfig)) {
$this->UserConfig = $this->getConfiguration('ENVIRONMENT_SETTINGS', ''); $this->UserConfig = $this->getConfiguration("ENVIRONMENT_SETTINGS", "");
}
//Setting defaults
if (!isset($this->UserConfig["format"])) {
$this->UserConfig["format"] = "@lastName, @firstName (@userName)";
}
if (!isset($this->UserConfig["dateFormat"])) {
$this->UserConfig["dateFormat"] = "Y-m-d H:i:s";
}
if (!isset($this->UserConfig["startCaseHideProcessInf"])) {
$this->UserConfig["startCaseHideProcessInf"] = false;
}
if (!isset($this->UserConfig["casesListDateFormat"])) {
$this->UserConfig["casesListDateFormat"] = "Y-m-d H:i:s";
}
if (!isset($this->UserConfig["casesListRowNumber"])) {
$this->UserConfig["casesListRowNumber"] = 25;
}
if (!isset($this->UserConfig["casesListRefreshTime"]) ||
(isset($this->UserConfig["casesListRefreshTime"]) && empty($this->UserConfig["casesListRefreshTime"]))
) {
$this->UserConfig["casesListRefreshTime"] = 120; //2 minutes
}
$this->UserConfig["TimeZone"] = date("T");
return $this->UserConfig;
} }
// setting defaults
if (!isset($this->UserConfig['format'])) {
$this->UserConfig['format'] = '@lastName, @firstName (@userName)';
}
if (!isset($this->UserConfig['dateFormat'])) {
$this->UserConfig['dateFormat'] = 'Y-m-d H:i:s';
}
if (!isset($this->UserConfig['casesListDateFormat'])) {
$this->UserConfig['casesListDateFormat'] = 'Y-m-d H:i:s';
}
if (!isset($this->UserConfig['casesListRowNumber'])) {
$this->UserConfig['CasesListRowNumber'] = '25';
}
if (!isset($this->UserConfig['startCaseHideProcessInf'])) {
$this->UserConfig['startCaseHideProcessInf'] = false;
}
$this->UserConfig['TimeZone'] = date('T');
return $this->UserConfig;
}
/** /**
* setConfig * setConfig
* *
* @param string $route * @param string $route
* @param object &$object * @param object &$object
* @param object &$to * @param object &$to
* @return void * @return void
*/ */
function setConfig( $route , &$object , &$to ) function setConfig( $route , &$object , &$to )
{ {
if (!isset($to)) if (!isset($to))
$to = &$this->aConfig; $to = &$this->aConfig;
$routes = explode(',',$route); $routes = explode(',',$route);
foreach($routes as $r) { foreach($routes as $r) {
@@ -373,18 +383,18 @@ class Configurations // extends Configuration
} }
} else { } else {
if (is_object($object)) { if (is_object($object)) {
if (!isset($to[$ro[0]])) if (!isset($to[$ro[0]]))
$to[$ro[0]] = array(); $to[$ro[0]] = array();
$this->setConfig(implode('/',$rou),$object->{$ro[0]},$to[$ro[0]]); $this->setConfig(implode('/',$rou),$object->{$ro[0]},$to[$ro[0]]);
} else { } else {
if (is_array($object)) { if (is_array($object)) {
if (!isset($to[$ro[0]])) if (!isset($to[$ro[0]]))
$to[$ro[0]] = array(); $to[$ro[0]] = array();
$this->setConfig(implode('/',$rou),$object[$ro[0]],$to[$ro[0]]); $this->setConfig(implode('/',$rou),$object[$ro[0]],$to[$ro[0]]);
} else { } else {
$to = $object; $to = $object;
} }
} }
} }
} else { } else {
@@ -416,7 +426,7 @@ class Configurations // extends Configuration
} }
} }
} }
function getDateFormats(){ function getDateFormats(){
$formats[] = Array( $formats[] = Array(
'id'=>'Y-m-d H:i:s', //the id , don't translate 'id'=>'Y-m-d H:i:s', //the id , don't translate
@@ -470,7 +480,7 @@ class Configurations // extends Configuration
'id'=>'d m, Y', 'id'=>'d m, Y',
'name'=>G::loadTranslation('ID_DATE_FORMAT_13')//'d m, Y' i.e:'17 11, 2010' 'name'=>G::loadTranslation('ID_DATE_FORMAT_13')//'d m, Y' i.e:'17 11, 2010'
); );
return $formats; return $formats;
} }
@@ -506,13 +516,13 @@ class Configurations // extends Configuration
return $formats; return $formats;
} }
function getSystemDate($dateTime) function getSystemDate($dateTime)
{ {
$oConf = new Configurations; $oConf = new Configurations;
$oConf->loadConfig($obj, 'ENVIRONMENT_SETTINGS',''); $oConf->loadConfig($obj, 'ENVIRONMENT_SETTINGS','');
$creationDateMask = isset($oConf->aConfig['dateFormat'])? $oConf->aConfig['dateFormat']: ''; $creationDateMask = isset($oConf->aConfig['dateFormat'])? $oConf->aConfig['dateFormat']: '';
if( $creationDateMask != '' ) { if( $creationDateMask != '' ) {
if( strpos($dateTime, ' ') !== false ) { if( strpos($dateTime, ' ') !== false ) {
list($date, $time) = explode(' ', $dateTime); list($date, $time) = explode(' ', $dateTime);
@@ -522,22 +532,22 @@ class Configurations // extends Configuration
} else { } else {
list($y, $m, $d) = explode('-', $dateTime); list($y, $m, $d) = explode('-', $dateTime);
$dateTime = date($creationDateMask, mktime(0, 0, 0, $m, $d, $y)); $dateTime = date($creationDateMask, mktime(0, 0, 0, $m, $d, $y));
} }
} }
return $dateTime; return $dateTime;
} }
function getEnvSetting($key=null, $data=null) function getEnvSetting($key=null, $data=null)
{ {
$this->loadConfig($obj, 'ENVIRONMENT_SETTINGS',''); $this->loadConfig($obj, 'ENVIRONMENT_SETTINGS','');
if( isset($key) ) { if( isset($key) ) {
if( isset($this->aConfig[$key]) ) { if( isset($this->aConfig[$key]) ) {
if( isset($data) && is_array($data) ) if( isset($data) && is_array($data) )
foreach($data as $k=>$v) foreach($data as $k=>$v)
$this->aConfig[$key] = str_replace('@'.$k, $v, $this->aConfig[$key]); $this->aConfig[$key] = str_replace('@'.$k, $v, $this->aConfig[$key]);
return $this->aConfig[$key]; return $this->aConfig[$key];
} else } else
return ''; return '';
@@ -545,4 +555,4 @@ class Configurations // extends Configuration
return $this->aConfig; return $this->aConfig;
} }
} }
?>

View File

@@ -23,53 +23,64 @@
* *
*/ */
$oHeadPublisher =& headPublisher::getSingleton(); G::LoadClass("configuration");
$oHeadPublisher->addExtJsScript('cases/main', false ); //adding a javascript file .js
$oHeadPublisher->addContent( 'cases/main'); //adding a html file .html.
$keyMem = 'USER_PREFERENCES'.$_SESSION['USER_LOGGED'];
$memcache = & PMmemcached::getSingleton(SYS_SYS);
if ( ($arrayConfig = $memcache->get($keyMem)) === false ) { $conf = new Configurations();
G::loadClass('configuration');
$oConf = new Configurations; $oHeadPublisher = &headPublisher::getSingleton();
$oConf->loadConfig($x, 'USER_PREFERENCES','','',$_SESSION['USER_LOGGED'],''); $oHeadPublisher->addExtJsScript("cases/main", false); //Adding a javascript file .js
$arrayConfig = $oConf->aConfig; $oHeadPublisher->addContent("cases/main"); //Adding a html file .html.
$memcache->set( $keyMem, $arrayConfig, PMmemcached::ONE_HOUR);
} $keyMem = "USER_PREFERENCES" . $_SESSION["USER_LOGGED"];
$memcache = &PMmemcached::getSingleton(SYS_SYS);
if (($arrayConfig = $memcache->get($keyMem)) === false) {
$conf->loadConfig($x, "USER_PREFERENCES", "", "", $_SESSION["USER_LOGGED"], "");
$arrayConfig = $conf->aConfig;
$memcache->set($keyMem, $arrayConfig, PMmemcached::ONE_HOUR);
}
$confDefaultOption = "";
if (isset($arrayConfig["DEFAULT_CASES_MENU"])) { //this user has a configuration record
$confDefaultOption = $arrayConfig["DEFAULT_CASES_MENU"];
$confDefaultOption='';
if( isset($arrayConfig['DEFAULT_CASES_MENU']) ){ #this user has a configuration record
$confDefaultOption = $arrayConfig['DEFAULT_CASES_MENU'];
global $G_TMP_MENU; global $G_TMP_MENU;
$oMenu = new Menu(); $oMenu = new Menu();
$oMenu->load('cases'); $oMenu->load("cases");
$defaultOption = ''; $defaultOption = "";
foreach($oMenu->Id as $i=>$id){
if( $id == $confDefaultOption ){ foreach ($oMenu->Id as $i => $id) {
$defaultOption = $oMenu->Options[$i]; if ($id == $confDefaultOption) {
break; $defaultOption = $oMenu->Options[$i];
} break;
}
} }
$defaultOption = $defaultOption != '' ? $defaultOption : 'casesListExtJs';
}
else {
$defaultOption = 'casesListExtJs';
$confDefaultOption = 'CASES_INBOX';
}
if (isset($_GET['id']) && isset($_GET['id'])) { $defaultOption = ($defaultOption != "")? $defaultOption : "casesListExtJs";
$defaultOption = '../cases/open?APP_UID=' . $_GET['id'] . '&DEL_INDEX=' . $_GET['i']; } else {
$defaultOption = "casesListExtJs";
$confDefaultOption = "CASES_INBOX";
}
if (isset($_GET['a'])) { if (isset($_GET["id"]) && isset($_GET["id"])) {
$defaultOption .= '&action=' . $_GET['a']; $defaultOption = "../cases/open?APP_UID=" . $_GET["id"] . "&DEL_INDEX=" . $_GET["i"];
if (isset($_GET["a"])) {
$defaultOption .= "&action=" . $_GET["a"];
} }
} }
$oHeadPublisher->assign( 'defaultOption', $defaultOption); // user menu permissions $oHeadPublisher->assign("defaultOption", $defaultOption); //User menu permissions
$oHeadPublisher->assign( '_nodeId', isset($confDefaultOption)?$confDefaultOption:'PM_USERS'); // user menu permissions $oHeadPublisher->assign("_nodeId", isset($confDefaultOption)? $confDefaultOption : "PM_USERS"); //User menu permissions
$oHeadPublisher->assign("FORMATS", $conf->getFormats());
$_SESSION["current_ux"] = "NORMAL";
G::RenderPage("publish", "extJs");
$_SESSION['current_ux'] = 'NORMAL';
G::RenderPage('publish', 'extJs');

View File

@@ -1,58 +1,62 @@
<?php <?php
/** /**
* @author Erik A.O. <erik@colosa.com> * @author Erik A.O. <erik@colosa.com>
* @date Sept 13th, 2010 * @date Sept 13th, 2010
*/ *
*/
$request = isset($_POST['request'])? $_POST['request']: (isset($_GET['request'])? $_GET['request']: null);
switch($request){
case 'getUserMaskList':
G::loadClass('configuration');
$result->rows = Configurations::getUserNameFormats();
print(G::json_encode($result));
break;
case 'getDateFormats': G::LoadClass("configuration");
G::loadClass('configuration');
$result->rows = Configurations::getDateFormats();
print(G::json_encode($result));
break;
case 'getCasesListDateFormat':
G::loadClass('configuration');
$result->rows = Configurations::getDateFormats();;
print(G::json_encode($result));
break;
case 'getCasesListRowNumber':
for($i=10; $i<=50; $i+=5){
$formats[] = Array('id'=>"$i", 'name'=>"$i");
}
$result->rows = $formats;
print(G::json_encode($result));
break;
case 'save':
G::LoadClass('configuration');
$conf = new Configurations;
$conf->aConfig = Array(
'format'=>$_POST['userFormat'],
'dateFormat'=>$_POST['dateFormat'],
'casesListDateFormat' =>$_POST['casesListDateFormat'],
'casesListRowNumber' =>$_POST['casesListRowNumber']
);
$conf->aConfig['startCaseHideProcessInf'] = isset($_POST['hideProcessInf']) ? true : false;
$conf->saveConfig('ENVIRONMENT_SETTINGS', '');
$response = new StdClass();
$response->success = true;
$response->msg = G::LoadTranslation('ID_SAVED_SUCCESSFULLY');
echo G::json_encode($response);
break;
}
$request = isset($_POST["request"])? $_POST["request"] : (isset($_GET["request"])? $_GET["request"] : null);
switch ($request) {
case "getUserMaskList":
$result->rows = Configurations::getUserNameFormats();
print(G::json_encode($result));
break;
case "getDateFormats":
$result->rows = Configurations::getDateFormats();
print(G::json_encode($result));
break;
case "getCasesListDateFormat":
$result->rows = Configurations::getDateFormats();;
print(G::json_encode($result));
break;
case "getCasesListRowNumber":
for ($i = 10; $i <= 50; $i+=5) {
$formats[] = array("id" => "$i", "name" => "$i");
}
$result->rows = $formats;
print(G::json_encode($result));
break;
case "save":
$conf = new Configurations();
$conf->aConfig = array(
"format" => $_POST["userFormat"],
"dateFormat" => $_POST["dateFormat"],
"startCaseHideProcessInf" => ((isset($_POST["hideProcessInf"]))? true : false),
"casesListDateFormat" => $_POST["casesListDateFormat"],
"casesListRowNumber" => intval($_POST["casesListRowNumber"]),
"casesListRefreshTime" => intval($_POST["txtCasesRefreshTime"])
);
$conf->saveConfig("ENVIRONMENT_SETTINGS", "");
$response = new stdclass();
$response->success = true;
$response->msg = G::LoadTranslation("ID_SAVED_SUCCESSFULLY");
echo G::json_encode($response);
break;
}

View File

@@ -1,5 +1,4 @@
var PANEL_EAST_OPEN = false; var PANEL_EAST_OPEN = false;
var timerMinutes = 2*60*1000; //every 2 minutes, this should be customized also,
var currentSelectedTreeMenuItem = null; var currentSelectedTreeMenuItem = null;
var centerPanel; var centerPanel;
var menuTree; var menuTree;
@@ -11,7 +10,7 @@ var detailsText = '<i></i>';
var debugTriggersDetailTpl = new Ext.Template('<pre style="font-size:10px"><code>{code}</code></pre>'); var debugTriggersDetailTpl = new Ext.Template('<pre style="font-size:10px"><code>{code}</code></pre>');
debugTriggersDetailTpl.compile(); debugTriggersDetailTpl.compile();
var propStore; var propStore;
var triggerStore; var triggerStore;
@@ -21,7 +20,7 @@ var NOTIFIER_FLAG = false;
var result; var result;
var _action = ''; var _action = '';
var _CASE_TITLE; var _CASE_TITLE;
Ext.onReady(function(){ Ext.onReady(function(){
new Ext.KeyMap(document, { new Ext.KeyMap(document, {
key: Ext.EventObject.F5, key: Ext.EventObject.F5,
@@ -32,8 +31,8 @@ Ext.onReady(function(){
} }
e.stopEvent(); e.stopEvent();
updateCasesTree(); updateCasesTree();
} }
else else
Ext.Msg.alert('Refresh', 'You clicked: CTRL-F5'); Ext.Msg.alert('Refresh', 'You clicked: CTRL-F5');
} }
}); });
@@ -41,7 +40,7 @@ Ext.onReady(function(){
Ext.QuickTips.init(); Ext.QuickTips.init();
Ext.state.Manager.setProvider(new Ext.state.CookieProvider()); Ext.state.Manager.setProvider(new Ext.state.CookieProvider());
var resetGrid = function() { var resetGrid = function() {
propStore.load(); propStore.load();
}; };
@@ -52,16 +51,16 @@ Ext.onReady(function(){
var debugVariablesFilterSystem = function(){ var debugVariablesFilterSystem = function(){
propStore.load({params:{filter:'sys'}}); propStore.load({params:{filter:'sys'}});
} }
var resetTriggers = function(){ var resetTriggers = function(){
triggerStore.load(); triggerStore.load();
} }
propStore = new Ext.data.Store({ propStore = new Ext.data.Store({
proxy: new Ext.data.HttpProxy({url: 'debug_vars'}), proxy: new Ext.data.HttpProxy({url: 'debug_vars'}),
reader: new Ext.data.DynamicJsonReader({root: 'data'}) reader: new Ext.data.DynamicJsonReader({root: 'data'})
}); });
propStore.on('load', function(){ propStore.on('load', function(){
propStore.fields = propStore.recordType.prototype.fields; propStore.fields = propStore.recordType.prototype.fields;
debugVariables.setSource(propStore.getAt(0).data); debugVariables.setSource(propStore.getAt(0).data);
@@ -76,14 +75,14 @@ Ext.onReady(function(){
width: 400, width: 400,
region: 'center', region: 'center',
margins: '2 2 0 2', margins: '2 2 0 2',
border: true, border: true,
stripeRows: true, stripeRows: true,
listeners: { listeners: {
beforeedit: function(event) { //Cancel editing - read only beforeedit: function(event) { //Cancel editing - read only
event.cancel = true; event.cancel = true;
} }
}, },
tbar: [ tbar: [
{text: TRANSLATIONS.ID_ALL, handler: resetGrid}, {text: TRANSLATIONS.ID_ALL, handler: resetGrid},
{text: TRANSLATIONS.ID_DYNAFORM, handler: debugVariablesFilterDynaform}, {text: TRANSLATIONS.ID_DYNAFORM, handler: debugVariablesFilterDynaform},
@@ -95,18 +94,18 @@ Ext.onReady(function(){
} }
}); });
//set debug variable details //set debug variable details
debugVariables.getSelectionModel().on('rowselect', function(sm, rowIdx, r) { debugVariables.getSelectionModel().on('rowselect', function(sm, rowIdx, r) {
var detailPanel = Ext.getCmp('debug-details-panel'); var detailPanel = Ext.getCmp('debug-details-panel');
var d = {} var d = {}
d.name = r.data.name; d.name = r.data.name;
d.value = parent.parent.htmlentities ? parent.parent.htmlentities(r.data.value) : r.data.value; d.value = parent.parent.htmlentities ? parent.parent.htmlentities(r.data.value) : r.data.value;
debugVarTpl.overwrite(detailPanel.body, d); debugVarTpl.overwrite(detailPanel.body, d);
detailPanel.setTitle(r.data.name); detailPanel.setTitle(r.data.name);
if(r.data.value == '<object>' || r.data.value == '<array>' ){ if(r.data.value == '<object>' || r.data.value == '<array>' ){
Ext.getCmp('deatachAction').setDisabled(false); Ext.getCmp('deatachAction').setDisabled(false);
Ext.Ajax.request({ Ext.Ajax.request({
@@ -114,11 +113,11 @@ Ext.onReady(function(){
success: function(response){ success: function(response){
try{ try{
result = eval('('+response.responseText+')'); result = eval('('+response.responseText+')');
var store1a = new Ext.data.ArrayStore({fields: result.headers}); var store1a = new Ext.data.ArrayStore({fields: result.headers});
// manually load local data // manually load local data
store1a.loadData(result.rows); store1a.loadData(result.rows);
var myGridPanel = new Ext.grid.GridPanel({ var myGridPanel = new Ext.grid.GridPanel({
store: store1a, store: store1a,
height: 200, height: 200,
@@ -129,7 +128,7 @@ Ext.onReady(function(){
viewConfig:{forceFit:true, scrollOffset:0}, viewConfig:{forceFit:true, scrollOffset:0},
listeners: { listeners: {
rowdblclick: function(grid, n,e){ rowdblclick: function(grid, n,e){
}, },
render: function(){ render: function(){
this.loadMask = new Ext.LoadMask(this.body, { msg:'Loading...' }); this.loadMask = new Ext.LoadMask(this.body, { msg:'Loading...' });
@@ -152,12 +151,12 @@ Ext.onReady(function(){
params: {request: 'getRows', fieldname:r.data.name} params: {request: 'getRows', fieldname:r.data.name}
}); });
} else } else
Ext.getCmp('deatachAction').setDisabled(true); Ext.getCmp('deatachAction').setDisabled(true);
}); });
//center iframe panel //center iframe panel
centerPanel = { centerPanel = {
region : 'center', region : 'center',
@@ -217,13 +216,13 @@ Ext.onReady(function(){
ReloadTreeMenuItemDetail({item:''}); ReloadTreeMenuItemDetail({item:''});
} }
})*/ })*/
}/*, }/*,
'afterrender': { 'afterrender': {
fn: setNode, fn: setNode,
scope: this scope: this
}*/ }*/
} }
}); });
@@ -236,7 +235,7 @@ Ext.onReady(function(){
//if it is, then update cases tree //if it is, then update cases tree
updateCasesTree(); updateCasesTree();
} }
if( _nodeId != '' ){ if( _nodeId != '' ){
treePanel1 = Ext.getCmp('tree-panel') treePanel1 = Ext.getCmp('tree-panel')
if(treePanel1) if(treePanel1)
@@ -291,7 +290,7 @@ Ext.onReady(function(){
loaded:false, loaded:false,
expanded:true expanded:true
}); });
treeMenuItemDetail.setRootNode(root); treeMenuItemDetail.setRootNode(root);
mainMenu = new Ext.Panel({ mainMenu = new Ext.Panel({
@@ -313,19 +312,19 @@ Ext.onReady(function(){
treeMenuItemDetail treeMenuItemDetail
] ]
}); });
mainMenu.setTitle('<a href="#"><img id="refreshNotifiers" src="/images/refresh.gif" onClick="updateCasesTree(); updateCasesView();" /></a>'); mainMenu.setTitle("<div style=\"height: 18px;\"><a href=\"javascript:;\"><img id=\"refreshNotifiers\" src=\"/images/refresh.gif\" onclick=\"updateCasesTree(); updateCasesView();\" /></a></div>");
/** /**
* Triggers Panel * Triggers Panel
*/ */
var xg = Ext.grid; var xg = Ext.grid;
var reader = new Ext.data.JsonReader( var reader = new Ext.data.JsonReader(
{ {
root: 'data', root: 'data',
totalProperty: 'total', totalProperty: 'total',
id: 'name' id: 'name'
}, },
[ [
{name: 'name'}, {name: 'name'},
{name: 'execution_time'}, {name: 'execution_time'},
@@ -350,7 +349,7 @@ Ext.onReady(function(){
var debugTriggers = new xg.GridPanel({ var debugTriggers = new xg.GridPanel({
store: triggerStore, store: triggerStore,
columns: [ columns: [
{id:'name',header: "Name", width: 60, sortable: true, dataIndex: 'name'}, {id:'name',header: "Name", width: 60, sortable: true, dataIndex: 'name'},
{header: "Execution", width: 30, sortable: true, dataIndex: 'execution_time'}, {header: "Execution", width: 30, sortable: true, dataIndex: 'execution_time'},
@@ -378,14 +377,14 @@ Ext.onReady(function(){
} }
} }
}); });
debugTriggers.getSelectionModel().on('rowselect', function(sm, rowIdx, r) { debugTriggers.getSelectionModel().on('rowselect', function(sm, rowIdx, r) {
Ext.getCmp('deatachAction').setDisabled(false); Ext.getCmp('deatachAction').setDisabled(false);
var detailPanel = Ext.getCmp('debug-details-panel'); var detailPanel = Ext.getCmp('debug-details-panel');
detailPanel.setTitle(r.data.name); detailPanel.setTitle(r.data.name);
debugTriggersDetailTpl.overwrite(detailPanel.body, r.data); debugTriggersDetailTpl.overwrite(detailPanel.body, r.data);
}); });
function triggerWindow() { function triggerWindow() {
var r = debugTriggers.getSelectionModel().getSelected(); var r = debugTriggers.getSelectionModel().getSelected();
if(r){ if(r){
@@ -435,7 +434,7 @@ Ext.onReady(function(){
items: [ items: [
debugVariables, debugVariables,
debugTriggers debugTriggers
], ],
listeners: { listeners: {
beforetabchange: function(){ beforetabchange: function(){
Ext.getCmp('deatachAction').setDisabled(true); Ext.getCmp('deatachAction').setDisabled(true);
@@ -503,34 +502,34 @@ Ext.onReady(function(){
} }
} }
] ]
}] }]
}); });
var viewport = new Ext.Viewport({ var viewport = new Ext.Viewport({
layout: 'border', layout: 'border',
items: [ mainMenu, centerPanel, debugPanel] items: [ mainMenu, centerPanel, debugPanel]
}); });
/** after panel creation routines */ /** after panel creation routines */
var menuPanelC = Ext.getCmp('debugPanel'); var menuPanelC = Ext.getCmp('debugPanel');
//w.collapse(); //w.collapse();
/**hide*/ /**hide*/
menuPanelC.hide(); menuPanelC.hide();
menuPanelC.ownerCt.doLayout(); menuPanelC.ownerCt.doLayout();
/**show*/ /**show*/
//w.show(); //w.show();
//w.ownerCt.doLayout(); //w.ownerCt.doLayout();
//w.expand(); //w.expand();
var menuPanelDetail = Ext.getCmp('tree_menuItem_detail'); var menuPanelDetail = Ext.getCmp('tree_menuItem_detail');
menuPanelDetail.hide(); menuPanelDetail.hide();
menuPanelDetail.ownerCt.doLayout(); menuPanelDetail.ownerCt.doLayout();
//the starting timer will be triggered after timerMinutes //FORMATS.casesListRefreshTime is in seconds
setTimeout('Timer()', timerMinutes ); setTimeout("timer()", parseInt(FORMATS.casesListRefreshTime) * 1000);
}); });
function updateCasesView() { function updateCasesView() {
@@ -538,7 +537,7 @@ function updateCasesView() {
if (document.getElementById('casesSubFrame').contentWindow.storeCases) { if (document.getElementById('casesSubFrame').contentWindow.storeCases) {
document.getElementById('casesSubFrame').contentWindow.storeCases.reload(); document.getElementById('casesSubFrame').contentWindow.storeCases.reload();
} }
} }
catch(e){}; catch(e){};
} }
@@ -580,13 +579,16 @@ function updateCasesTree() {
failure: function(){}, failure: function(){},
params: {'updateCasesTree': true} params: {'updateCasesTree': true}
}); });
} }
//the timer function will be called after 2 minutes; function timer()
function Timer(){ {
updateCasesView(); //FORMATS.casesListRefreshTime is in seconds
setTimeout('Timer()', timerMinutes); updateCasesTree();
updateCasesView();
setTimeout("timer()", parseInt(FORMATS.casesListRefreshTime) * 1000);
} }
Ext.data.DynamicJsonReader = function(config){ Ext.data.DynamicJsonReader = function(config){
@@ -620,7 +622,7 @@ Ext.extend(Ext.data.DynamicJsonReader, Ext.data.JsonReader, {
var recordType = this.getRecordType(root); var recordType = this.getRecordType(root);
var fields = recordType.prototype.fields; var fields = recordType.prototype.fields;
var records = []; var records = [];
for(var i = 0; i < root.length; i++){ for(var i = 0; i < root.length; i++){
var n = root[i]; var n = root[i];
var values = {}; var values = {};
@@ -683,8 +685,8 @@ Ext.app.menuLoader = Ext.extend(Ext.ux.tree.XmlTreeLoader, {
//attr.disabled=true; //attr.disabled=true;
attr.expandable=true; attr.expandable=true;
attr.qtip=attr.blockTitle; attr.qtip=attr.blockTitle;
}else if(attr.blockTitle){ }else if(attr.blockTitle){
attr.text = attr.blockTitle; attr.text = attr.blockTitle;
attr.iconCls = 'ICON_' + attr.id; attr.iconCls = 'ICON_' + attr.id;
@@ -694,11 +696,11 @@ Ext.app.menuLoader = Ext.extend(Ext.ux.tree.XmlTreeLoader, {
//}else{ //}else{
attr.expanded = true; attr.expanded = true;
//} //}
}else if(attr.title){ }else if(attr.title){
attr.text = attr.title; attr.text = attr.title;
if( attr.cases_count ) if( attr.cases_count )
attr.text += ' (<label id="NOTIFIER_'+attr.id+'">' + attr.cases_count + '</label>)'; attr.text += ' (<label id="NOTIFIER_'+attr.id+'">' + attr.cases_count + '</label>)';
attr.iconCls = 'ICON_' + attr.id; attr.iconCls = 'ICON_' + attr.id;
attr.loaded = true; attr.loaded = true;
attr.expanded = false; attr.expanded = false;

View File

@@ -5,6 +5,8 @@ var fsDates;
var fsCases; var fsCases;
var _firstName, _lastName, _userName, _dateSample; var _firstName, _lastName, _userName, _dateSample;
var txtCasesRefreshTime;
Ext.onReady(function() { Ext.onReady(function() {
Ext.QuickTips.init(); Ext.QuickTips.init();
@@ -21,8 +23,10 @@ Ext.onReady(function() {
items: [ items: [
{xtype: 'label', fieldLabel: _('IS_USER_NAME_DISPLAY_FORMAT'), id: 'lblFullName', width: 400}, {xtype: 'label', fieldLabel: _('IS_USER_NAME_DISPLAY_FORMAT'), id: 'lblFullName', width: 400},
{xtype: 'label', fieldLabel: _('ID_GLOBAL_DATE_FORMAT'), id: 'lblDateFormat', width: 400}, {xtype: 'label', fieldLabel: _('ID_GLOBAL_DATE_FORMAT'), id: 'lblDateFormat', width: 400},
{xtype: 'label', fieldLabel: _('ID_CASE_LIST') +': '+_('ID_CASES_DATE_MASK'), id: 'lblCasesDateFormat', width: 400}, {xtype: 'label', fieldLabel: _('ID_CASE_LIST') +': '+_('ID_CASES_DATE_MASK'), id: 'lblCasesDateFormat', width: 400}
{xtype: 'label', fieldLabel: _('ID_CASE_LIST') +': '+_('ID_CASES_ROW_NUMBER'), id: 'lblCasesRowsList', width: 400} //,
//{xtype: "label", fieldLabel: _("ID_CASE_LIST") + ": " +_("ID_CASES_ROW_NUMBER"), id: "lblCasesRowsList", width: 400},
//{xtype: "label", fieldLabel: _("ID_CASE_LIST") + ": " + _("ID_REFRESH_TIME_SECONDS"), id: "lblCasesRefreshTime", width: 400}
] ]
}); });
@@ -37,14 +41,14 @@ Ext.onReady(function() {
listeners:{ listeners:{
load: function(){ load: function(){
default_format = FORMATS.format; default_format = FORMATS.format;
i = cmbUsernameFormats.store.findExact('id', default_format, 0); i = cmbUsernameFormat.store.findExact('id', default_format, 0);
cmbUsernameFormats.setValue(cmbUsernameFormats.store.getAt(i).data.id); cmbUsernameFormat.setValue(cmbUsernameFormat.store.getAt(i).data.id);
cmbUsernameFormats.setRawValue(cmbUsernameFormats.store.getAt(i).data.name); cmbUsernameFormat.setRawValue(cmbUsernameFormat.store.getAt(i).data.name);
} }
} }
}); });
cmbUsernameFormats = new Ext.form.ComboBox({ cmbUsernameFormat = new Ext.form.ComboBox({
fieldLabel : _('IS_USER_NAME_DISPLAY_FORMAT'), fieldLabel : _('IS_USER_NAME_DISPLAY_FORMAT'),
hiddenName : 'userFormat', hiddenName : 'userFormat',
store : storeUsernameFormat, store : storeUsernameFormat,
@@ -59,9 +63,12 @@ Ext.onReady(function() {
mode:'local', mode:'local',
listeners:{ listeners:{
afterrender:function(){ afterrender:function(){
cmbUsernameFormats.store.load(); cmbUsernameFormat.store.load();
}, },
select: function(){ChangeSettings('1');} select: function ()
{
changeSettings(1);
}
} }
}); });
@@ -80,14 +87,14 @@ Ext.onReady(function() {
listeners:{ listeners:{
load: function(){ load: function(){
default_date_format = FORMATS.dateFormat, default_date_format = FORMATS.dateFormat,
i = cmbDateFormats.store.findExact('id', default_date_format, 0); i = cmbDateFormat.store.findExact('id', default_date_format, 0);
cmbDateFormats.setValue(cmbDateFormats.store.getAt(i).data.id); cmbDateFormat.setValue(cmbDateFormat.store.getAt(i).data.id);
cmbDateFormats.setRawValue(cmbDateFormats.store.getAt(i).data.name); cmbDateFormat.setRawValue(cmbDateFormat.store.getAt(i).data.name);
} }
} }
}); });
cmbDateFormats = new Ext.form.ComboBox({ cmbDateFormat = new Ext.form.ComboBox({
fieldLabel : _('ID_GLOBAL_DATE_FORMAT'), fieldLabel : _('ID_GLOBAL_DATE_FORMAT'),
hiddenName : 'dateFormat', hiddenName : 'dateFormat',
store : storeDateFormat, store : storeDateFormat,
@@ -102,13 +109,16 @@ Ext.onReady(function() {
mode:'local', mode:'local',
listeners:{ listeners:{
afterrender:function(){ afterrender:function(){
cmbDateFormats.store.load(); cmbDateFormat.store.load();
}, },
select: function(){ChangeSettings('2');} select: function ()
{
changeSettings(2);
}
} }
}); });
storeCaseUserNameFormat = new Ext.data.Store({ storeCasesDateFormat = new Ext.data.Store({
proxy : new Ext.data.HttpProxy({ proxy : new Ext.data.HttpProxy({
url : 'environmentSettingsAjax?request=getCasesListDateFormat', url : 'environmentSettingsAjax?request=getCasesListDateFormat',
method : 'POST' method : 'POST'
@@ -123,17 +133,17 @@ Ext.onReady(function() {
listeners:{ listeners:{
load: function(){ load: function(){
default_caseslist_date_format = FORMATS.casesListDateFormat; default_caseslist_date_format = FORMATS.casesListDateFormat;
i = cmbCasesDateFormats.store.findExact('id', default_caseslist_date_format, 0); i = cmbCasesDateFormat.store.findExact('id', default_caseslist_date_format, 0);
cmbCasesDateFormats.setValue(cmbCasesDateFormats.store.getAt(i).data.id); cmbCasesDateFormat.setValue(cmbCasesDateFormat.store.getAt(i).data.id);
cmbCasesDateFormats.setRawValue(cmbCasesDateFormats.store.getAt(i).data.name); cmbCasesDateFormat.setRawValue(cmbCasesDateFormat.store.getAt(i).data.name);
} }
} }
}); });
cmbCasesDateFormats = new Ext.form.ComboBox({ cmbCasesDateFormat = new Ext.form.ComboBox({
fieldLabel : _('ID_CASES_DATE_MASK'), fieldLabel : _('ID_CASES_DATE_MASK'),
hiddenName : 'casesListDateFormat', hiddenName : 'casesListDateFormat',
store : storeCaseUserNameFormat, store : storeCasesDateFormat,
valueField : 'id', valueField : 'id',
displayField : 'name', displayField : 'name',
triggerAction : 'all', triggerAction : 'all',
@@ -144,13 +154,16 @@ Ext.onReady(function() {
mode:'local', mode:'local',
listeners:{ listeners:{
afterrender:function(){ afterrender:function(){
cmbCasesDateFormats.store.load(); cmbCasesDateFormat.store.load();
}, },
select: function(){ChangeSettings('3');} select: function ()
{
changeSettings(4);
}
} }
}); });
storeCaseListNumber = new Ext.data.Store({ storeCasesRowNumber = new Ext.data.Store({
proxy : new Ext.data.HttpProxy( { proxy : new Ext.data.HttpProxy( {
url : 'environmentSettingsAjax?request=getCasesListRowNumber', url : 'environmentSettingsAjax?request=getCasesListRowNumber',
method : 'POST' method : 'POST'
@@ -163,21 +176,17 @@ Ext.onReady(function() {
] ]
}), }),
listeners:{ listeners:{
load: function(){ load: function ()
default_caseslist_row_number = FORMATS.casesListRowNumber; {
i = cmbCasesRowsPerPage.store.findExact('id', default_caseslist_row_number, 0); cmbCasesRowNumber.setValue(FORMATS.casesListRowNumber + "");
if( i != -1 ){
cmbCasesRowsPerPage.setValue(cmbCasesRowsPerPage.store.getAt(i).data.id);
cmbCasesRowsPerPage.setRawValue(cmbCasesRowsPerPage.store.getAt(i).data.name);
} }
}
} }
}); });
cmbCasesRowsPerPage = new Ext.form.ComboBox({ cmbCasesRowNumber = new Ext.form.ComboBox({
fieldLabel : _('ID_CASES_ROW_NUMBER'), fieldLabel : _('ID_CASES_ROW_NUMBER'),
hiddenName : 'casesListRowNumber', hiddenName : 'casesListRowNumber',
store : storeCaseListNumber, store : storeCasesRowNumber,
valueField : 'id', valueField : 'id',
displayField : 'name', displayField : 'name',
triggerAction : 'all', triggerAction : 'all',
@@ -188,22 +197,42 @@ Ext.onReady(function() {
mode:'local', mode:'local',
listeners:{ listeners:{
afterrender:function(){ afterrender:function(){
cmbCasesRowsPerPage.store.load(); cmbCasesRowNumber.store.load();
}, },
select: function(){ChangeSettings('4');} select: function ()
{
changeSettings(5);
}
} }
}); });
txtCasesRefreshTime = new Ext.form.TextField({
id: "txtCasesRefreshTime",
name: "txtCasesRefreshTime",
value: FORMATS.casesListRefreshTime,
fieldLabel: _("ID_REFRESH_TIME_SECONDS"),
maskRe: /^\d*$/,
enableKeyEvents: true,
listeners: {
keyup: function (txt, e)
{
changeSettings(6);
}
}
});
fsNames = new Ext.form.FieldSet({ fsNames = new Ext.form.FieldSet({
title: _('ID_PM_ENV_SETTINGS_USERFIELDSET_TITLE'), title: _('ID_PM_ENV_SETTINGS_USERFIELDSET_TITLE'),
labelAlign: 'right', labelAlign: 'right',
items: [cmbUsernameFormats] items: [cmbUsernameFormat]
}); });
fsDates = new Ext.form.FieldSet({ fsDates = new Ext.form.FieldSet({
title: _('ID_PM_ENV_SETTINGS_REGIONFIELDSET_TITLE'), title: _('ID_PM_ENV_SETTINGS_REGIONFIELDSET_TITLE'),
labelAlign: 'right', labelAlign: 'right',
items: [cmbDateFormats] items: [cmbDateFormat]
}); });
fsCases = new Ext.form.FieldSet({ fsCases = new Ext.form.FieldSet({
@@ -228,9 +257,9 @@ Ext.onReady(function() {
] ]
}), }),
new Ext.form.FieldSet({ new Ext.form.FieldSet({
title: _('ID_CASES_LIST_SETUP'), title: _("ID_CASES_LIST_SETUP"),
labelAlign: 'right', labelAlign: "right",
items: [cmbCasesDateFormats,cmbCasesRowsPerPage] items: [cmbCasesDateFormat, cmbCasesRowNumber, txtCasesRefreshTime]
}) })
] ]
}); });
@@ -265,7 +294,7 @@ Ext.onReady(function() {
buttons : [saveButton] buttons : [saveButton]
}); });
LoadSamples(); loadSamples();
/*viewport = new Ext.Viewport({ /*viewport = new Ext.Viewport({
layout: 'fit', layout: 'fit',
@@ -279,32 +308,41 @@ Ext.onReady(function() {
}); });
//Load Samples Label //Load Samples Label
LoadSamples = function(){ loadSamples = function ()
Ext.getCmp('lblFullName').setText(_FNF(_userName, _firstName, _lastName, FORMATS.format)); {
Ext.getCmp('lblDateFormat').setText(_DF(_dateSample, FORMATS.dateFormat)); Ext.getCmp("lblFullName").setText(_FNF(_userName, _firstName, _lastName, FORMATS.format));
Ext.getCmp('lblCasesDateFormat').setText(_DF(_dateSample, FORMATS.casesListDateFormat, FORMATS.casesListDateFormat)); Ext.getCmp("lblDateFormat").setText(_DF(_dateSample, FORMATS.dateFormat));
Ext.getCmp('lblCasesRowsList').setText(FORMATS.casesListRowNumber); Ext.getCmp("lblCasesDateFormat").setText(_DF(_dateSample, FORMATS.casesListDateFormat, FORMATS.casesListDateFormat));
//Ext.getCmp("lblCasesRowsList").setText(FORMATS.casesListRowNumber);
//Ext.getCmp("lblCasesRefreshTime").setText(FORMATS.casesListRefreshTime);
}; };
//Change Some Setting //Change Some Setting
ChangeSettings = function(iType){ changeSettings = function (iType)
saveButton.enable(); {
switch (iType){ saveButton.enable();
case '1':
_format = cmbUsernameFormats.getValue(); switch (iType) {
Ext.getCmp('lblFullName').setText(_FNF(_userName,_firstName,_lastName, _format)); case 1:
break; var f = FORMATS.format;
case '2':
_format = cmbDateFormats.getValue(); FORMATS.format = cmbUsernameFormat.getValue();
Ext.getCmp('lblDateFormat').setText(_DF(_dateSample,_format)); Ext.getCmp("lblFullName").setText(_FNF(_userName, _firstName, _lastName, cmbUsernameFormat.getValue()));
break; FORMATS.format = f;
case '3': break;
_format = cmbCasesDateFormats.getValue(); case 2:
Ext.getCmp('lblCasesDateFormat').setText(_DF(_dateSample,_format)); Ext.getCmp("lblDateFormat").setText(_DF(_dateSample, cmbDateFormat.getValue()));
break; break;
case '4': case 3:
_format = cmbCasesRowsPerPage.getValue(); break;
Ext.getCmp('lblCasesRowsList').setText(_format); case 4:
break; Ext.getCmp("lblCasesDateFormat").setText(_DF(_dateSample, cmbCasesDateFormat.getValue()));
} break;
case 5:
//Ext.getCmp("lblCasesRowsList").setText(cmbCasesRowNumber.getValue());
break;
case 6:
//Ext.getCmp("lblCasesRefreshTime").setText(txtCasesRefreshTime.getValue());
break;
}
}; };