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() {
global $sFilter;
global $sNow;
if($sFilter!='' && strpos($sFilter, 'unpause') === false) return false;
setExecutionMessage("Unpausing applications");
try {
G::LoadClass('case');
$oCases = new Cases();
$oCases->ThrowUnpauseDaemon();
$oCases->ThrowUnpauseDaemon($sNow);
setExecutionResultMessage('DONE');
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
* @return void
*/
function ThrowUnpauseDaemon() {
$today = date('Y-m-d');
function ThrowUnpauseDaemon($today) {
$today = ($today==date('Y-m-d'))?date('Y-m-d'):$today;
$c = new Criteria('workflow');
$c->clearSelectColumns();
$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*/
if( $sTypeList === 'to_do' or $sTypeList === 'draft' or $sTypeList === 'paused') {
$oCases->ThrowUnpauseDaemon();
$oCases->ThrowUnpauseDaemon(date('Y-m-d'));
}
/* *