it's about 6018 bug with +d'date' opcion in the cron

This commit is contained in:
Carlos Pacha
2011-02-02 19:36:34 +00:00
parent 1303b5e87f
commit b5857edbfd
3 changed files with 5 additions and 4 deletions

View File

@@ -221,13 +221,14 @@ function resendEmails() {
function unpauseApplications() { function unpauseApplications() {
global $sFilter; global $sFilter;
global $sNow;
if($sFilter!='' && strpos($sFilter, 'unpause') === false) return false; if($sFilter!='' && strpos($sFilter, 'unpause') === false) return false;
setExecutionMessage("Unpausing applications"); setExecutionMessage("Unpausing applications");
try { try {
G::LoadClass('case'); G::LoadClass('case');
$oCases = new Cases(); $oCases = new Cases();
$oCases->ThrowUnpauseDaemon(); $oCases->ThrowUnpauseDaemon($sNow);
setExecutionResultMessage('DONE'); setExecutionResultMessage('DONE');
saveLog('unpauseApplications', 'action', 'Unpausing Applications'); saveLog('unpauseApplications', 'action', 'Unpausing Applications');
} }

View File

@@ -2819,8 +2819,8 @@ class Cases {
* @Description: This method set all cases with the APP_DISABLE_ACTION_DATE for today * @Description: This method set all cases with the APP_DISABLE_ACTION_DATE for today
* @return void * @return void
*/ */
function ThrowUnpauseDaemon() { function ThrowUnpauseDaemon($today) {
$today = date('Y-m-d'); $today = ($today==date('Y-m-d'))?date('Y-m-d'):$today;
$c = new Criteria('workflow'); $c = new Criteria('workflow');
$c->clearSelectColumns(); $c->clearSelectColumns();
$c->add($c->getNewCriterion(AppDelayPeer::APP_DISABLE_ACTION_USER, null, Criteria::ISNULL)->addOr($c->getNewCriterion(AppDelayPeer::APP_DISABLE_ACTION_USER, 0))); $c->add($c->getNewCriterion(AppDelayPeer::APP_DISABLE_ACTION_USER, null, Criteria::ISNULL)->addOr($c->getNewCriterion(AppDelayPeer::APP_DISABLE_ACTION_USER, 0)));

View File

@@ -60,7 +60,7 @@ $oCases = new Cases();
/** here we verify if there is a any case with a unpause on this day*/ /** here we verify if there is a any case with a unpause on this day*/
if( $sTypeList === 'to_do' or $sTypeList === 'draft' or $sTypeList === 'paused') { if( $sTypeList === 'to_do' or $sTypeList === 'draft' or $sTypeList === 'paused') {
$oCases->ThrowUnpauseDaemon(); $oCases->ThrowUnpauseDaemon(date('Y-m-d'));
} }
/* * /* *