2012-10-17 15:40:37 -04:00
|
|
|
<?php
|
|
|
|
|
/**
|
|
|
|
|
*
|
|
|
|
|
* @author Erik A.O. <erik@colosa.com>
|
|
|
|
|
* @date Sept 13th, 2010
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
G::LoadClass( "configuration" );
|
|
|
|
|
|
|
|
|
|
$request = isset( $_POST["request"] ) ? $_POST["request"] : (isset( $_GET["request"] ) ? $_GET["request"] : null);
|
2013-01-31 13:57:54 -04:00
|
|
|
$result = new stdclass();
|
2012-10-17 15:40:37 -04:00
|
|
|
|
|
|
|
|
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();
|
2013-06-26 09:06:35 -04:00
|
|
|
$config = $conf->getConfiguration("ENVIRONMENT_SETTINGS", "" );
|
|
|
|
|
$config['format'] = $_POST["userFormat"];
|
|
|
|
|
$config['dateFormat'] = $_POST["dateFormat"];
|
|
|
|
|
$config['startCaseHideProcessInf'] = ((isset( $_POST["hideProcessInf"] )) ? true : false);
|
|
|
|
|
$config['casesListDateFormat'] = $_POST["casesListDateFormat"];
|
|
|
|
|
$config['casesListRowNumber'] = intval( $_POST["casesListRowNumber"] );
|
|
|
|
|
$config['casesListRefreshTime'] = intval( $_POST["txtCasesRefreshTime"]);
|
|
|
|
|
|
|
|
|
|
$conf->aConfig = $config;
|
2012-10-17 15:40:37 -04:00
|
|
|
$conf->saveConfig( "ENVIRONMENT_SETTINGS", "" );
|
|
|
|
|
|
2014-11-07 13:43:52 -04:00
|
|
|
G::auditLog("UpdateEnvironmentSettings", "UserNameDisplayFormat -> ".$_POST["userFormat"].", GlobalDateFormat -> ".$_POST["dateFormat"].", HideProcessInformation -> ".(string)isset($_POST["hideProcessInf"]).", DateFormat -> ".$_POST["casesListDateFormat"].", NumberOfRowsPerPage -> ".$_POST["casesListRowNumber"].", RefreshTimeSeconds -> ".$_POST["txtCasesRefreshTime"]);
|
2014-10-07 15:58:46 -04:00
|
|
|
|
2012-10-17 15:40:37 -04:00
|
|
|
$response = new stdclass();
|
|
|
|
|
$response->success = true;
|
|
|
|
|
$response->msg = G::LoadTranslation( "ID_SAVED_SUCCESSFULLY" );
|
|
|
|
|
|
|
|
|
|
echo G::json_encode( $response );
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|