Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
Francois Gaillard committed Aug 21, 2015
2 parents b9a4dd3 + 901a9ee commit 7026788
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion classes/CronJobsForms.php
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ protected static function getDaysofWeekFormOptions()
$data = array(array('id' => '-1', 'name' => self::$module->l('Every day of the week', 'CronJobsForms')));

for ($day = 1; $day <= 7; $day += 1)
$data[] = array('id' => $day, 'name' => self::$module->l(date('l', mktime(0, 0, 0, 0, $day))));
$data[] = array('id' => $day, 'name' => self::$module->l(date('l', strtotime('Sunday +' . $day . ' days'))));

return $data;
}
Expand Down
4 changes: 2 additions & 2 deletions controllers/admin/AdminCronJobsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ protected function runModulesCrons()

if ($module == false)
{
Db::getInstance()->execute('DELETE FROM '._DB_PREFIX_.$this->name.' WHERE `id_cronjob` = \''.(int)$cron['id_cronjob'].'\'');
Db::getInstance()->execute('DELETE FROM '._DB_PREFIX_.$this->module->name.' WHERE `id_cronjob` = \''.(int)$cron['id_cronjob'].'\'');
break;
}
elseif ($this->shouldBeExecuted($cron) == true)
Expand Down Expand Up @@ -100,7 +100,7 @@ protected function shouldBeExecuted($cron)
$hour = ($cron['hour'] == -1) ? date('H') : $cron['hour'];
$day = ($cron['day'] == -1) ? date('d') : $cron['day'];
$month = ($cron['month'] == -1) ? date('m') : $cron['month'];
$day_of_week = ($cron['day_of_week'] == -1) ? date('D') : date('D', strtotime('Sunday +'.($cron['day_of_week'] - 1).' days'));
$day_of_week = ($cron['day_of_week'] == -1) ? date('D') : date('D', strtotime('Sunday +' . $cron['day_of_week'] . ' days'));

$day = date('Y').'-'.str_pad($month, 2, '0', STR_PAD_LEFT).'-'.str_pad($day, 2, '0', STR_PAD_LEFT);
$execution = $day_of_week.' '.$day.' '.str_pad($hour, 2, '0', STR_PAD_LEFT);
Expand Down

0 comments on commit 7026788

Please sign in to comment.