Improving the timezone management
This commit is contained in:
@@ -91,6 +91,8 @@ try {
|
|||||||
require_once('propel/Propel.php');
|
require_once('propel/Propel.php');
|
||||||
require_once('creole/Creole.php');
|
require_once('creole/Creole.php');
|
||||||
|
|
||||||
|
//TODO: get rid of the global variable improving the timezone activation when this feature is enabled
|
||||||
|
global $arraySystemConfiguration;
|
||||||
$arraySystemConfiguration = System::getSystemConfiguration('', '', $workspace);
|
$arraySystemConfiguration = System::getSystemConfiguration('', '', $workspace);
|
||||||
|
|
||||||
$e_all = (defined('E_DEPRECATED'))? E_ALL & ~E_DEPRECATED : E_ALL;
|
$e_all = (defined('E_DEPRECATED'))? E_ALL & ~E_DEPRECATED : E_ALL;
|
||||||
@@ -639,15 +641,7 @@ function executeScheduledCases($sNow=null)
|
|||||||
setExecutionMessage("Executing the scheduled starting cases");
|
setExecutionMessage("Executing the scheduled starting cases");
|
||||||
setExecutionResultMessage('PROCESSING');
|
setExecutionResultMessage('PROCESSING');
|
||||||
|
|
||||||
if (isset($sNow)) {
|
$runDate = runDateForScheduledCases($sNow);
|
||||||
//as the $sNow param that comes from the command line doesn't specicy a time zone
|
|
||||||
//we assume that the user set this time using the server time zone so we use the gmdate
|
|
||||||
//function to convert it
|
|
||||||
$runDate = gmdate('Y-m-d H:i:s', strtotime($sNow));
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$runDate = gmdate('Y-m-d H:i:s');
|
|
||||||
}
|
|
||||||
|
|
||||||
$oCaseScheduler = new CaseScheduler();
|
$oCaseScheduler = new CaseScheduler();
|
||||||
$oCaseScheduler->caseSchedulerCron($runDate, $log, 1);
|
$oCaseScheduler->caseSchedulerCron($runDate, $log, 1);
|
||||||
@@ -667,6 +661,35 @@ function executeScheduledCases($sNow=null)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function runDateForScheduledCases($sNow) {
|
||||||
|
global $arraySystemConfiguration;
|
||||||
|
|
||||||
|
$runDate = isset($sNow)? $sNow : date('Y-m-d H:i:s');
|
||||||
|
|
||||||
|
$systemUtcTimeZone = false;
|
||||||
|
/*----------------------------------********---------------------------------*/
|
||||||
|
if (PMLicensedFeatures::getSingleton()->verifyfeature('oq3S29xemxEZXJpZEIzN01qenJUaStSekY4cTdJVm5vbWtVM0d4S2lJSS9qUT0=')) {
|
||||||
|
$systemUtcTimeZone = (int)($arraySystemConfiguration['system_utc_time_zone']) == 1;
|
||||||
|
}
|
||||||
|
/*----------------------------------********---------------------------------*/
|
||||||
|
|
||||||
|
if ($systemUtcTimeZone) {
|
||||||
|
if (isset($sNow)) {
|
||||||
|
//as the $sNow param that comes from the command line doesn't specicy a time zone
|
||||||
|
//we assume that the user set this time using the server time zone so we use the gmdate
|
||||||
|
//function to convert it
|
||||||
|
$currentTimeZone = date_default_timezone_get();
|
||||||
|
date_default_timezone_set($arraySystemConfiguration['time_zone']);
|
||||||
|
$runDate = gmdate('Y-m-d H:i:s', strtotime($sNow));
|
||||||
|
date_default_timezone_set($currentTimeZone);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$runDate = gmdate('Y-m-d H:i:s');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $runDate;
|
||||||
|
}
|
||||||
|
|
||||||
function executeUpdateAppTitle()
|
function executeUpdateAppTitle()
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user