|
|
|
|
@@ -47,6 +47,7 @@ $sortorder=GETPOST('sortorder','alpha');
|
|
|
|
|
$sortfield=GETPOST('sortfield','alpha');
|
|
|
|
|
$page=GETPOST('page','int');
|
|
|
|
|
$status=GETPOST('status','int');
|
|
|
|
|
if ($status == '') $status=-2;
|
|
|
|
|
|
|
|
|
|
//Search criteria
|
|
|
|
|
$search_label=GETPOST("search_label",'alpha');
|
|
|
|
|
@@ -116,7 +117,7 @@ if ($action == 'confirm_execute' && $confirm == "yes" && $user->rights->cron->ex
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
header("Location: ".DOL_URL_ROOT.'/cron/list.php?status=-1'); // Make a call to avoid to run twice job when using back
|
|
|
|
|
header("Location: ".DOL_URL_ROOT.'/cron/list.php?status=-2'); // Make a call to avoid to run twice job when using back
|
|
|
|
|
exit;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -131,9 +132,25 @@ $pagetitle=$langs->trans("CronList");
|
|
|
|
|
|
|
|
|
|
llxHeader('',$pagetitle);
|
|
|
|
|
|
|
|
|
|
print load_fiche_titre($pagetitle,'','title_setup');
|
|
|
|
|
// list of jobs created
|
|
|
|
|
$object = new Cronjob($db);
|
|
|
|
|
$result=$object->fetch_all($sortorder, $sortfield, $limit, $offset, $status, $filter);
|
|
|
|
|
if ($result < 0)
|
|
|
|
|
{
|
|
|
|
|
setEventMessages($object->error, $object->errors, 'errors');
|
|
|
|
|
}
|
|
|
|
|
$nbtotalofrecord=0;
|
|
|
|
|
$num=count($object->lines);
|
|
|
|
|
|
|
|
|
|
$param='&page='.$page.'&status='.$status.'&search_label='.$search_label;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
print_barre_liste($pagetitle, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_setup');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
print $langs->trans('CronInfo');
|
|
|
|
|
print "<br><br>";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ($action == 'delete')
|
|
|
|
|
{
|
|
|
|
|
@@ -147,36 +164,25 @@ if ($action == 'execute')
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// list of jobs created
|
|
|
|
|
$object = new Cronjob($db);
|
|
|
|
|
$result=$object->fetch_all($sortorder, $sortfield, $limit, $offset, $status, $filter);
|
|
|
|
|
if ($result < 0)
|
|
|
|
|
{
|
|
|
|
|
setEventMessages($object->error, $object->errors, 'errors');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
print "<br><br>";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
print '<form method="GET" action="'.$url_form.'" name="search_form">'."\n";
|
|
|
|
|
print '<input type="hidden" name="status" value="'.$status.'" >';
|
|
|
|
|
|
|
|
|
|
print '<table width="100%" class="noborder">';
|
|
|
|
|
print '<tr class="liste_titre">';
|
|
|
|
|
$arg_url='&page='.$page.'&status='.$status.'&search_label='.$search_label;
|
|
|
|
|
print_liste_field_titre($langs->trans("ID"),$_SERVER["PHP_SELF"],"t.rowid","",$arg_url,'',$sortfield,$sortorder);
|
|
|
|
|
print_liste_field_titre($langs->trans("CronLabel"),$_SERVER["PHP_SELF"],"t.label","",$arg_url,'',$sortfield,$sortorder);
|
|
|
|
|
print_liste_field_titre($langs->trans("CronTask"),'','',"",$arg_url,'',$sortfield,$sortorder);
|
|
|
|
|
print_liste_field_titre($langs->trans("CronDtStart"),$_SERVER["PHP_SELF"],"t.datestart","",$arg_url,'',$sortfield,$sortorder);
|
|
|
|
|
print_liste_field_titre($langs->trans("CronDtEnd"),$_SERVER["PHP_SELF"],"t.dateend","",$arg_url,'',$sortfield,$sortorder);
|
|
|
|
|
print_liste_field_titre($langs->trans("CronDtLastLaunch"),$_SERVER["PHP_SELF"],"t.datelastrun","",$arg_url,'',$sortfield,$sortorder);
|
|
|
|
|
print_liste_field_titre($langs->trans("CronDtNextLaunch"),$_SERVER["PHP_SELF"],"t.datenextrun","",$arg_url,'',$sortfield,$sortorder);
|
|
|
|
|
print_liste_field_titre($langs->trans("CronFrequency"),'',"","",$arg_url,'',$sortfield,$sortorder);
|
|
|
|
|
print_liste_field_titre($langs->trans("CronNbRun"),$_SERVER["PHP_SELF"],"t.nbrun","",$arg_url,'',$sortfield,$sortorder);
|
|
|
|
|
print_liste_field_titre($langs->trans("CronLastResult"),$_SERVER["PHP_SELF"],"t.lastresult","",$arg_url,'',$sortfield,$sortorder);
|
|
|
|
|
print_liste_field_titre($langs->trans("CronLastOutput"),$_SERVER["PHP_SELF"],"t.lastoutput","",$arg_url,'',$sortfield,$sortorder);
|
|
|
|
|
print_liste_field_titre($langs->trans("Enabled"),$_SERVER["PHP_SELF"],"t.status","",$arg_url,'align="center"',$sortfield,$sortorder);
|
|
|
|
|
print_liste_field_titre($langs->trans("ID"),$_SERVER["PHP_SELF"],"t.rowid","",$param,'',$sortfield,$sortorder);
|
|
|
|
|
print_liste_field_titre($langs->trans("CronLabel"),$_SERVER["PHP_SELF"],"t.label","",$param,'',$sortfield,$sortorder);
|
|
|
|
|
print_liste_field_titre($langs->trans("CronTask"),'','',"",$param,'',$sortfield,$sortorder);
|
|
|
|
|
print_liste_field_titre($langs->trans("CronDtStart"),$_SERVER["PHP_SELF"],"t.datestart","",$param,'',$sortfield,$sortorder);
|
|
|
|
|
print_liste_field_titre($langs->trans("CronDtEnd"),$_SERVER["PHP_SELF"],"t.dateend","",$param,'',$sortfield,$sortorder);
|
|
|
|
|
print_liste_field_titre($langs->trans("CronDtLastLaunch"),$_SERVER["PHP_SELF"],"t.datelastrun","",$param,'',$sortfield,$sortorder);
|
|
|
|
|
print_liste_field_titre($langs->trans("CronDtNextLaunch"),$_SERVER["PHP_SELF"],"t.datenextrun","",$param,'',$sortfield,$sortorder);
|
|
|
|
|
print_liste_field_titre($langs->trans("CronFrequency"),'',"","",$param,'',$sortfield,$sortorder);
|
|
|
|
|
print_liste_field_titre($langs->trans("CronNbRun"),$_SERVER["PHP_SELF"],"t.nbrun","",$param,'',$sortfield,$sortorder);
|
|
|
|
|
print_liste_field_titre($langs->trans("CronMaxRun"),$_SERVER["PHP_SELF"],"t.maxrun","",$param,'',$sortfield,$sortorder);
|
|
|
|
|
print_liste_field_titre($langs->trans("CronLastResult"),$_SERVER["PHP_SELF"],"t.lastresult","",$param,'',$sortfield,$sortorder);
|
|
|
|
|
print_liste_field_titre($langs->trans("CronLastOutput"),$_SERVER["PHP_SELF"],"t.lastoutput","",$param,'',$sortfield,$sortorder);
|
|
|
|
|
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"t.status","",$param,'align="center"',$sortfield,$sortorder);
|
|
|
|
|
print_liste_field_titre('');
|
|
|
|
|
print "</tr>\n";
|
|
|
|
|
|
|
|
|
|
@@ -194,8 +200,9 @@ print '<td> </td>';
|
|
|
|
|
print '<td> </td>';
|
|
|
|
|
print '<td> </td>';
|
|
|
|
|
print '<td> </td>';
|
|
|
|
|
print '<td> </td>';
|
|
|
|
|
print '<td class="liste_titre" align="center">';
|
|
|
|
|
print $form->selectarray('status', array('0'=>$langs->trans("No"),'1'=>$langs->trans("Yes")), $status, 1);
|
|
|
|
|
print $form->selectarray('status', array('0'=>$langs->trans("Disabled"), '1'=>$langs->trans("Enabled"), '-2'=>$langs->trans("EnabledAndDisabled"), '2'=>$langs->trans("Archived")), $status, 1);
|
|
|
|
|
print '</td><td class="liste_titre" align="right">';
|
|
|
|
|
print '<input class="liste_titre" type="image" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
|
|
|
|
|
print '<input type="image" class="liste_titre" name="button_removefilter" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
|
|
|
|
|
@@ -203,9 +210,9 @@ print '</td>';
|
|
|
|
|
print '</tr>';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (count($object->lines) > 0)
|
|
|
|
|
if ($num > 0)
|
|
|
|
|
{
|
|
|
|
|
// Loop on each active job
|
|
|
|
|
// Loop on each job
|
|
|
|
|
$style='pair';
|
|
|
|
|
foreach($object->lines as $line)
|
|
|
|
|
{
|
|
|
|
|
@@ -229,7 +236,7 @@ if (count($object->lines) > 0)
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
print $langs->trans('CronNone');
|
|
|
|
|
//print $langs->trans('CronNone');
|
|
|
|
|
}
|
|
|
|
|
print '</td>';
|
|
|
|
|
|
|
|
|
|
@@ -253,19 +260,19 @@ if (count($object->lines) > 0)
|
|
|
|
|
print '</td>';
|
|
|
|
|
|
|
|
|
|
print '<td>';
|
|
|
|
|
if(!empty($line->datestart)) {print dol_print_date($line->datestart,'dayhour');} else {print $langs->trans('CronNone');}
|
|
|
|
|
if(!empty($line->datestart)) {print dol_print_date($line->datestart,'dayhour');}
|
|
|
|
|
print '</td>';
|
|
|
|
|
|
|
|
|
|
print '<td>';
|
|
|
|
|
if(!empty($line->dateend)) {print dol_print_date($line->dateend,'dayhour');} else {print $langs->trans('CronNone');}
|
|
|
|
|
if(!empty($line->dateend)) {print dol_print_date($line->dateend,'dayhour');}
|
|
|
|
|
print '</td>';
|
|
|
|
|
|
|
|
|
|
print '<td>';
|
|
|
|
|
if(!empty($line->datelastrun)) {print dol_print_date($line->datelastrun,'dayhour');} else {print $langs->trans('CronNone');}
|
|
|
|
|
if(!empty($line->datelastrun)) {print dol_print_date($line->datelastrun,'dayhour');}
|
|
|
|
|
print '</td>';
|
|
|
|
|
|
|
|
|
|
print '<td>';
|
|
|
|
|
if(!empty($line->datenextrun)) {print dol_print_date($line->datenextrun,'dayhour');} else {print $langs->trans('CronNone');}
|
|
|
|
|
if(!empty($line->datenextrun)) {print dol_print_date($line->datenextrun,'dayhour');}
|
|
|
|
|
print '</td>';
|
|
|
|
|
|
|
|
|
|
print '<td>';
|
|
|
|
|
@@ -280,16 +287,22 @@ if (count($object->lines) > 0)
|
|
|
|
|
print '</td>';
|
|
|
|
|
|
|
|
|
|
print '<td>';
|
|
|
|
|
if(!empty($line->lastresult)) {print dol_trunc($line->lastresult);} else {print $langs->trans('CronNone');}
|
|
|
|
|
if (!empty($line->maxrun)) {print $line->maxrun;}
|
|
|
|
|
print '</td>';
|
|
|
|
|
|
|
|
|
|
print '<td>';
|
|
|
|
|
if(!empty($line->lastoutput)) {print dol_trunc(nl2br($line->lastoutput),100);} else {print $langs->trans('CronNone');}
|
|
|
|
|
if(!empty($line->lastresult)) {print dol_trunc($line->lastresult);}
|
|
|
|
|
print '</td>';
|
|
|
|
|
|
|
|
|
|
print '<td>';
|
|
|
|
|
if(!empty($line->lastoutput)) {print dol_trunc(nl2br($line->lastoutput),100);}
|
|
|
|
|
print '</td>';
|
|
|
|
|
|
|
|
|
|
// Status
|
|
|
|
|
print '<td align="center">';
|
|
|
|
|
print yn($line->status);
|
|
|
|
|
if ($line->status == 1) print $langs->trans("Enabled");
|
|
|
|
|
elseif ($line->status == 2) print $langs->trans("Archived");
|
|
|
|
|
else print $langs->trans("Disabled");
|
|
|
|
|
print '</td>';
|
|
|
|
|
|
|
|
|
|
print '<td align="right" class="nowrap">';
|
|
|
|
|
|