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');
68$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
69$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
71if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
75$offset = $limit * $page;
79$outputdir =
$conf->cron->dir_output;
80if (empty($outputdir)) {
81 $outputdir =
$conf->cronjob->dir_output;
87$diroutputmassaction = $outputdir.
'/temp/massgeneration/'.$user->id;
88$hookmanager->initHooks(array(
'cronjoblist'));
91$extrafields->fetch_name_optionals_label(
$object->table_element);
93$search_array_options = $extrafields->getOptionalsFromPost(
$object->table_element,
'',
'search_');
97 $sortfield =
't.priority,t.status';
100 $sortorder =
'ASC,DESC';
104$fieldstosearchall = array();
120$arrayfields = array();
122$parameters = array(
'arrayfields' => &$arrayfields);
123$reshook = $hookmanager->executeHooks(
'completeArrayFields', $parameters, $object, $action);
144$permissiontoread = $user->hasRight(
'cron',
'read');
145$permissiontoadd = $user->hasRight(
'cron',
'create') ? $user->hasRight(
'cron',
'create') : $user->hasRight(
'cron',
'write');
146$permissiontodelete = $user->hasRight(
'cron',
'delete');
147$permissiontoexecute = $user->hasRight(
'cron',
'execute');
150if (!$permissiontoread) {
163if (
GETPOST(
'cancel',
'alpha')) {
167if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
171$parameters = array(
'arrayfields' => &$arrayfields);
172$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
177if (empty($reshook)) {
179 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
182 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
185 $search_lastresult =
'';
186 $search_module_name =
'';
188 $search_array_options = array();
190 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')
191 ||
GETPOST(
'button_search_x',
'alpha') ||
GETPOST(
'button_search.x',
'alpha') ||
GETPOST(
'button_search',
'alpha')) {
196 if (!empty($search_label)) {
197 $filter[
't.label'] = $search_label;
201 if ($action ==
'confirm_delete' && $confirm ==
"yes" && $permissiontodelete) {
205 $result =
$object->delete($user);
213 if ($action ==
'confirm_execute' && $confirm ==
"yes" && $permissiontoexecute) {
223 $resrunjob =
$object->run_jobs($user->login);
224 if ($resrunjob < 0) {
229 $res =
$object->reprogram_jobs($user->login, $now);
231 if ($resrunjob >= 0) {
232 if (
$object->lastresult >= 0) {
244 $param =
'&search_status='.urlencode($search_status);
245 if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
246 $param .=
'&contextpage='.urlencode($contextpage);
248 if ($limit > 0 && $limit !=
$conf->liste_limit) {
249 $param .=
'&limit='.((int) $limit);
252 $param .=
'&search_label='.urlencode($search_label);
254 if ($optioncss !=
'') {
255 $param .=
'&optioncss='.urlencode($optioncss);
258 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
260 header(
"Location: ".DOL_URL_ROOT.
'/cron/list.php?'.$param.
'&sortfield='.$sortfield.
'&sortorder='.$sortorder);
266 $objectclass =
'CronJob';
267 $objectlabel =
'CronJob';
268 $uploaddir =
$conf->cron->dir_output;
269 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
270 if ($massaction && $permissiontoadd) {
272 foreach ($toselect as
$id) {
273 $result = $tmpcron->fetch(
$id);
276 if ($massaction ==
'disable') {
277 $result = $tmpcron->setStatut(Cronjob::STATUS_DISABLED);
278 } elseif ($massaction ==
'enable') {
279 $result = $tmpcron->setStatut(Cronjob::STATUS_ENABLED);
302$title = $langs->trans(
"CronList");
304llxHeader(
'', $title,
'',
'', 0, 0,
'',
'',
'',
'bodyforlist');
306$TTestNotAllowed = array();
307$sqlTest =
'SELECT rowid, test FROM '.MAIN_DB_PREFIX.
'cronjob';
308$resultTest =
$db->query($sqlTest);
310 while ($objTest =
$db->fetch_object($resultTest)) {
313 $TTestNotAllowed[$objTest->rowid] = $objTest->rowid;
324$sql .=
" t.jobtype,";
326$sql .=
" t.command,";
327$sql .=
" t.classesname,";
328$sql .=
" t.objectname,";
329$sql .=
" t.methodename,";
331$sql .=
" t.md5params,";
332$sql .=
" t.module_name,";
333$sql .=
" t.priority,";
334$sql .=
" t.processing,";
335$sql .=
" t.datelastrun,";
336$sql .=
" t.datenextrun,";
337$sql .=
" t.dateend,";
338$sql .=
" t.datestart,";
339$sql .=
" t.lastresult,";
340$sql .=
" t.datelastresult,";
341$sql .=
" t.lastoutput,";
342$sql .=
" t.unitfrequency,";
343$sql .=
" t.frequency,";
345$sql .=
" t.fk_user_author,";
346$sql .=
" t.fk_user_mod,";
350$sql .=
" t.libname,";
352$sql .=
" FROM ".MAIN_DB_PREFIX.
"cronjob as t";
353$sql .=
" WHERE entity IN (0,".((int)
$conf->entity).
")";
354if (!empty($TTestNotAllowed)) {
355 $sql .=
' AND t.rowid NOT IN ('.$db->sanitize(implode(
',', $TTestNotAllowed)).
')';
357if ($search_status >= 0 && $search_status < 2 && $search_status !=
'') {
358 $sql .=
" AND t.status = ".(empty($search_status) ?
'0' :
'1');
360if ($search_lastresult !=
'') {
363if (GETPOSTISSET(
'search_processing')) {
364 $sql .=
" AND t.processing = ".((int) $search_processing);
367if (count($filter) > 0) {
368 foreach ($filter as $key => $value) {
369 $sql .=
" AND ".$db->sanitize($key).
" LIKE '%".
$db->escape($value).
"%'";
372if (!empty($search_module_name)) {
376include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
378$parameters = array();
379$reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object, $action);
380$sql .= $hookmanager->resPrint;
384$nbtotalofrecords =
'';
388 $resql =
$db->query($sqlforcount);
390 $nbtotalofrecords =
$db->num_rows($resql);
395 if (($page * $limit) > (
int) $nbtotalofrecords) {
403$sql .=
$db->order($sortfield, $sortorder);
405 $sql .=
$db->plimit($limit + 1, $offset);
408$resql =
$db->query($sql);
414$num =
$db->num_rows($resql);
416$arrayofselected = is_array($toselect) ? $toselect : array();
420 $param .=
'&mode='.urlencode($mode);
422if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
423 $param .=
'&contextpage='.urlencode($contextpage);
425if ($limit > 0 && $limit !=
$conf->liste_limit) {
426 $param .=
'&limit='.((int) $limit);
428if ($optioncss !=
'') {
429 $param .=
'&optioncss='.urlencode($optioncss);
432 $param .=
'&search_status='.urlencode($search_status);
435 $param .=
'&search_label='.urlencode($search_label);
437if ($search_module_name) {
438 $param .=
'&search_module_name='.urlencode($search_module_name);
440if ($search_lastresult) {
441 $param .=
'&search_lastresult='.urlencode($search_lastresult);
444include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
448if ($action ==
'execute') {
449 print $form->formconfirm($_SERVER[
'PHP_SELF'].
"?id=".
$id.
'&securitykey='.$securitykey.$param, $langs->trans(
"CronExecute"), $langs->trans(
"CronConfirmExecute"),
"confirm_execute",
'',
'', 1);
452if ($action ==
'delete' && empty($toselect)) {
453 print $form->formconfirm($_SERVER[
'PHP_SELF'].
"?id=".
$id.$param, $langs->trans(
"CronDelete"), $langs->trans(
"CronConfirmDelete"),
"confirm_delete",
'',
'', 1);
457$arrayofmassactions = array(
460 'enable' =>
img_picto(
'',
'check',
'class="pictofixedwidth"').$langs->trans(
"CronStatusActiveBtn"),
461 'disable' =>
img_picto(
'',
'uncheck',
'class="pictofixedwidth"').$langs->trans(
"CronStatusInactiveBtn"),
463if ($user->hasRight(
'cron',
'delete')) {
464 $arrayofmassactions[
'predelete'] =
img_picto(
'',
'delete',
'class="pictofixedwidth"').$langs->trans(
"Delete");
466if (
GETPOSTINT(
'nomassaction') || in_array($massaction, array(
'presend',
'predelete'))) {
467 $arrayofmassactions = array();
469$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
472if ($mode ==
'modulesetup') {
473 $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>';
474 print
load_fiche_titre($langs->trans(
"CronSetup"), $linkback,
'title_setup');
480print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'" name="search_form">'.
"\n";
481if ($optioncss !=
'') {
482 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
484print
'<input type="hidden" name="token" value="'.newToken().
'">';
485print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
486print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
487print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
488print
'<input type="hidden" name="page" value="'.$page.
'">';
489print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
490print
'<input type="hidden" name="page_y" value="">';
491print
'<input type="hidden" name="mode" value="'.$mode.
'">';
494$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'));
497if ($mode ==
'modulesetup') {
504print_barre_liste($title, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, ($mode ==
'modulesetup' ?
'' :
'title_setup'), 0, $newcardbutton,
'', $limit);
507$topicmail =
"SendCronRef";
510$trackid =
'cron'.$object->id;
511include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
513$text = $langs->trans(
"HoursOnThisPageAreOnServerTZ").
' '.$stringcurrentdate.
'<br>';
515 $text .= $langs->trans(
"WarningCronDelayed",
getDolGlobalString(
'CRON_WARNING_DELAY_HOURS'));
522$parameters = array();
523$reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object, $action);
524if (empty($reshook)) {
525 $moreforfilter .= $hookmanager->resPrint;
527 $moreforfilter = $hookmanager->resPrint;
530 'arrayfields' => &$arrayfields,
533if (!empty($moreforfilter)) {
534 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
535 print $moreforfilter;
539$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
540$htmlofselectarray = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
$conf->main_checkbox_left_column);
541$selectedfields = (($mode !=
'kanban' && $mode !=
'kanbangroupby') ? $htmlofselectarray :
'');
542$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons(
'checkforselect', 1) :
'');
544print
'<div class="div-table-responsive">';
545print
'<table class="tagtable nobottomiftotal noborder liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
549print
'<tr class="liste_titre_filter">';
551if (
$conf->main_checkbox_left_column) {
552 print
'<td class="liste_titre center maxwidthsearch">';
553 $searchpicto = $form->showFilterButtons(
'left');
557print
'<td class="liste_titre"> </td>';
558print
'<td class="liste_titre">';
559print
'<input type="text" class="flat width75" name="search_label" value="'.$search_label.
'">';
561print
'<td class="liste_titre"> </td>';
562print
'<td class="liste_titre"><input type="text" class="width50" name="search_module_name" value="'.$search_module_name.
'"></td>';
563print
'<td class="liste_titre"> </td>';
564print
'<td class="liste_titre"> </td>';
567print
'<td class="liste_titre"> </td>';
568print
'<td class="liste_titre"> </td>';
569print
'<td class="liste_titre"> </td>';
570print
'<td class="liste_titre center"><input type="text" class="width50" name="search_lastresult" value="'.$search_lastresult.
'"></td>';
571print
'<td class="liste_titre"> </td>';
572print
'<td class="liste_titre"> </td>';
573print
'<td class="liste_titre center">';
574print $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');
576print
'<td class="liste_titre"> </td>';
578if (!
$conf->main_checkbox_left_column) {
579 print
'<td class="liste_titre right">';
580 $searchpicto = $form->showFilterButtons();
591print
'<tr class="liste_titre">';
593if (
$conf->main_checkbox_left_column) {
594 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
"", $param,
'', $sortfield, $sortorder,
'center maxwidthsearch ');
598print_liste_field_titre(
"Priority", $_SERVER[
"PHP_SELF"],
"t.priority",
"", $param,
'', $sortfield, $sortorder);
599print_liste_field_titre(
"CronModule", $_SERVER[
"PHP_SELF"],
"t.module_name",
"", $param,
'', $sortfield, $sortorder);
604print_liste_field_titre(
"CronNbRun", $_SERVER[
"PHP_SELF"],
"t.nbrun",
"", $param,
'', $sortfield, $sortorder,
'right tdoverflowmax50 maxwidth50imp ');
605print_liste_field_titre(
"CronDtLastLaunch", $_SERVER[
"PHP_SELF"],
"t.datelastrun",
"", $param,
'', $sortfield, $sortorder,
'center tdoverflowmax100 ');
606print_liste_field_titre(
"Duration", $_SERVER[
"PHP_SELF"],
"",
"", $param,
'', $sortfield, $sortorder,
'center ');
607print_liste_field_titre(
"CronLastResult", $_SERVER[
"PHP_SELF"],
"t.lastresult",
"", $param,
'', $sortfield, $sortorder,
'center ');
608print_liste_field_titre(
"CronLastOutput", $_SERVER[
"PHP_SELF"],
"t.lastoutput",
"", $param,
'', $sortfield, $sortorder);
609print_liste_field_titre(
"CronDtNextLaunch", $_SERVER[
"PHP_SELF"],
"t.datenextrun",
"", $param,
'', $sortfield, $sortorder,
'center ');
610print_liste_field_titre(
"Status", $_SERVER[
"PHP_SELF"],
"t.status,t.priority",
"", $param,
'', $sortfield, $sortorder,
'center ');
613if (!
$conf->main_checkbox_left_column) {
614 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
"", $param,
'', $sortfield, $sortorder,
'center maxwidthsearch ');
624$imaxinloop = ($limit ? min($num, $limit) : $num);
629 while ($i < $imaxinloop) {
630 $obj =
$db->fetch_object($resql);
636 if (preg_match(
'/:(.*)$/', $obj->label, $reg)) {
637 $langs->load($reg[1]);
642 $object->label = preg_replace(
'/:.*$/',
'', $obj->label);
643 $object->status = $obj->status;
644 $object->priority = $obj->priority;
645 $object->processing = $obj->processing;
647 $object->datestart =
$db->jdate($obj->datestart);
649 $object->module_name = $obj->module_name;
650 $object->params = $obj->params;
651 $object->datelastrun =
$db->jdate($obj->datelastrun);
652 $object->datenextrun =
$db->jdate($obj->datenextrun);
654 $datelastrun =
$db->jdate($obj->datelastrun);
655 $datelastresult =
$db->jdate($obj->datelastresult);
656 $datefromto = (empty($datelastrun) ?
'' :
dol_print_date($datelastrun,
'dayhoursec',
'tzserver')).
' - '.(empty($datelastresult) ?
'' :
dol_print_date($datelastresult,
'dayhoursec',
'tzserver'));
659 print
'<tr class="oddeven row-with-select">';
662 if (
$conf->main_checkbox_left_column) {
663 print
'<td class="nowraponall center">';
664 if ($massactionbutton || $massaction) {
666 if (in_array($obj->rowid, $arrayofselected)) {
669 print
'<input id="cb'.$obj->rowid.
'" class="flat checkforselect valignmiddle" type="checkbox" name="toselect[]" value="'.$obj->rowid.
'"'.($selected ?
' checked="checked"' :
'').
'>';
678 print
'<td class="nowraponall">';
686 print
'<td class="minwidth150">';
689 print
'<div class="small twolinesmax lineheightsmall minwidth150 maxwidth250 classfortooltip" title="'.dol_escape_htmltag($langs->trans(
$object->label), 0, 0).
'">';
690 print
$object->getNomUrl(0,
'', 1);
702 print
'<td class="right">';
715 print
'<td class="nowraponall">';
716 if ($obj->jobtype ==
'method') {
718 $texttoshow =
'<b>'.$langs->trans(
"CronType_method").
'</b><br><br>';
719 $texttoshow .= $langs->trans(
'CronModule').
': '.$obj->module_name.
'<br>';
720 $texttoshow .= $langs->trans(
'CronClass').
': '.$obj->classesname.
'<br>';
721 $texttoshow .= $langs->trans(
'CronObject').
': '.$obj->objectname.
'<br>';
722 $texttoshow .= $langs->trans(
'CronMethod').
': '.$obj->methodename;
723 $texttoshow .=
'<br>'.$langs->trans(
'CronArgs').
': '.$obj->params;
724 $texttoshow .=
'<br>'.$langs->trans(
'Comment').
': '.$langs->trans($obj->note);
725 } elseif ($obj->jobtype ==
'command') {
727 $texttoshow =
'<b>'.$langs->trans(
'CronType_command').
'</b><br><br>';
728 $texttoshow .= $langs->trans(
'CronCommand').
': '.
dol_trunc($obj->command);
729 $texttoshow .=
'<br>'.$langs->trans(
'CronArgs').
': '.$obj->params;
730 $texttoshow .=
'<br>'.$langs->trans(
'Comment').
': '.$langs->trans($obj->note);
735 print
'<span class="classfortooltip" title="'.dol_escape_htmltag($texttoshow, 1, 1).
'">'.$text.
'</a>';
743 if ($obj->unitfrequency ==
"60") {
744 $s = ($obj->frequency).
" ".$langs->trans(
'MinuteShort');
745 } elseif ($obj->unitfrequency ==
"3600") {
746 $s = ($obj->frequency).
" ".$langs->trans(
'HourShort');
747 } elseif ($obj->unitfrequency ==
"86400") {
748 $s = ($obj->frequency).
" ".($obj->frequency > 1 ? $langs->trans(
'DurationDays') : $langs->trans(
'DurationDay'));
749 } elseif ($obj->unitfrequency ==
"604800") {
750 $s = ($obj->frequency).
" ".($obj->frequency > 1 ? $langs->trans(
'DurationWeeks') : $langs->trans(
'DurationWeek'));
751 } elseif ($obj->unitfrequency ==
"2678400") {
752 $s = ($obj->frequency).
" ".($obj->frequency > 1 ? $langs->trans(
'DurationMonths') : $langs->trans(
'DurationMonth'));
754 print
'<td class="tdoverflowmax125 center" title="'.dol_escape_htmltag($s).
'">';
781 print
'<td class="right">';
782 if (!empty($obj->nbrun)) {
787 if (!empty($obj->maxrun)) {
788 print
' <span class="'.$langs->trans(
"Max").
'">/ '.
dol_escape_htmltag($obj->maxrun).
'</span>';
796 print
'<td class="center celldateheight" title="'.dol_escape_htmltag($datefromto).
'">';
797 if (!empty($datelastrun)) {
806 print
'<td class="center nowraponall" title="'.dol_escape_htmltag($datefromto).
'">';
807 if (!empty($datelastresult) && ($datelastresult >= $datelastrun)) {
808 $nbseconds = max($datelastresult - $datelastrun, 1);
809 print $nbseconds.
' '.$langs->trans(
"SecondShort");
817 print
'<td class="center tdlastresultcode" title="'.dol_escape_htmltag($obj->lastresult).
'">';
818 if ($obj->lastresult !=
'') {
819 if (empty($obj->lastresult) || $obj->status == Cronjob::STATUS_DISABLED) {
820 print $obj->lastresult;
822 print
'<span class="error">'.dol_escape_htmltag(
dol_trunc($obj->lastresult)).
'</div>';
831 print
'<td class="small minwidth150">';
832 if (!empty($obj->lastoutput)) {
833 print
'<div class="twolinesmax lineheightsmall classfortooltip" title="'.dolPrintHTMLForAttribute($obj->lastoutput).
'">';
843 print
'<td class="center celldateheight">';
844 if (!empty($obj->datenextrun)) {
845 $datenextrun =
$db->jdate($obj->datenextrun);
846 if (empty($obj->status)) {
847 print
'<span class="opacitymedium strikefordisabled">';
851 if ($obj->status == Cronjob::STATUS_ENABLED) {
852 if ($obj->maxrun && $obj->nbrun >= $obj->maxrun) {
853 $pictotoadd .=
img_warning($langs->trans(
"MaxRunReached"));
854 } elseif ($datenextrun && $datenextrun < $now) {
861 if (empty($obj->status)) {
871 print
'<td class="center">';
872 print
$object->getLibStatut(5);
879 print
'<td class="nowraponall right">';
880 $backtopage = urlencode($_SERVER[
"PHP_SELF"].
'?'.$param.
'&sortfield='.$sortfield.
'&sortorder='.$sortorder);
881 if ($user->hasRight(
'cron',
'create')) {
882 print
'<a class="editfielda" href="'.DOL_URL_ROOT.
"/cron/card.php?id=".$obj->rowid.
'&action=edit&token='.
newToken().
'&sortfield='.$sortfield.
'&sortorder='.$sortorder.$param;
883 print
"&backtopage=".$backtopage.
"\" title=\"".
dol_escape_htmltag($langs->trans(
'Edit')).
"\">".
img_picto($langs->trans(
'Edit'),
'edit').
"</a> ";
885 if ($user->hasRight(
'cron',
'delete')) {
886 print
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
"?id=".$obj->rowid.
'&action=delete&token='.
newToken().($page ?
'&page='.$page :
'').
'&sortfield='.$sortfield.
'&sortorder='.$sortorder.$param;
887 print
'" title="'.dol_escape_htmltag($langs->trans(
'CronDelete')).
'">'.
img_picto($langs->trans(
'CronDelete'),
'delete',
'', 0, 0, 0,
'',
'marginleftonly').
'</a> ';
889 print
'<a href="#" title="'.dol_escape_htmltag($langs->trans(
'NotEnoughPermissions')).
'">'.
img_picto($langs->trans(
'NotEnoughPermissions'),
'delete',
'', 0, 0, 0,
'',
'marginleftonly').
'</a> ';
891 if ($user->hasRight(
'cron',
'execute')) {
892 if (!empty($obj->status)) {
893 print
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?id='.$obj->rowid.
'&action=execute&token='.
newToken();
895 print
'&sortfield='.$sortfield;
896 print
'&sortorder='.$sortorder;
897 print $param.
"\" title=\"".
dol_escape_htmltag($langs->trans(
'CronExecute')).
"\">".
img_picto($langs->trans(
'CronExecute'),
"play",
'', 0, 0, 0,
'',
'marginleftonly').
'</a>';
899 print
'<a href="#" class="cursordefault" title="'.dol_escape_htmltag($langs->trans(
'JobDisabled')).
'">'.
img_picto($langs->trans(
'JobDisabled'),
"playdisabled",
'', 0, 0, 0,
'',
'marginleftonly').
'</a>';
902 print
'<a href="#" class="cursornotallowed" title="'.dol_escape_htmltag($langs->trans(
'NotEnoughPermissions')).
'">'.
img_picto($langs->trans(
'NotEnoughPermissions'),
"playdisabled",
'', 0, 0, 0,
'',
'marginleftonly').
'</a>';
910 if (!
$conf->main_checkbox_left_column) {
911 print
'<td class="nowraponall center">';
912 if ($massactionbutton || $massaction) {
914 if (in_array($obj->rowid, $arrayofselected)) {
917 print
'<input id="cb'.$obj->rowid.
'" class="flat checkforselect valignmiddle" type="checkbox" name="toselect[]" value="'.$obj->rowid.
'"'.($selected ?
' checked="checked"' :
'').
'>';
930 print
'<tr><td colspan="16"><span class="opacitymedium">'.$langs->trans(
'CronNoJobs').
'</span></td></tr>';
935$parameters = array(
'arrayfields' => $arrayfields,
'sql' => $sql);
936$reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object, $action);
937print $hookmanager->resPrint;
939print
'</table>'.
"\n";
944if ($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.
dolGetFirstLineOfText($text, $nboflines=1, $charset='UTF-8')
Return first line of text.
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, $nodefault=0)
Return value of a param into GET or POST supervariable.
GETPOSTINT($paramname, $method=0, $nodefault=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
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_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.
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.
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.
dolOutputDates($datep, $datef=null, $fullday=0, $addseconds=0, $pictotoadd='', $tzoutput='tzuserrel', $reduceformat=0)
Print decorated date-hour.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
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.
info_admin($text, $infoonimgalt=0, $nodiv=0, $admin='1', $morecss='hideonsmartphone', $textfordropdown='', $picto='', $textonpictotooltip='', $cssfordropdown='info_admin')
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...
print $langs trans("Show") . '< td style="' . $timeColor . '" align="center"> s</td > badge status0 badge status4 badge status3 Error badge status8< td align="center">< span class="badge ' . $badge . '"></span ></td >< td align="center">< a href="#" class="button button-small" onclick="openLogModal(this)" data-req="' . dol_escape_htmltag($reqSafe) . '" data-res="' . dol_escape_htmltag($resSafe) . '" data-err="' . dol_escape_htmltag($errSafe) . '">< span class="fa fa-search-plus"></span ></a ></td ></tr >< tr >< td colspan="' . $colspan . '" class="opacitymedium"></td ></tr ></table ></div ></form > logModal none logModal none s a JSON string
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.