diff --git a/htdocs/cron/card.php b/htdocs/cron/card.php index 4857523aaf5..dd30e67afab 100644 --- a/htdocs/cron/card.php +++ b/htdocs/cron/card.php @@ -95,9 +95,18 @@ if ($action == 'confirm_execute' && $confirm == "yes" && $user->rights->cron->ex } else { - if ($object->lastresult > 0) setEventMessage($langs->trans("JobFinished"),'warnings'); - else setEventMessage($langs->trans("JobFinished"),'mesgs'); - $action=''; + $res = $object->reprogram_jobs($user->login); + if ($res > 0) + { + if ($object->lastresult > 0) setEventMessage($langs->trans("JobFinished"),'warnings'); + else setEventMessage($langs->trans("JobFinished"),'mesgs'); + $action=''; + } + else + { + setEventMessage($object->error,'errors'); + $action=''; + } } } diff --git a/htdocs/cron/list.php b/htdocs/cron/list.php index 19a0d5cc3b1..28f16c1ad55 100644 --- a/htdocs/cron/list.php +++ b/htdocs/cron/list.php @@ -100,6 +100,21 @@ if ($action == 'confirm_execute' && $confirm == "yes" && $user->rights->cron->ex if ($result < 0) { setEventMessage($object->error,'errors'); } + else + { + $res = $object->reprogram_jobs($user->login); + if ($res > 0) + { + if ($object->lastresult > 0) setEventMessage($langs->trans("JobFinished"),'warnings'); + else setEventMessage($langs->trans("JobFinished"),'mesgs'); + $action=''; + } + else + { + setEventMessage($object->error,'errors'); + $action=''; + } + } header("Location: ".DOL_URL_ROOT.'/cron/list.php?status=-1'); // Make a call to avoid to run twice job when using back exit;