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:
@@ -23,53 +23,64 @@
|
||||
*
|
||||
*/
|
||||
|
||||
$oHeadPublisher =& headPublisher::getSingleton();
|
||||
$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 ) {
|
||||
G::loadClass('configuration');
|
||||
$oConf = new Configurations;
|
||||
$oConf->loadConfig($x, 'USER_PREFERENCES','','',$_SESSION['USER_LOGGED'],'');
|
||||
$arrayConfig = $oConf->aConfig;
|
||||
$memcache->set( $keyMem, $arrayConfig, PMmemcached::ONE_HOUR);
|
||||
}
|
||||
G::LoadClass("configuration");
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$conf = new Configurations();
|
||||
|
||||
$oHeadPublisher = &headPublisher::getSingleton();
|
||||
$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->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;
|
||||
|
||||
$oMenu = new Menu();
|
||||
$oMenu->load('cases');
|
||||
$defaultOption = '';
|
||||
foreach($oMenu->Id as $i=>$id){
|
||||
if( $id == $confDefaultOption ){
|
||||
$defaultOption = $oMenu->Options[$i];
|
||||
break;
|
||||
}
|
||||
$oMenu->load("cases");
|
||||
$defaultOption = "";
|
||||
|
||||
foreach ($oMenu->Id as $i => $id) {
|
||||
if ($id == $confDefaultOption) {
|
||||
$defaultOption = $oMenu->Options[$i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
$defaultOption = $defaultOption != '' ? $defaultOption : 'casesListExtJs';
|
||||
|
||||
}
|
||||
else {
|
||||
$defaultOption = 'casesListExtJs';
|
||||
$confDefaultOption = 'CASES_INBOX';
|
||||
}
|
||||
|
||||
if (isset($_GET['id']) && isset($_GET['id'])) {
|
||||
$defaultOption = '../cases/open?APP_UID=' . $_GET['id'] . '&DEL_INDEX=' . $_GET['i'];
|
||||
$defaultOption = ($defaultOption != "")? $defaultOption : "casesListExtJs";
|
||||
} else {
|
||||
$defaultOption = "casesListExtJs";
|
||||
$confDefaultOption = "CASES_INBOX";
|
||||
}
|
||||
|
||||
if (isset($_GET['a'])) {
|
||||
$defaultOption .= '&action=' . $_GET['a'];
|
||||
if (isset($_GET["id"]) && isset($_GET["id"])) {
|
||||
$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( '_nodeId', isset($confDefaultOption)?$confDefaultOption:'PM_USERS'); // user menu permissions
|
||||
}
|
||||
|
||||
$oHeadPublisher->assign("defaultOption", $defaultOption); //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');
|
||||
|
||||
@@ -1,58 +1,62 @@
|
||||
<?php
|
||||
/**
|
||||
* @author Erik A.O. <erik@colosa.com>
|
||||
* @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;
|
||||
/**
|
||||
* @author Erik A.O. <erik@colosa.com>
|
||||
* @date Sept 13th, 2010
|
||||
*
|
||||
*/
|
||||
|
||||
case 'getDateFormats':
|
||||
G::loadClass('configuration');
|
||||
$result->rows = Configurations::getDateFormats();
|
||||
print(G::json_encode($result));
|
||||
break;
|
||||
G::LoadClass("configuration");
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user