30require
'../main.inc.php';
39require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
40require_once DOL_DOCUMENT_ROOT.
'/cron/class/cronjob.class.php';
41require_once DOL_DOCUMENT_ROOT.
'/core/lib/cron.lib.php';
42require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
45$langs->loadLangs(array(
"admin",
"cron",
"bills",
"members"));
47$action =
GETPOST(
'action',
'aZ09');
48$massaction =
GETPOST(
'massaction',
'alpha');
49$confirm =
GETPOST(
'confirm',
'alpha');
50$toselect =
GETPOST(
'toselect',
'array:int');
51$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'cronjoblist';
52$optioncss =
GETPOST(
'optioncss',
'alpha');
56$search_status =
GETPOST(
'search_status',
'intcomma');
57$search_label =
GETPOST(
"search_label",
'alpha');
58$search_module_name =
GETPOST(
"search_module_name",
'alpha');
59$search_lastresult =
GETPOST(
"search_lastresult",
"alphawithlgt");
60$search_processing =
GETPOST(
"search_processing",
'int');
61$securitykey =
GETPOST(
'securitykey',
'alpha');
67$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
68$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
70if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
74$offset = $limit * $page;
78$outputdir = $conf->cron->dir_output;
79if (empty($outputdir)) {
80 $outputdir = $conf->cronjob->dir_output;
86$diroutputmassaction = $outputdir.
'/temp/massgeneration/'.$user->id;
87$hookmanager->initHooks(array(
'cronjoblist'));
90$extrafields->fetch_name_optionals_label(
$object->table_element);
92$search_array_options = $extrafields->getOptionalsFromPost(
$object->table_element,
'',
'search_');
96 $sortfield =
't.priority,t.status';
99 $sortorder =
'ASC,DESC';
103$fieldstosearchall = array();
119$arrayfields = array();
140$permissiontoread = $user->hasRight(
'cron',
'read');
141$permissiontoadd = $user->hasRight(
'cron',
'create') ? $user->hasRight(
'cron',
'create') : $user->hasRight(
'cron',
'write');
142$permissiontodelete = $user->hasRight(
'cron',
'delete');
143$permissiontoexecute = $user->hasRight(
'cron',
'execute');
146if (!$permissiontoread) {
159if (
GETPOST(
'cancel',
'alpha')) {
163if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
167$parameters = array(
'arrayfields' => &$arrayfields);
168$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
173if (empty($reshook)) {
175 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
178 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
181 $search_lastresult =
'';
184 $search_array_options = array();
186 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')
187 ||
GETPOST(
'button_search_x',
'alpha') ||
GETPOST(
'button_search.x',
'alpha') ||
GETPOST(
'button_search',
'alpha')) {
192 if (!empty($search_label)) {
193 $filter[
't.label'] = $search_label;
197 if ($action ==
'confirm_delete' && $confirm ==
"yes" && $permissiontodelete) {
201 $result =
$object->delete($user);
209 if ($action ==
'confirm_execute' && $confirm ==
"yes" && $permissiontoexecute) {
219 $resrunjob =
$object->run_jobs($user->login);
220 if ($resrunjob < 0) {
225 $res =
$object->reprogram_jobs($user->login, $now);
227 if ($resrunjob >= 0) {
228 if (
$object->lastresult >= 0) {
240 $param =
'&search_status='.urlencode($search_status);
241 if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
242 $param .=
'&contextpage='.urlencode($contextpage);
244 if ($limit > 0 && $limit != $conf->liste_limit) {
245 $param .=
'&limit='.((int) $limit);
248 $param .=
'&search_label='.urlencode($search_label);
250 if ($optioncss !=
'') {
251 $param .=
'&optioncss='.urlencode($optioncss);
254 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
256 header(
"Location: ".DOL_URL_ROOT.
'/cron/list.php?'.$param.
'&sortfield='.$sortfield.
'&sortorder='.$sortorder);
262 $objectclass =
'CronJob';
263 $objectlabel =
'CronJob';
264 $uploaddir = $conf->cron->dir_output;
265 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
266 if ($massaction && $permissiontoadd) {
268 foreach ($toselect as
$id) {
269 $result = $tmpcron->fetch(
$id);
272 if ($massaction ==
'disable') {
273 $result = $tmpcron->setStatut(Cronjob::STATUS_DISABLED);
274 } elseif ($massaction ==
'enable') {
275 $result = $tmpcron->setStatut(Cronjob::STATUS_ENABLED);
295$form =
new Form($db);
298$title = $langs->trans(
"CronList");
300llxHeader(
'', $title,
'',
'', 0, 0,
'',
'',
'',
'bodyforlist');
302$TTestNotAllowed = array();
303$sqlTest =
'SELECT rowid, test FROM '.MAIN_DB_PREFIX.
'cronjob';
304$resultTest = $db->query($sqlTest);
306 while ($objTest = $db->fetch_object($resultTest)) {
309 $TTestNotAllowed[$objTest->rowid] = $objTest->rowid;
320$sql .=
" t.jobtype,";
322$sql .=
" t.command,";
323$sql .=
" t.classesname,";
324$sql .=
" t.objectname,";
325$sql .=
" t.methodename,";
327$sql .=
" t.md5params,";
328$sql .=
" t.module_name,";
329$sql .=
" t.priority,";
330$sql .=
" t.processing,";
331$sql .=
" t.datelastrun,";
332$sql .=
" t.datenextrun,";
333$sql .=
" t.dateend,";
334$sql .=
" t.datestart,";
335$sql .=
" t.lastresult,";
336$sql .=
" t.datelastresult,";
337$sql .=
" t.lastoutput,";
338$sql .=
" t.unitfrequency,";
339$sql .=
" t.frequency,";
341$sql .=
" t.fk_user_author,";
342$sql .=
" t.fk_user_mod,";
346$sql .=
" t.libname,";
348$sql .=
" FROM ".MAIN_DB_PREFIX.
"cronjob as t";
349$sql .=
" WHERE entity IN (0,".$conf->entity.
")";
350if (!empty($TTestNotAllowed)) {
351 $sql .=
' AND t.rowid NOT IN ('.$db->sanitize(implode(
',', $TTestNotAllowed)).
')';
353if ($search_status >= 0 && $search_status < 2 && $search_status !=
'') {
354 $sql .=
" AND t.status = ".(empty($search_status) ?
'0' :
'1');
356if ($search_lastresult !=
'') {
359if (GETPOSTISSET(
'search_processing')) {
360 $sql .=
" AND t.processing = ".((int) $search_processing);
363if (is_array($filter) && count($filter) > 0) {
364 foreach ($filter as $key => $value) {
365 $sql .=
" AND ".$db->sanitize($key).
" LIKE '%".$db->escape($value).
"%'";
368if (!empty($search_module_name)) {
372include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
374$parameters = array();
375$reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object, $action);
376$sql .= $hookmanager->resPrint;
380$nbtotalofrecords =
'';
384 $resql = $db->query($sqlforcount);
386 $nbtotalofrecords = $db->num_rows($resql);
391 if (($page * $limit) > (
int) $nbtotalofrecords) {
399$sql .= $db->order($sortfield, $sortorder);
401 $sql .= $db->plimit($limit + 1, $offset);
404$resql = $db->query($sql);
410$num = $db->num_rows($resql);
412$arrayofselected = is_array($toselect) ? $toselect : array();
416 $param .=
'&mode='.urlencode($mode);
418if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
419 $param .=
'&contextpage='.urlencode($contextpage);
421if ($limit > 0 && $limit != $conf->liste_limit) {
422 $param .=
'&limit='.((int) $limit);
424if ($optioncss !=
'') {
425 $param .=
'&optioncss='.urlencode($optioncss);
428 $param .=
'&search_status='.urlencode($search_status);
431 $param .=
'&search_label='.urlencode($search_label);
433if ($search_module_name) {
434 $param .=
'&search_module_name='.urlencode($search_module_name);
436if ($search_lastresult) {
437 $param .=
'&search_lastresult='.urlencode($search_lastresult);
440include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
444if ($action ==
'execute') {
445 print $form->formconfirm($_SERVER[
'PHP_SELF'].
"?id=".
$id.
'&securitykey='.$securitykey.$param, $langs->trans(
"CronExecute"), $langs->trans(
"CronConfirmExecute"),
"confirm_execute",
'',
'', 1);
448if ($action ==
'delete' && empty($toselect)) {
449 print $form->formconfirm($_SERVER[
'PHP_SELF'].
"?id=".
$id.$param, $langs->trans(
"CronDelete"), $langs->trans(
"CronConfirmDelete"),
"confirm_delete",
'',
'', 1);
453$arrayofmassactions = array(
456 'enable' =>
img_picto(
'',
'check',
'class="pictofixedwidth"').$langs->trans(
"CronStatusActiveBtn"),
457 'disable' =>
img_picto(
'',
'uncheck',
'class="pictofixedwidth"').$langs->trans(
"CronStatusInactiveBtn"),
459if ($user->hasRight(
'cron',
'delete')) {
460 $arrayofmassactions[
'predelete'] =
img_picto(
'',
'delete',
'class="pictofixedwidth"').$langs->trans(
"Delete");
462if (
GETPOSTINT(
'nomassaction') || in_array($massaction, array(
'presend',
'predelete'))) {
463 $arrayofmassactions = array();
465$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
468if ($mode ==
'modulesetup') {
469 $linkback =
'<a href="'.dolBuildUrl(DOL_URL_ROOT.
'/admin/modules.php', [
'restore_lastsearch_values' => 1]).
'">'.
img_picto($langs->trans(
"BackToModuleList"),
'back',
'class="pictofixedwidth"').
'<span class="hideonsmartphone">'.$langs->trans(
"BackToModuleList").
'</span></a>';
470 print
load_fiche_titre($langs->trans(
"CronSetup"), $linkback,
'title_setup');
476print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'" name="search_form">'.
"\n";
477if ($optioncss !=
'') {
478 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
480print
'<input type="hidden" name="token" value="'.newToken().
'">';
481print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
482print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
483print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
484print
'<input type="hidden" name="page" value="'.$page.
'">';
485print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
486print
'<input type="hidden" name="page_y" value="">';
487print
'<input type="hidden" name="mode" value="'.$mode.
'">';
490$newcardbutton =
dolGetButtonTitle($langs->trans(
'New'), $langs->trans(
'CronCreateJob'),
'fa fa-plus-circle', DOL_URL_ROOT.
'/cron/card.php?action=create&backtopage='.urlencode($_SERVER[
'PHP_SELF'].
'?mode=modulesetup'),
'', $user->hasRight(
'cron',
'create'));
493if ($mode ==
'modulesetup') {
500print_barre_liste($title, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, ($mode ==
'modulesetup' ?
'' :
'title_setup'), 0, $newcardbutton,
'', $limit);
503$topicmail =
"SendCronRef";
506$trackid =
'cron'.$object->id;
507include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
509$text = $langs->trans(
"HoursOnThisPageAreOnServerTZ").
' '.$stringcurrentdate.
'<br>';
511 $text .= $langs->trans(
"WarningCronDelayed",
getDolGlobalString(
'CRON_WARNING_DELAY_HOURS'));
518$parameters = array();
519$reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object, $action);
520if (empty($reshook)) {
521 $moreforfilter .= $hookmanager->resPrint;
523 $moreforfilter = $hookmanager->resPrint;
526 'arrayfields' => &$arrayfields,
529if (!empty($moreforfilter)) {
530 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
531 print $moreforfilter;
535$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
536$htmlofselectarray = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage, $conf->main_checkbox_left_column);
537$selectedfields = (($mode !=
'kanban' && $mode !=
'kanbangroupby') ? $htmlofselectarray :
'');
538$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons(
'checkforselect', 1) :
'');
540print
'<div class="div-table-responsive">';
541print
'<table class="tagtable nobottomiftotal noborder liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
545print
'<tr class="liste_titre_filter">';
548 print
'<td class="liste_titre center maxwidthsearch">';
549 $searchpicto = $form->showFilterButtons(
'left');
553print
'<td class="liste_titre"> </td>';
554print
'<td class="liste_titre">';
555print
'<input type="text" class="flat width75" name="search_label" value="'.$search_label.
'">';
557print
'<td class="liste_titre"> </td>';
558print
'<td class="liste_titre"><input type="text" class="width50" name="search_module_name" value="'.$search_module_name.
'"></td>';
559print
'<td class="liste_titre"> </td>';
560print
'<td class="liste_titre"> </td>';
563print
'<td class="liste_titre"> </td>';
564print
'<td class="liste_titre"> </td>';
565print
'<td class="liste_titre"> </td>';
566print
'<td class="liste_titre center"><input type="text" class="width50" name="search_lastresult" value="'.$search_lastresult.
'"></td>';
567print
'<td class="liste_titre"> </td>';
568print
'<td class="liste_titre"> </td>';
569print
'<td class="liste_titre center">';
570print $form->selectarray(
'search_status', array(
'0' => $langs->trans(
"Disabled"),
'1' => $langs->trans(
"Scheduled")), $search_status, 1, 0, 0,
'', 0, 0, 0,
'',
'search_status width100 onrightofpage');
572print
'<td class="liste_titre"> </td>';
575 print
'<td class="liste_titre right">';
576 $searchpicto = $form->showFilterButtons();
587print
'<tr class="liste_titre">';
590 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
"", $param,
'', $sortfield, $sortorder,
'center maxwidthsearch ');
594print_liste_field_titre(
"Priority", $_SERVER[
"PHP_SELF"],
"t.priority",
"", $param,
'', $sortfield, $sortorder);
595print_liste_field_titre(
"CronModule", $_SERVER[
"PHP_SELF"],
"t.module_name",
"", $param,
'', $sortfield, $sortorder);
600print_liste_field_titre(
"CronNbRun", $_SERVER[
"PHP_SELF"],
"t.nbrun",
"", $param,
'', $sortfield, $sortorder,
'right tdoverflowmax50 maxwidth50imp ');
601print_liste_field_titre(
"CronDtLastLaunch", $_SERVER[
"PHP_SELF"],
"t.datelastrun",
"", $param,
'', $sortfield, $sortorder,
'center tdoverflowmax100 ');
602print_liste_field_titre(
"Duration", $_SERVER[
"PHP_SELF"],
"",
"", $param,
'', $sortfield, $sortorder,
'center ');
603print_liste_field_titre(
"CronLastResult", $_SERVER[
"PHP_SELF"],
"t.lastresult",
"", $param,
'', $sortfield, $sortorder,
'center ');
604print_liste_field_titre(
"CronLastOutput", $_SERVER[
"PHP_SELF"],
"t.lastoutput",
"", $param,
'', $sortfield, $sortorder);
605print_liste_field_titre(
"CronDtNextLaunch", $_SERVER[
"PHP_SELF"],
"t.datenextrun",
"", $param,
'', $sortfield, $sortorder,
'center ');
606print_liste_field_titre(
"Status", $_SERVER[
"PHP_SELF"],
"t.status,t.priority",
"", $param,
'', $sortfield, $sortorder,
'center ');
610 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
"", $param,
'', $sortfield, $sortorder,
'center maxwidthsearch ');
620$imaxinloop = ($limit ? min($num, $limit) : $num);
625 while ($i < $imaxinloop) {
626 $obj = $db->fetch_object($resql);
632 if (preg_match(
'/:(.*)$/', $obj->label, $reg)) {
633 $langs->load($reg[1]);
638 $object->label = preg_replace(
'/:.*$/',
'', $obj->label);
639 $object->status = $obj->status;
640 $object->priority = $obj->priority;
641 $object->processing = $obj->processing;
642 $object->lastresult = (string) $obj->lastresult;
643 $object->datestart = $db->jdate($obj->datestart);
644 $object->dateend = $db->jdate($obj->dateend);
645 $object->module_name = $obj->module_name;
646 $object->params = $obj->params;
647 $object->datelastrun = $db->jdate($obj->datelastrun);
648 $object->datenextrun = $db->jdate($obj->datenextrun);
650 $datelastrun = $db->jdate($obj->datelastrun);
651 $datelastresult = $db->jdate($obj->datelastresult);
652 $datefromto = (empty($datelastrun) ?
'' :
dol_print_date($datelastrun,
'dayhoursec',
'tzserver')).
' - '.(empty($datelastresult) ?
'' :
dol_print_date($datelastresult,
'dayhoursec',
'tzserver'));
655 print
'<tr class="oddeven row-with-select">';
659 print
'<td class="nowraponall center">';
660 if ($massactionbutton || $massaction) {
662 if (in_array($obj->rowid, $arrayofselected)) {
665 print
'<input id="cb'.$obj->rowid.
'" class="flat checkforselect valignmiddle" type="checkbox" name="toselect[]" value="'.$obj->rowid.
'"'.($selected ?
' checked="checked"' :
'').
'>';
674 print
'<td class="nowraponall">';
682 print
'<td class="minwidth150">';
685 print
'<div class="small twolinesmax lineheightsmall minwidth150 maxwidth250 classfortooltip" title="'.dol_escape_htmltag($langs->trans(
$object->label), 0, 0).
'">';
686 print
$object->getNomUrl(0,
'', 1);
698 print
'<td class="right">';
711 print
'<td class="nowraponall">';
712 if ($obj->jobtype ==
'method') {
714 $texttoshow =
'<b>'.$langs->trans(
"CronType_method").
'</b><br><br>';
715 $texttoshow .= $langs->trans(
'CronModule').
': '.$obj->module_name.
'<br>';
716 $texttoshow .= $langs->trans(
'CronClass').
': '.$obj->classesname.
'<br>';
717 $texttoshow .= $langs->trans(
'CronObject').
': '.$obj->objectname.
'<br>';
718 $texttoshow .= $langs->trans(
'CronMethod').
': '.$obj->methodename;
719 $texttoshow .=
'<br>'.$langs->trans(
'CronArgs').
': '.$obj->params;
720 $texttoshow .=
'<br>'.$langs->trans(
'Comment').
': '.$langs->trans($obj->note);
721 } elseif ($obj->jobtype ==
'command') {
723 $texttoshow =
'<b>'.$langs->trans(
'CronType_command').
'</b><br><br>';
724 $texttoshow .= $langs->trans(
'CronCommand').
': '.
dol_trunc($obj->command);
725 $texttoshow .=
'<br>'.$langs->trans(
'CronArgs').
': '.$obj->params;
726 $texttoshow .=
'<br>'.$langs->trans(
'Comment').
': '.$langs->trans($obj->note);
731 print
'<span class="classfortooltip" title="'.dol_escape_htmltag($texttoshow, 1, 1).
'">'.$text.
'</a>';
739 if ($obj->unitfrequency ==
"60") {
740 $s = ($obj->frequency).
" ".$langs->trans(
'MinuteShort');
741 } elseif ($obj->unitfrequency ==
"3600") {
742 $s = ($obj->frequency).
" ".$langs->trans(
'HourShort');
743 } elseif ($obj->unitfrequency ==
"86400") {
744 $s = ($obj->frequency).
" ".($obj->frequency > 1 ? $langs->trans(
'DurationDays') : $langs->trans(
'DurationDay'));
745 } elseif ($obj->unitfrequency ==
"604800") {
746 $s = ($obj->frequency).
" ".($obj->frequency > 1 ? $langs->trans(
'DurationWeeks') : $langs->trans(
'DurationWeek'));
747 } elseif ($obj->unitfrequency ==
"2678400") {
748 $s = ($obj->frequency).
" ".($obj->frequency > 1 ? $langs->trans(
'DurationMonths') : $langs->trans(
'DurationMonth'));
750 print
'<td class="tdoverflowmax125 center" title="'.dol_escape_htmltag($s).
'">';
777 print
'<td class="right">';
778 if (!empty($obj->nbrun)) {
783 if (!empty($obj->maxrun)) {
784 print
' <span class="'.$langs->trans(
"Max").
'">/ '.
dol_escape_htmltag($obj->maxrun).
'</span>';
792 print
'<td class="center lineheightsmall" title="'.dol_escape_htmltag($datefromto).
'">';
793 if (!empty($datelastrun)) {
802 print
'<td class="center nowraponall" title="'.dol_escape_htmltag($datefromto).
'">';
803 if (!empty($datelastresult) && ($datelastresult >= $datelastrun)) {
804 $nbseconds = max($datelastresult - $datelastrun, 1);
805 print $nbseconds.
' '.$langs->trans(
"SecondShort");
813 print
'<td class="center tdlastresultcode" title="'.dol_escape_htmltag($obj->lastresult).
'">';
814 if ($obj->lastresult !=
'') {
815 if (empty($obj->lastresult) || $obj->status == Cronjob::STATUS_DISABLED) {
816 print $obj->lastresult;
818 print
'<span class="error">'.dol_escape_htmltag(
dol_trunc($obj->lastresult)).
'</div>';
827 print
'<td class="small minwidth150">';
828 if (!empty($obj->lastoutput)) {
829 print
'<div class="twolinesmax lineheightsmall classfortooltip" title="'.dolPrintHTMLForAttribute($obj->lastoutput).
'">';
839 print
'<td class="center lineheightsmall">';
840 if (!empty($obj->datenextrun)) {
841 $datenextrun = $db->jdate($obj->datenextrun);
842 if (empty($obj->status)) {
843 print
'<span class="opacitymedium strikefordisabled">';
846 if ($obj->status == Cronjob::STATUS_ENABLED) {
847 if ($obj->maxrun && $obj->nbrun >= $obj->maxrun) {
849 } elseif ($datenextrun && $datenextrun < $now) {
853 if (empty($obj->status)) {
863 print
'<td class="center">';
864 print
$object->getLibStatut(5);
871 print
'<td class="nowraponall right">';
872 $backtopage = urlencode($_SERVER[
"PHP_SELF"].
'?'.$param.
'&sortfield='.$sortfield.
'&sortorder='.$sortorder);
873 if ($user->hasRight(
'cron',
'create')) {
874 print
'<a class="editfielda" href="'.DOL_URL_ROOT.
"/cron/card.php?id=".$obj->rowid.
'&action=edit&token='.
newToken().
'&sortfield='.$sortfield.
'&sortorder='.$sortorder.$param;
875 print
"&backtopage=".$backtopage.
"\" title=\"".
dol_escape_htmltag($langs->trans(
'Edit')).
"\">".
img_picto($langs->trans(
'Edit'),
'edit').
"</a> ";
877 if ($user->hasRight(
'cron',
'delete')) {
878 print
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
"?id=".$obj->rowid.
'&action=delete&token='.
newToken().($page ?
'&page='.$page :
'').
'&sortfield='.$sortfield.
'&sortorder='.$sortorder.$param;
879 print
'" title="'.dol_escape_htmltag($langs->trans(
'CronDelete')).
'">'.
img_picto($langs->trans(
'CronDelete'),
'delete',
'', 0, 0, 0,
'',
'marginleftonly').
'</a> ';
881 print
'<a href="#" title="'.dol_escape_htmltag($langs->trans(
'NotEnoughPermissions')).
'">'.
img_picto($langs->trans(
'NotEnoughPermissions'),
'delete',
'', 0, 0, 0,
'',
'marginleftonly').
'</a> ';
883 if ($user->hasRight(
'cron',
'execute')) {
884 if (!empty($obj->status)) {
885 print
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?id='.$obj->rowid.
'&action=execute&token='.
newToken();
887 print
'&sortfield='.$sortfield;
888 print
'&sortorder='.$sortorder;
889 print $param.
"\" title=\"".
dol_escape_htmltag($langs->trans(
'CronExecute')).
"\">".
img_picto($langs->trans(
'CronExecute'),
"play",
'', 0, 0, 0,
'',
'marginleftonly').
'</a>';
891 print
'<a href="#" class="cursordefault" title="'.dol_escape_htmltag($langs->trans(
'JobDisabled')).
'">'.
img_picto($langs->trans(
'JobDisabled'),
"playdisabled",
'', 0, 0, 0,
'',
'marginleftonly').
'</a>';
894 print
'<a href="#" class="cursornotallowed" title="'.dol_escape_htmltag($langs->trans(
'NotEnoughPermissions')).
'">'.
img_picto($langs->trans(
'NotEnoughPermissions'),
"playdisabled",
'', 0, 0, 0,
'',
'marginleftonly').
'</a>';
903 print
'<td class="nowraponall center">';
904 if ($massactionbutton || $massaction) {
906 if (in_array($obj->rowid, $arrayofselected)) {
909 print
'<input id="cb'.$obj->rowid.
'" class="flat checkforselect valignmiddle" type="checkbox" name="toselect[]" value="'.$obj->rowid.
'"'.($selected ?
' checked="checked"' :
'').
'>';
922 print
'<tr><td colspan="16"><span class="opacitymedium">'.$langs->trans(
'CronNoJobs').
'</span></td></tr>';
927$parameters = array(
'arrayfields' => $arrayfields,
'sql' => $sql);
928$reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object, $action);
929print $hookmanager->resPrint;
931print
'</table>'.
"\n";
936if ($mode ==
'modulesetup') {
$id
Support class for third parties, contacts, members, users or resources.
if(! $sortfield) if(! $sortorder) $object
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
cronadmin_prepare_head()
Return array of tabs to used on pages to setup cron module.
dol_now($mode='gmt')
Return date for now.
verifCond($strToEvaluate, $onlysimplestring='1')
Verify if condition in string is ok or not.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
print_liste_field_titre($name, $file="", $field="", $begin="", $param="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
print_barre_liste($title, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='generic', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $selectlimitsuffix=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow='')
Print a title with navigation controls for pagination.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2, $allowothertags=array())
Show picto whatever it's its name (generic function)
img_warning($titlealt='default', $moreatt='', $morecss='pictowarning')
Show warning logo.
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dolGetFirstLineOfText($text, $nboflines=1, $charset='UTF-8')
Return first line of text.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0, $morecssdiv='')
Show tabs of a record.
dolGetButtonTitle($label, $helpText='', $iconClass='fa fa-file', $url='', $id='', $status=1, $params=array())
Function dolGetButtonTitle : this kind of buttons are used in title in list.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
natural_search($fields, $value, $mode=0, $nofirstand=0, $sqltoadd='')
Generate natural SQL search string for a criteria (this criteria can be tested on one or several fiel...
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
dol_sort_array(&$array, $index, $order='asc', $natsort=0, $case_sensitive=0, $keepindex=0)
Advanced sort array by the value of a given key, which produces ascending (default) or descending out...
newToken()
Return the value of token currently saved into session with name 'newtoken'.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false, $decorate=0)
Output date in a string format according to outputlangs (or langs if not defined).
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='', $morecssonpicto='widthpictotitle')
Load a title with picto.
dol_trunc($string, $size=40, $trunc='right', $stringencoding='UTF-8', $nodot=0, $display=0)
Truncate a string to a particular length adding '…' if string larger than length.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
info_admin($text, $infoonimgalt=0, $nodiv=0, $admin='1', $morecss='hideonsmartphone', $textfordropdown='', $picto='')
Show information in HTML for admin users or standard users.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Returns text escaped for inclusion in HTML alt or title or value tags, or into values of HTML input f...
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.