BUG 9630 "cron.php script can have several instances running..." SOLVED
- cron.php script can have several instances running at the same time - Problem solved, added validation in cron.php script to avoid run several times - Variable time added to control execution of cron * Available from version 2.0.44
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
* cron.php
|
||||
* @package workflow-engine-bin
|
||||
*/
|
||||
|
||||
ini_set('display_errors', 1);
|
||||
error_reporting(E_ALL);
|
||||
ini_set('memory_limit', '300M'); // nore: this may need to be higher for many projects
|
||||
@@ -55,17 +56,28 @@ define ('TIME_ZONE', $config['time_zone']);
|
||||
//Default values
|
||||
$bCronIsRunning = false;
|
||||
$sLastExecution = null;
|
||||
$processcTimeProcess = 0;
|
||||
$processcTimeStart = 0;
|
||||
|
||||
if (file_exists(PATH_DATA . "cron")) {
|
||||
$arrayAux = unserialize(trim(@file_get_contents(PATH_DATA . "cron")));
|
||||
$bCronIsRunning = (boolean)($arrayAux["bCronIsRunning"]);
|
||||
$sLastExecution = $arrayAux["sLastExecution"];
|
||||
$arrayCron = unserialize(trim(@file_get_contents(PATH_DATA . "cron")));
|
||||
$bCronIsRunning = (boolean)($arrayCron["bCronIsRunning"]);
|
||||
$sLastExecution = $arrayCron["sLastExecution"];
|
||||
$processcTimeProcess = (isset($arrayCron["processcTimeProcess"]))? intval($arrayCron["processcTimeProcess"]) : 10;
|
||||
$processcTimeStart = (isset($arrayCron["processcTimeStart"]))? $arrayCron["processcTimeStart"] : 0;
|
||||
}
|
||||
|
||||
if ($bCronIsRunning && $processcTimeStart != 0) {
|
||||
if ((time() - $processcTimeStart) > ($processcTimeProcess * 60)) {
|
||||
//Cron finished his execution for some reason
|
||||
$bCronIsRunning = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$bCronIsRunning) {
|
||||
//Start cron
|
||||
$arrayAux = array("bCronIsRunning" => "1", "sLastExecution" => date("Y-m-d H:i:s"));
|
||||
@file_put_contents(PATH_DATA . "cron", serialize($arrayAux));
|
||||
$arrayCron = array("bCronIsRunning" => "1", "sLastExecution" => date("Y-m-d H:i:s"));
|
||||
@file_put_contents(PATH_DATA . "cron", serialize($arrayCron));
|
||||
|
||||
//Data
|
||||
$ws = null;
|
||||
@@ -102,7 +114,7 @@ if (!$bCronIsRunning) {
|
||||
if (file_exists(PATH_DB . $sObject . PATH_SEP . "db.php")) {
|
||||
$cws = $cws + 1;
|
||||
|
||||
system("php -f \"".dirname(__FILE__).PATH_SEP."cron_single.php\" $sObject \"$sDate\" \"$dateSystem\" $argsx", $retval);
|
||||
system("php -f \"" . dirname(__FILE__) . PATH_SEP . "cron_single.php\" $sObject \"$sDate\" \"$dateSystem\" $argsx", $retval);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -110,15 +122,14 @@ if (!$bCronIsRunning) {
|
||||
} else {
|
||||
$cws = 1;
|
||||
|
||||
system("php -f \"".dirname(__FILE__).PATH_SEP."cron_single.php\" $ws \"$sDate\" \"$dateSystem\" $argsx", $retval);
|
||||
system("php -f \"" . dirname(__FILE__) . PATH_SEP . "cron_single.php\" $ws \"$sDate\" \"$dateSystem\" $argsx", $retval);
|
||||
}
|
||||
|
||||
//End cron
|
||||
$arrayAux = array("bCronIsRunning" => "0", "sLastExecution" => date("Y-m-d H:i:s"));
|
||||
@file_put_contents(PATH_DATA . "cron", serialize($arrayAux));
|
||||
$arrayCron = array("bCronIsRunning" => "0", "sLastExecution" => date("Y-m-d H:i:s"));
|
||||
@file_put_contents(PATH_DATA . "cron", serialize($arrayCron));
|
||||
|
||||
eprintln("Finished $cws workspaces processed.");
|
||||
} else {
|
||||
eprintln("The cron is running, please wait for it to finish.\n- Started in $sLastExecution");
|
||||
eprintln("The cron is running, please wait for it to finish.\nStarted in $sLastExecution");
|
||||
}
|
||||
|
||||
|
||||
@@ -260,7 +260,7 @@ function resendEmails()
|
||||
}
|
||||
|
||||
$oSpool = new spoolRun();
|
||||
$oSpool->resendEmails($dateResend);
|
||||
$oSpool->resendEmails($dateResend, 1);
|
||||
|
||||
saveLog("resendEmails", "action", "Resending Emails", "c");
|
||||
|
||||
@@ -296,7 +296,7 @@ function unpauseApplications()
|
||||
G::LoadClass('case');
|
||||
|
||||
$oCases = new Cases();
|
||||
$oCases->ThrowUnpauseDaemon($sNow);
|
||||
$oCases->ThrowUnpauseDaemon($sNow, 1);
|
||||
|
||||
setExecutionResultMessage('DONE');
|
||||
saveLog('unpauseApplications', 'action', 'Unpausing Applications');
|
||||
@@ -333,6 +333,11 @@ function executePlugins()
|
||||
$oPlugin = new $className();
|
||||
|
||||
if (method_exists($oPlugin, 'executeCron')) {
|
||||
$arrayCron = unserialize(trim(@file_get_contents(PATH_DATA . "cron")));
|
||||
$arrayCron["processcTimeProcess"] = 60;
|
||||
$arrayCron["processcTimeStart"] = time();
|
||||
@file_put_contents(PATH_DATA . "cron", serialize($arrayCron));
|
||||
|
||||
$oPlugin->executeCron();
|
||||
setExecutionMessage("Executing Plugins");
|
||||
setExecutionResultMessage('DONE');
|
||||
@@ -354,7 +359,7 @@ function calculateDuration()
|
||||
|
||||
try {
|
||||
$oAppDelegation = new AppDelegation();
|
||||
$oAppDelegation->calculateDuration();
|
||||
$oAppDelegation->calculateDuration(1);
|
||||
|
||||
setExecutionResultMessage('DONE');
|
||||
saveLog('calculateDuration', 'action', 'Calculating Duration');
|
||||
@@ -382,9 +387,13 @@ function executeEvents($sLastExecution, $sNow=null)
|
||||
try {
|
||||
$oAppEvent = new AppEvent();
|
||||
saveLog('executeEvents', 'action', "Executing Events $sLastExecution, $sNow ");
|
||||
$n = $oAppEvent->executeEvents($sNow, false, $log);
|
||||
$n = $oAppEvent->executeEvents($sNow, false, $log, 1);
|
||||
|
||||
foreach ($log as $value) {
|
||||
$arrayCron = unserialize(trim(@file_get_contents(PATH_DATA . "cron")));
|
||||
$arrayCron["processcTimeStart"] = time();
|
||||
@file_put_contents(PATH_DATA . "cron", serialize($arrayCron));
|
||||
|
||||
saveLog('executeEvents', 'action', "Execute Events : $value, $sNow ");
|
||||
}
|
||||
|
||||
@@ -416,9 +425,13 @@ function executeScheduledCases($sNow=null)
|
||||
$sNow = isset($sNow)? $sNow : date('Y-m-d H:i:s');
|
||||
|
||||
$oCaseScheduler = new CaseScheduler();
|
||||
$oCaseScheduler->caseSchedulerCron($sNow, $log);
|
||||
$oCaseScheduler->caseSchedulerCron($sNow, $log, 1);
|
||||
|
||||
foreach ($log as $value) {
|
||||
$arrayCron = unserialize(trim(@file_get_contents(PATH_DATA . "cron")));
|
||||
$arrayCron["processcTimeStart"] = time();
|
||||
@file_put_contents(PATH_DATA . "cron", serialize($arrayCron));
|
||||
|
||||
saveLog('executeScheduledCases', 'action', "OK Case# $value");
|
||||
}
|
||||
|
||||
@@ -458,7 +471,7 @@ function executeUpdateAppTitle()
|
||||
|
||||
//Update case labels
|
||||
$appcv = new AppCacheView();
|
||||
$appcv->appTitleByTaskCaseLabelUpdate($taskUid, $lang);
|
||||
$appcv->appTitleByTaskCaseLabelUpdate($taskUid, $lang, 1);
|
||||
|
||||
//Delete record
|
||||
$criteria = new Criteria("workflow");
|
||||
@@ -535,4 +548,3 @@ function setExecutionResultMessage($m, $t='')
|
||||
|
||||
eprintln("[$m]", $c);
|
||||
}
|
||||
|
||||
|
||||
@@ -2964,7 +2964,7 @@ class Cases
|
||||
* Description: This method set all cases with the APP_DISABLE_ACTION_DATE for today
|
||||
* @return void
|
||||
*/
|
||||
public function ThrowUnpauseDaemon($today)
|
||||
public function ThrowUnpauseDaemon($today, $cron=0)
|
||||
{
|
||||
$today = ($today==date('Y-m-d'))?date('Y-m-d'):$today;
|
||||
$c = new Criteria('workflow');
|
||||
@@ -2983,7 +2983,14 @@ class Cases
|
||||
$d = AppDelayPeer::doSelectRS($c);
|
||||
$d->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$d->next();
|
||||
|
||||
while ($aRow = $d->getRow()) {
|
||||
if ($cron == 1) {
|
||||
$arrayCron = unserialize(trim(@file_get_contents(PATH_DATA . "cron")));
|
||||
$arrayCron["processcTimeStart"] = time();
|
||||
@file_put_contents(PATH_DATA . "cron", serialize($arrayCron));
|
||||
}
|
||||
|
||||
$this->unpauseCase($aRow['APP_UID'], $aRow['APP_DEL_INDEX'], 'System Daemon');
|
||||
$d->next();
|
||||
}
|
||||
|
||||
@@ -493,7 +493,7 @@ class spoolRun {
|
||||
* @param string $dateResend
|
||||
* @return none or exception
|
||||
*/
|
||||
public function resendEmails($dateResend=null)
|
||||
public function resendEmails($dateResend=null, $cron=0)
|
||||
{
|
||||
require_once ("classes/model/Configuration.php");
|
||||
|
||||
@@ -541,6 +541,12 @@ class spoolRun {
|
||||
$rsCriteria->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
|
||||
while ($rsCriteria->next()) {
|
||||
if ($cron == 1) {
|
||||
$arrayCron = unserialize(trim(@file_get_contents(PATH_DATA . "cron")));
|
||||
$arrayCron["processcTimeStart"] = time();
|
||||
@file_put_contents(PATH_DATA . "cron", serialize($arrayCron));
|
||||
}
|
||||
|
||||
$row = $rsCriteria->getRow();
|
||||
|
||||
try {
|
||||
|
||||
@@ -1377,7 +1377,7 @@ class AppCacheView extends BaseAppCacheView
|
||||
return $aRows;
|
||||
}
|
||||
|
||||
public function appTitleByTaskCaseLabelUpdate($taskUid, $lang)
|
||||
public function appTitleByTaskCaseLabelUpdate($taskUid, $lang, $cron=0)
|
||||
{
|
||||
$taskDefTitle = null;
|
||||
|
||||
@@ -1409,6 +1409,12 @@ class AppCacheView extends BaseAppCacheView
|
||||
$rsCriteriaAPPCV->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
|
||||
while ($rsCriteriaAPPCV->next()) {
|
||||
if ($cron == 1) {
|
||||
$arrayCron = unserialize(trim(@file_get_contents(PATH_DATA . "cron")));
|
||||
$arrayCron["processcTimeStart"] = time();
|
||||
@file_put_contents(PATH_DATA . "cron", serialize($arrayCron));
|
||||
}
|
||||
|
||||
$row = $rsCriteriaAPPCV->getRow();
|
||||
|
||||
$appcvAppUid = $row["APP_UID"];
|
||||
|
||||
@@ -284,7 +284,7 @@ class AppDelegation extends BaseAppDelegation {
|
||||
return ( $date1 - $date2 ) / 3600;
|
||||
}
|
||||
|
||||
function calculateDuration()
|
||||
public function calculateDuration($cron=0)
|
||||
{
|
||||
try {
|
||||
//patch rows with initdate = null and finish_date
|
||||
@@ -304,6 +304,12 @@ class AppDelegation extends BaseAppDelegation {
|
||||
$row = $rs->getRow();
|
||||
|
||||
while (is_array($row)) {
|
||||
if ($cron == 1) {
|
||||
$arrayCron = unserialize(trim(@file_get_contents(PATH_DATA . "cron")));
|
||||
$arrayCron["processcTimeStart"] = time();
|
||||
@file_put_contents(PATH_DATA . "cron", serialize($arrayCron));
|
||||
}
|
||||
|
||||
$oAppDel = AppDelegationPeer::retrieveByPk($row['APP_UID'], $row['DEL_INDEX'] );
|
||||
if ( isset ($row['DEL_FINISH_DATE']) )
|
||||
$oAppDel->setDelInitDate($row['DEL_FINISH_DATE']);
|
||||
@@ -354,6 +360,12 @@ class AppDelegation extends BaseAppDelegation {
|
||||
|
||||
$now = strtotime ( 'now' );
|
||||
while ( is_array($row) ) {
|
||||
if ($cron == 1) {
|
||||
$arrayCron = unserialize(trim(@file_get_contents(PATH_DATA . "cron")));
|
||||
$arrayCron["processcTimeStart"] = time();
|
||||
@file_put_contents(PATH_DATA . "cron", serialize($arrayCron));
|
||||
}
|
||||
|
||||
$fTaskDuration = $row['TAS_DURATION'];
|
||||
$iDelegateDate = strtotime ( $row['DEL_DELEGATE_DATE'] );
|
||||
$iInitDate = strtotime ( $row['DEL_INIT_DATE'] );
|
||||
|
||||
@@ -160,7 +160,7 @@ class AppEvent extends BaseAppEvent {
|
||||
$aConditions[] = array(AppDelegationPeer::PRO_UID, 'C4.CON_ID');
|
||||
$aConditions[] = array('C4.CON_CATEGORY', $del . 'PRO_TITLE' . $del);
|
||||
$aConditions[] = array('C4.CON_LANG', $del . SYS_LANG . $del);
|
||||
|
||||
|
||||
$oCriteria->addJoinMC($aConditions, Criteria::LEFT_JOIN);
|
||||
$oCriteria->add(AppEventPeer::EVN_UID, '', Criteria::NOT_EQUAL);
|
||||
if($sProcessUid != ''){
|
||||
@@ -188,7 +188,7 @@ class AppEvent extends BaseAppEvent {
|
||||
}
|
||||
}
|
||||
|
||||
function executeEvents($sNow, $debug=false, &$log=array()) {
|
||||
public function executeEvents($sNow, $debug=false, &$log=array(), $cron=0) {
|
||||
|
||||
require_once 'classes/model/Configuration.php';
|
||||
require_once 'classes/model/Triggers.php';
|
||||
@@ -236,6 +236,11 @@ class AppEvent extends BaseAppEvent {
|
||||
|
||||
$c = 0;
|
||||
while ($oDataset->next()){
|
||||
if ($cron == 1) {
|
||||
$arrayCron = unserialize(trim(@file_get_contents(PATH_DATA . "cron")));
|
||||
$arrayCron["processcTimeStart"] = time();
|
||||
@file_put_contents(PATH_DATA . "cron", serialize($arrayCron));
|
||||
}
|
||||
|
||||
$c++;
|
||||
$aRow = $oDataset->getRow();
|
||||
|
||||
@@ -254,7 +254,7 @@ class CaseScheduler extends BaseCaseScheduler {
|
||||
$aProcessRow = $oProcess->load ( $aRow ['PRO_UID'] );
|
||||
|
||||
$aRows [$k] = array_merge ( $aRow, array (
|
||||
'PRO_TITLE' => $aProcessRow ['PRO_TITLE']
|
||||
'PRO_TITLE' => $aProcessRow ['PRO_TITLE']
|
||||
) );
|
||||
}
|
||||
return $aRows;
|
||||
@@ -280,9 +280,9 @@ class CaseScheduler extends BaseCaseScheduler {
|
||||
$aTaskRow = $oTask->load ( $aRow ['TAS_UID'] );
|
||||
|
||||
$aRows [$k] = array_merge ( $aRow, array (
|
||||
'TAS_TITLE' => $aTaskRow ['TAS_TITLE']
|
||||
'TAS_TITLE' => $aTaskRow ['TAS_TITLE']
|
||||
), array (
|
||||
'PRO_UID' => $aTaskRow ['PRO_UID']
|
||||
'PRO_UID' => $aTaskRow ['PRO_UID']
|
||||
) );
|
||||
}
|
||||
|
||||
@@ -293,7 +293,7 @@ class CaseScheduler extends BaseCaseScheduler {
|
||||
|
||||
}
|
||||
|
||||
function caseSchedulerCron($date, &$log=array()) {
|
||||
public function caseSchedulerCron($date, &$log=array(), $cron=0) {
|
||||
|
||||
G::LoadClass ( 'dates' );
|
||||
require_once ('classes/model/LogCasesScheduler.php');
|
||||
@@ -323,6 +323,12 @@ class CaseScheduler extends BaseCaseScheduler {
|
||||
$sStartDay = '';
|
||||
$sMonths = '';
|
||||
while ( $aRow = $oDataset->getRow () ) {
|
||||
if ($cron == 1) {
|
||||
$arrayCron = unserialize(trim(@file_get_contents(PATH_DATA . "cron")));
|
||||
$arrayCron["processcTimeStart"] = time();
|
||||
@file_put_contents(PATH_DATA . "cron", serialize($arrayCron));
|
||||
}
|
||||
|
||||
$sSchedulerUid = $aRow ['SCH_UID'];
|
||||
$sOption = $aRow ['SCH_OPTION'];
|
||||
switch ($sOption) {
|
||||
@@ -375,8 +381,8 @@ class CaseScheduler extends BaseCaseScheduler {
|
||||
|
||||
$client = new SoapClient ( $defaultEndpoint );
|
||||
$params = array (
|
||||
'userid' => $user,
|
||||
'password' => 'md5:' . $pass
|
||||
'userid' => $user,
|
||||
'password' => 'md5:' . $pass
|
||||
);
|
||||
$result = $client->__SoapCall ( 'login', array (
|
||||
$params
|
||||
@@ -390,22 +396,22 @@ class CaseScheduler extends BaseCaseScheduler {
|
||||
$newRouteLog = new LogCasesScheduler ();
|
||||
$variables = Array ();
|
||||
$params = array (
|
||||
'sessionId' => $sessionId,
|
||||
'processId' => $processId,
|
||||
'taskId' => $taskId,
|
||||
'variables' => $variables
|
||||
'sessionId' => $sessionId,
|
||||
'processId' => $processId,
|
||||
'taskId' => $taskId,
|
||||
'variables' => $variables
|
||||
);
|
||||
|
||||
$paramsLog = array (
|
||||
'PRO_UID' => $processId,
|
||||
'TAS_UID' => $taskId,
|
||||
'SCH_UID' => $sSchedulerUid,
|
||||
'USR_NAME' => $user,
|
||||
'RESULT' => '',
|
||||
'EXEC_DATE' => date ( 'Y-m-d' ),
|
||||
'EXEC_HOUR' => date ( 'H:i:s' ),
|
||||
'WS_CREATE_CASE_STATUS' => '',
|
||||
'WS_ROUTE_CASE_STATUS' => ''
|
||||
'PRO_UID' => $processId,
|
||||
'TAS_UID' => $taskId,
|
||||
'SCH_UID' => $sSchedulerUid,
|
||||
'USR_NAME' => $user,
|
||||
'RESULT' => '',
|
||||
'EXEC_DATE' => date ( 'Y-m-d' ),
|
||||
'EXEC_HOUR' => date ( 'H:i:s' ),
|
||||
'WS_CREATE_CASE_STATUS' => '',
|
||||
'WS_ROUTE_CASE_STATUS' => ''
|
||||
);
|
||||
|
||||
$sw_transfer_control_plugin=false;//This SW will be true only if a plugin is allowed to continue the action
|
||||
@@ -469,9 +475,9 @@ class CaseScheduler extends BaseCaseScheduler {
|
||||
$paramsLogResult = 'SUCCESS';
|
||||
|
||||
$params = array (
|
||||
'sessionId' => $sessionId,
|
||||
'caseId' => $caseId,
|
||||
'delIndex' => "1"
|
||||
'sessionId' => $sessionId,
|
||||
'caseId' => $caseId,
|
||||
'delIndex' => "1"
|
||||
);
|
||||
eprint(" - Routing the case #$caseNumber..............");
|
||||
$result = $client->__SoapCall ( 'RouteCase', array (
|
||||
@@ -530,7 +536,7 @@ class CaseScheduler extends BaseCaseScheduler {
|
||||
$Fields ['SCH_STATE'] = 'PROCESSED';
|
||||
$this->Update ( $Fields );
|
||||
} else {
|
||||
|
||||
|
||||
}
|
||||
} else if ($sActualDataHour == $dActualSysHour && $sActualDataMinutes <= $dActualSysMinutes) {
|
||||
|
||||
@@ -546,8 +552,8 @@ class CaseScheduler extends BaseCaseScheduler {
|
||||
|
||||
$client = new SoapClient ( $defaultEndpoint );
|
||||
$params = array (
|
||||
'userid' => $user,
|
||||
'password' => 'md5:' . $pass
|
||||
'userid' => $user,
|
||||
'password' => 'md5:' . $pass
|
||||
);
|
||||
$result = $client->__SoapCall ( 'login', array (
|
||||
$params
|
||||
@@ -562,22 +568,22 @@ class CaseScheduler extends BaseCaseScheduler {
|
||||
$newRouteLog = new LogCasesScheduler ();
|
||||
$variables = Array ();
|
||||
$params = array (
|
||||
'sessionId' => $sessionId,
|
||||
'processId' => $processId,
|
||||
'taskId' => $taskId,
|
||||
'variables' => $variables
|
||||
'sessionId' => $sessionId,
|
||||
'processId' => $processId,
|
||||
'taskId' => $taskId,
|
||||
'variables' => $variables
|
||||
);
|
||||
|
||||
$paramsLog = array (
|
||||
'PRO_UID' => $processId,
|
||||
'TAS_UID' => $taskId,
|
||||
'SCH_UID' => $sSchedulerUid,
|
||||
'USR_NAME' => $user,
|
||||
'RESULT' => '',
|
||||
'EXEC_DATE' => date ( 'Y-m-d' ),
|
||||
'EXEC_HOUR' => date ( 'H:i:s' ),
|
||||
'WS_CREATE_CASE_STATUS' => '',
|
||||
'WS_ROUTE_CASE_STATUS' => ''
|
||||
'PRO_UID' => $processId,
|
||||
'TAS_UID' => $taskId,
|
||||
'SCH_UID' => $sSchedulerUid,
|
||||
'USR_NAME' => $user,
|
||||
'RESULT' => '',
|
||||
'EXEC_DATE' => date ( 'Y-m-d' ),
|
||||
'EXEC_HOUR' => date ( 'H:i:s' ),
|
||||
'WS_CREATE_CASE_STATUS' => '',
|
||||
'WS_ROUTE_CASE_STATUS' => ''
|
||||
);
|
||||
|
||||
$result = $client->__SoapCall ( 'NewCase', array (
|
||||
@@ -594,9 +600,9 @@ class CaseScheduler extends BaseCaseScheduler {
|
||||
$paramsLogResult = 'SUCCESS';
|
||||
|
||||
$params = array (
|
||||
'sessionId' => $sessionId,
|
||||
'caseId' => $caseId,
|
||||
'delIndex' => "1"
|
||||
'sessionId' => $sessionId,
|
||||
'caseId' => $caseId,
|
||||
'delIndex' => "1"
|
||||
);
|
||||
$result = $client->__SoapCall ( 'RouteCase', array (
|
||||
$params
|
||||
@@ -648,7 +654,7 @@ class CaseScheduler extends BaseCaseScheduler {
|
||||
}
|
||||
}
|
||||
$nSchTimeNextRun = $dEstimatedDate;
|
||||
|
||||
|
||||
$this->updateDate ( $sSchedulerUid, $nSchTimeNextRun, $nSchLastRunTime );
|
||||
} elseif ($sOption != '5'){
|
||||
$Fields = $this->Load ( $sSchedulerUid );
|
||||
@@ -665,8 +671,8 @@ class CaseScheduler extends BaseCaseScheduler {
|
||||
$nextRun = $Fields ['SCH_REPEAT_EVERY']*60*60;
|
||||
$nSchTimeNextRun += $nextRun;
|
||||
$nSchTimeNextRun = date("Y-m-d H:i", $nSchTimeNextRun );
|
||||
|
||||
|
||||
|
||||
|
||||
$this->updateDate ( $sSchedulerUid, $nSchTimeNextRun, $nSchLastRunTime );
|
||||
}
|
||||
}
|
||||
@@ -718,13 +724,13 @@ class CaseScheduler extends BaseCaseScheduler {
|
||||
$nFirstDay = $aWeeks [0];
|
||||
|
||||
$aDaysWeek = array (
|
||||
'Monday',
|
||||
'Tuesday',
|
||||
'Wednesday',
|
||||
'Thursday',
|
||||
'Friday',
|
||||
'Saturday',
|
||||
'Sunday'
|
||||
'Monday',
|
||||
'Tuesday',
|
||||
'Wednesday',
|
||||
'Thursday',
|
||||
'Friday',
|
||||
'Saturday',
|
||||
'Sunday'
|
||||
);
|
||||
$nFirstDay = $nFirstDay - 1;
|
||||
// echo "¨¨".$nFirstDay."¨¨";
|
||||
@@ -821,27 +827,27 @@ class CaseScheduler extends BaseCaseScheduler {
|
||||
break;
|
||||
case '2' :
|
||||
$aMontsShort = array (
|
||||
'Jan',
|
||||
'Feb',
|
||||
'Mar',
|
||||
'Apr',
|
||||
'May',
|
||||
'Jun',
|
||||
'Jul',
|
||||
'Aug',
|
||||
'Sep',
|
||||
'Oct',
|
||||
'Nov',
|
||||
'Dec'
|
||||
'Jan',
|
||||
'Feb',
|
||||
'Mar',
|
||||
'Apr',
|
||||
'May',
|
||||
'Jun',
|
||||
'Jul',
|
||||
'Aug',
|
||||
'Sep',
|
||||
'Oct',
|
||||
'Nov',
|
||||
'Dec'
|
||||
);
|
||||
$aWeeksShort = array (
|
||||
'Monday',
|
||||
'Tuesday',
|
||||
'Wednesday',
|
||||
'Thursday',
|
||||
'Friday',
|
||||
'Saturday',
|
||||
'Sunday'
|
||||
'Monday',
|
||||
'Tuesday',
|
||||
'Wednesday',
|
||||
'Thursday',
|
||||
'Friday',
|
||||
'Saturday',
|
||||
'Sunday'
|
||||
);
|
||||
$sNumDayWeek = $aStartDay [1];
|
||||
$sDayWeek = ($aStartDay [2] == 7 ? 0 : $aStartDay [2]);
|
||||
|
||||
Reference in New Issue
Block a user