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();
141$permissiontoread = $user->hasRight(
'cron',
'read');
142$permissiontoadd = $user->hasRight(
'cron',
'create') ? $user->hasRight(
'cron',
'create') : $user->hasRight(
'cron',
'write');
143$permissiontodelete = $user->hasRight(
'cron',
'delete');
144$permissiontoexecute = $user->hasRight(
'cron',
'execute');
147if (!$permissiontoread) {
160if (
GETPOST(
'cancel',
'alpha')) {
164if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
168$parameters = array(
'arrayfields' => &$arrayfields);
169$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
174if (empty($reshook)) {
176 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
179 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
182 $search_lastresult =
'';
185 $search_array_options = array();
187 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')
188 ||
GETPOST(
'button_search_x',
'alpha') ||
GETPOST(
'button_search.x',
'alpha') ||
GETPOST(
'button_search',
'alpha')) {
193 if (!empty($search_label)) {
194 $filter[
't.label'] = $search_label;
198 if ($action ==
'confirm_delete' && $confirm ==
"yes" && $permissiontodelete) {
202 $result =
$object->delete($user);
210 if ($action ==
'confirm_execute' && $confirm ==
"yes" && $permissiontoexecute) {
220 $resrunjob =
$object->run_jobs($user->login);
221 if ($resrunjob < 0) {
226 $res =
$object->reprogram_jobs($user->login, $now);
228 if ($resrunjob >= 0) {
229 if (
$object->lastresult >= 0) {
241 $param =
'&search_status='.urlencode($search_status);
242 if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
243 $param .=
'&contextpage='.urlencode($contextpage);
245 if ($limit > 0 && $limit !=
$conf->liste_limit) {
246 $param .=
'&limit='.((int) $limit);
249 $param .=
'&search_label='.urlencode($search_label);
251 if ($optioncss !=
'') {
252 $param .=
'&optioncss='.urlencode($optioncss);
255 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
257 header(
"Location: ".DOL_URL_ROOT.
'/cron/list.php?'.$param.
'&sortfield='.$sortfield.
'&sortorder='.$sortorder);
263 $objectclass =
'CronJob';
264 $objectlabel =
'CronJob';
265 $uploaddir =
$conf->cron->dir_output;
266 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
267 if ($massaction && $permissiontoadd) {
269 foreach ($toselect as
$id) {
270 $result = $tmpcron->fetch(
$id);
273 if ($massaction ==
'disable') {
274 $result = $tmpcron->setStatut(Cronjob::STATUS_DISABLED);
275 } elseif ($massaction ==
'enable') {
276 $result = $tmpcron->setStatut(Cronjob::STATUS_ENABLED);
299$title = $langs->trans(
"CronList");
301llxHeader(
'', $title,
'',
'', 0, 0,
'',
'',
'',
'bodyforlist');
303$TTestNotAllowed = array();
304$sqlTest =
'SELECT rowid, test FROM '.MAIN_DB_PREFIX.
'cronjob';
305$resultTest =
$db->query($sqlTest);
307 while ($objTest =
$db->fetch_object($resultTest)) {
310 $TTestNotAllowed[$objTest->rowid] = $objTest->rowid;
321$sql .=
" t.jobtype,";
323$sql .=
" t.command,";
324$sql .=
" t.classesname,";
325$sql .=
" t.objectname,";
326$sql .=
" t.methodename,";
328$sql .=
" t.md5params,";
329$sql .=
" t.module_name,";
330$sql .=
" t.priority,";
331$sql .=
" t.processing,";
332$sql .=
" t.datelastrun,";
333$sql .=
" t.datenextrun,";
334$sql .=
" t.dateend,";
335$sql .=
" t.datestart,";
336$sql .=
" t.lastresult,";
337$sql .=
" t.datelastresult,";
338$sql .=
" t.lastoutput,";
339$sql .=
" t.unitfrequency,";
340$sql .=
" t.frequency,";
342$sql .=
" t.fk_user_author,";
343$sql .=
" t.fk_user_mod,";
347$sql .=
" t.libname,";
349$sql .=
" FROM ".MAIN_DB_PREFIX.
"cronjob as t";
350$sql .=
" WHERE entity IN (0,".$conf->entity.
")";
351if (!empty($TTestNotAllowed)) {
352 $sql .=
' AND t.rowid NOT IN ('.$db->sanitize(implode(
',', $TTestNotAllowed)).
')';
354if ($search_status >= 0 && $search_status < 2 && $search_status !=
'') {
355 $sql .=
" AND t.status = ".(empty($search_status) ?
'0' :
'1');
357if ($search_lastresult !=
'') {
360if (GETPOSTISSET(
'search_processing')) {
361 $sql .=
" AND t.processing = ".((int) $search_processing);
364if (count($filter) > 0) {
365 foreach ($filter as $key => $value) {
366 $sql .=
" AND ".$db->sanitize($key).
" LIKE '%".
$db->escape($value).
"%'";
369if (!empty($search_module_name)) {
373include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
375$parameters = array();
376$reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object, $action);
377$sql .= $hookmanager->resPrint;
381$nbtotalofrecords =
'';
385 $resql =
$db->query($sqlforcount);
387 $nbtotalofrecords =
$db->num_rows($resql);
392 if (($page * $limit) > (
int) $nbtotalofrecords) {
400$sql .=
$db->order($sortfield, $sortorder);
402 $sql .=
$db->plimit($limit + 1, $offset);
405$resql =
$db->query($sql);
411$num =
$db->num_rows($resql);
413$arrayofselected = is_array($toselect) ? $toselect : array();
417 $param .=
'&mode='.urlencode($mode);
419if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
420 $param .=
'&contextpage='.urlencode($contextpage);
422if ($limit > 0 && $limit !=
$conf->liste_limit) {
423 $param .=
'&limit='.((int) $limit);
425if ($optioncss !=
'') {
426 $param .=
'&optioncss='.urlencode($optioncss);
429 $param .=
'&search_status='.urlencode($search_status);
432 $param .=
'&search_label='.urlencode($search_label);
434if ($search_module_name) {
435 $param .=
'&search_module_name='.urlencode($search_module_name);
437if ($search_lastresult) {
438 $param .=
'&search_lastresult='.urlencode($search_lastresult);
441include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
445if ($action ==
'execute') {
446 print $form->formconfirm($_SERVER[
'PHP_SELF'].
"?id=".
$id.
'&securitykey='.$securitykey.$param, $langs->trans(
"CronExecute"), $langs->trans(
"CronConfirmExecute"),
"confirm_execute",
'',
'', 1);
449if ($action ==
'delete' && empty($toselect)) {
450 print $form->formconfirm($_SERVER[
'PHP_SELF'].
"?id=".
$id.$param, $langs->trans(
"CronDelete"), $langs->trans(
"CronConfirmDelete"),
"confirm_delete",
'',
'', 1);
454$arrayofmassactions = array(
457 'enable' =>
img_picto(
'',
'check',
'class="pictofixedwidth"').$langs->trans(
"CronStatusActiveBtn"),
458 'disable' =>
img_picto(
'',
'uncheck',
'class="pictofixedwidth"').$langs->trans(
"CronStatusInactiveBtn"),
460if ($user->hasRight(
'cron',
'delete')) {
461 $arrayofmassactions[
'predelete'] =
img_picto(
'',
'delete',
'class="pictofixedwidth"').$langs->trans(
"Delete");
463if (
GETPOSTINT(
'nomassaction') || in_array($massaction, array(
'presend',
'predelete'))) {
464 $arrayofmassactions = array();
466$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
469if ($mode ==
'modulesetup') {
470 $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>';
471 print
load_fiche_titre($langs->trans(
"CronSetup"), $linkback,
'title_setup');
477print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'" name="search_form">'.
"\n";
478if ($optioncss !=
'') {
479 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
481print
'<input type="hidden" name="token" value="'.newToken().
'">';
482print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
483print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
484print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
485print
'<input type="hidden" name="page" value="'.$page.
'">';
486print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
487print
'<input type="hidden" name="page_y" value="">';
488print
'<input type="hidden" name="mode" value="'.$mode.
'">';
491$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'));
494if ($mode ==
'modulesetup') {
501print_barre_liste($title, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, ($mode ==
'modulesetup' ?
'' :
'title_setup'), 0, $newcardbutton,
'', $limit);
504$topicmail =
"SendCronRef";
507$trackid =
'cron'.$object->id;
508include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
510$text = $langs->trans(
"HoursOnThisPageAreOnServerTZ").
' '.$stringcurrentdate.
'<br>';
512 $text .= $langs->trans(
"WarningCronDelayed",
getDolGlobalString(
'CRON_WARNING_DELAY_HOURS'));
519$parameters = array();
520$reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object, $action);
521if (empty($reshook)) {
522 $moreforfilter .= $hookmanager->resPrint;
524 $moreforfilter = $hookmanager->resPrint;
527 'arrayfields' => &$arrayfields,
530if (!empty($moreforfilter)) {
531 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
532 print $moreforfilter;
536$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
537$htmlofselectarray = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
$conf->main_checkbox_left_column);
538$selectedfields = (($mode !=
'kanban' && $mode !=
'kanbangroupby') ? $htmlofselectarray :
'');
539$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons(
'checkforselect', 1) :
'');
541print
'<div class="div-table-responsive">';
542print
'<table class="tagtable nobottomiftotal noborder liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
546print
'<tr class="liste_titre_filter">';
548if (
$conf->main_checkbox_left_column) {
549 print
'<td class="liste_titre center maxwidthsearch">';
550 $searchpicto = $form->showFilterButtons(
'left');
554print
'<td class="liste_titre"> </td>';
555print
'<td class="liste_titre">';
556print
'<input type="text" class="flat width75" name="search_label" value="'.$search_label.
'">';
558print
'<td class="liste_titre"> </td>';
559print
'<td class="liste_titre"><input type="text" class="width50" name="search_module_name" value="'.$search_module_name.
'"></td>';
560print
'<td class="liste_titre"> </td>';
561print
'<td class="liste_titre"> </td>';
564print
'<td class="liste_titre"> </td>';
565print
'<td class="liste_titre"> </td>';
566print
'<td class="liste_titre"> </td>';
567print
'<td class="liste_titre center"><input type="text" class="width50" name="search_lastresult" value="'.$search_lastresult.
'"></td>';
568print
'<td class="liste_titre"> </td>';
569print
'<td class="liste_titre"> </td>';
570print
'<td class="liste_titre center">';
571print $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');
573print
'<td class="liste_titre"> </td>';
575if (!
$conf->main_checkbox_left_column) {
576 print
'<td class="liste_titre right">';
577 $searchpicto = $form->showFilterButtons();
588print
'<tr class="liste_titre">';
590if (
$conf->main_checkbox_left_column) {
591 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
"", $param,
'', $sortfield, $sortorder,
'center maxwidthsearch ');
595print_liste_field_titre(
"Priority", $_SERVER[
"PHP_SELF"],
"t.priority",
"", $param,
'', $sortfield, $sortorder);
596print_liste_field_titre(
"CronModule", $_SERVER[
"PHP_SELF"],
"t.module_name",
"", $param,
'', $sortfield, $sortorder);
601print_liste_field_titre(
"CronNbRun", $_SERVER[
"PHP_SELF"],
"t.nbrun",
"", $param,
'', $sortfield, $sortorder,
'right tdoverflowmax50 maxwidth50imp ');
602print_liste_field_titre(
"CronDtLastLaunch", $_SERVER[
"PHP_SELF"],
"t.datelastrun",
"", $param,
'', $sortfield, $sortorder,
'center tdoverflowmax100 ');
603print_liste_field_titre(
"Duration", $_SERVER[
"PHP_SELF"],
"",
"", $param,
'', $sortfield, $sortorder,
'center ');
604print_liste_field_titre(
"CronLastResult", $_SERVER[
"PHP_SELF"],
"t.lastresult",
"", $param,
'', $sortfield, $sortorder,
'center ');
605print_liste_field_titre(
"CronLastOutput", $_SERVER[
"PHP_SELF"],
"t.lastoutput",
"", $param,
'', $sortfield, $sortorder);
606print_liste_field_titre(
"CronDtNextLaunch", $_SERVER[
"PHP_SELF"],
"t.datenextrun",
"", $param,
'', $sortfield, $sortorder,
'center ');
607print_liste_field_titre(
"Status", $_SERVER[
"PHP_SELF"],
"t.status,t.priority",
"", $param,
'', $sortfield, $sortorder,
'center ');
610if (!
$conf->main_checkbox_left_column) {
611 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
"", $param,
'', $sortfield, $sortorder,
'center maxwidthsearch ');
621$imaxinloop = ($limit ? min($num, $limit) : $num);
626 while ($i < $imaxinloop) {
627 $obj =
$db->fetch_object($resql);
633 if (preg_match(
'/:(.*)$/', $obj->label, $reg)) {
634 $langs->load($reg[1]);
639 $object->label = preg_replace(
'/:.*$/',
'', $obj->label);
640 $object->status = $obj->status;
641 $object->priority = $obj->priority;
642 $object->processing = $obj->processing;
644 $object->datestart =
$db->jdate($obj->datestart);
646 $object->module_name = $obj->module_name;
647 $object->params = $obj->params;
648 $object->datelastrun =
$db->jdate($obj->datelastrun);
649 $object->datenextrun =
$db->jdate($obj->datenextrun);
651 $datelastrun =
$db->jdate($obj->datelastrun);
652 $datelastresult =
$db->jdate($obj->datelastresult);
653 $datefromto = (empty($datelastrun) ?
'' :
dol_print_date($datelastrun,
'dayhoursec',
'tzserver')).
' - '.(empty($datelastresult) ?
'' :
dol_print_date($datelastresult,
'dayhoursec',
'tzserver'));
656 print
'<tr class="oddeven row-with-select">';
659 if (
$conf->main_checkbox_left_column) {
660 print
'<td class="nowraponall center">';
661 if ($massactionbutton || $massaction) {
663 if (in_array($obj->rowid, $arrayofselected)) {
666 print
'<input id="cb'.$obj->rowid.
'" class="flat checkforselect valignmiddle" type="checkbox" name="toselect[]" value="'.$obj->rowid.
'"'.($selected ?
' checked="checked"' :
'').
'>';
675 print
'<td class="nowraponall">';
683 print
'<td class="minwidth150">';
686 print
'<div class="small twolinesmax lineheightsmall minwidth150 maxwidth250 classfortooltip" title="'.dol_escape_htmltag($langs->trans(
$object->label), 0, 0).
'">';
687 print
$object->getNomUrl(0,
'', 1);
699 print
'<td class="right">';
712 print
'<td class="nowraponall">';
713 if ($obj->jobtype ==
'method') {
715 $texttoshow =
'<b>'.$langs->trans(
"CronType_method").
'</b><br><br>';
716 $texttoshow .= $langs->trans(
'CronModule').
': '.$obj->module_name.
'<br>';
717 $texttoshow .= $langs->trans(
'CronClass').
': '.$obj->classesname.
'<br>';
718 $texttoshow .= $langs->trans(
'CronObject').
': '.$obj->objectname.
'<br>';
719 $texttoshow .= $langs->trans(
'CronMethod').
': '.$obj->methodename;
720 $texttoshow .=
'<br>'.$langs->trans(
'CronArgs').
': '.$obj->params;
721 $texttoshow .=
'<br>'.$langs->trans(
'Comment').
': '.$langs->trans($obj->note);
722 } elseif ($obj->jobtype ==
'command') {
724 $texttoshow =
'<b>'.$langs->trans(
'CronType_command').
'</b><br><br>';
725 $texttoshow .= $langs->trans(
'CronCommand').
': '.
dol_trunc($obj->command);
726 $texttoshow .=
'<br>'.$langs->trans(
'CronArgs').
': '.$obj->params;
727 $texttoshow .=
'<br>'.$langs->trans(
'Comment').
': '.$langs->trans($obj->note);
732 print
'<span class="classfortooltip" title="'.dol_escape_htmltag($texttoshow, 1, 1).
'">'.$text.
'</a>';
740 if ($obj->unitfrequency ==
"60") {
741 $s = ($obj->frequency).
" ".$langs->trans(
'MinuteShort');
742 } elseif ($obj->unitfrequency ==
"3600") {
743 $s = ($obj->frequency).
" ".$langs->trans(
'HourShort');
744 } elseif ($obj->unitfrequency ==
"86400") {
745 $s = ($obj->frequency).
" ".($obj->frequency > 1 ? $langs->trans(
'DurationDays') : $langs->trans(
'DurationDay'));
746 } elseif ($obj->unitfrequency ==
"604800") {
747 $s = ($obj->frequency).
" ".($obj->frequency > 1 ? $langs->trans(
'DurationWeeks') : $langs->trans(
'DurationWeek'));
748 } elseif ($obj->unitfrequency ==
"2678400") {
749 $s = ($obj->frequency).
" ".($obj->frequency > 1 ? $langs->trans(
'DurationMonths') : $langs->trans(
'DurationMonth'));
751 print
'<td class="tdoverflowmax125 center" title="'.dol_escape_htmltag($s).
'">';
778 print
'<td class="right">';
779 if (!empty($obj->nbrun)) {
784 if (!empty($obj->maxrun)) {
785 print
' <span class="'.$langs->trans(
"Max").
'">/ '.
dol_escape_htmltag($obj->maxrun).
'</span>';
793 print
'<td class="center celldateheight" title="'.dol_escape_htmltag($datefromto).
'">';
794 if (!empty($datelastrun)) {
803 print
'<td class="center nowraponall" title="'.dol_escape_htmltag($datefromto).
'">';
804 if (!empty($datelastresult) && ($datelastresult >= $datelastrun)) {
805 $nbseconds = max($datelastresult - $datelastrun, 1);
806 print $nbseconds.
' '.$langs->trans(
"SecondShort");
814 print
'<td class="center tdlastresultcode" title="'.dol_escape_htmltag($obj->lastresult).
'">';
815 if ($obj->lastresult !=
'') {
816 if (empty($obj->lastresult) || $obj->status == Cronjob::STATUS_DISABLED) {
817 print $obj->lastresult;
819 print
'<span class="error">'.dol_escape_htmltag(
dol_trunc($obj->lastresult)).
'</div>';
828 print
'<td class="small minwidth150">';
829 if (!empty($obj->lastoutput)) {
830 print
'<div class="twolinesmax lineheightsmall classfortooltip" title="'.dolPrintHTMLForAttribute($obj->lastoutput).
'">';
840 print
'<td class="center celldateheight">';
841 if (!empty($obj->datenextrun)) {
842 $datenextrun =
$db->jdate($obj->datenextrun);
843 if (empty($obj->status)) {
844 print
'<span class="opacitymedium strikefordisabled">';
848 if ($obj->status == Cronjob::STATUS_ENABLED) {
849 if ($obj->maxrun && $obj->nbrun >= $obj->maxrun) {
850 $pictotoadd .=
img_warning($langs->trans(
"MaxRunReached"));
851 } elseif ($datenextrun && $datenextrun < $now) {
858 if (empty($obj->status)) {
868 print
'<td class="center">';
869 print
$object->getLibStatut(5);
876 print
'<td class="nowraponall right">';
877 $backtopage = urlencode($_SERVER[
"PHP_SELF"].
'?'.$param.
'&sortfield='.$sortfield.
'&sortorder='.$sortorder);
878 if ($user->hasRight(
'cron',
'create')) {
879 print
'<a class="editfielda" href="'.DOL_URL_ROOT.
"/cron/card.php?id=".$obj->rowid.
'&action=edit&token='.newToken().
'&sortfield='.$sortfield.
'&sortorder='.$sortorder.$param;
880 print
"&backtopage=".$backtopage.
"\" title=\"".
dol_escape_htmltag($langs->trans(
'Edit')).
"\">".
img_picto($langs->trans(
'Edit'),
'edit').
"</a> ";
882 if ($user->hasRight(
'cron',
'delete')) {
883 print
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
"?id=".$obj->rowid.
'&action=delete&token='.newToken().($page ?
'&page='.$page :
'').
'&sortfield='.$sortfield.
'&sortorder='.$sortorder.$param;
884 print
'" title="'.dol_escape_htmltag($langs->trans(
'CronDelete')).
'">'.
img_picto($langs->trans(
'CronDelete'),
'delete',
'', 0, 0, 0,
'',
'marginleftonly').
'</a> ';
886 print
'<a href="#" title="'.dol_escape_htmltag($langs->trans(
'NotEnoughPermissions')).
'">'.
img_picto($langs->trans(
'NotEnoughPermissions'),
'delete',
'', 0, 0, 0,
'',
'marginleftonly').
'</a> ';
888 if ($user->hasRight(
'cron',
'execute')) {
889 if (!empty($obj->status)) {
890 print
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?id='.$obj->rowid.
'&action=execute&token='.newToken();
892 print
'&sortfield='.$sortfield;
893 print
'&sortorder='.$sortorder;
894 print $param.
"\" title=\"".
dol_escape_htmltag($langs->trans(
'CronExecute')).
"\">".
img_picto($langs->trans(
'CronExecute'),
"play",
'', 0, 0, 0,
'',
'marginleftonly').
'</a>';
896 print
'<a href="#" class="cursordefault" title="'.dol_escape_htmltag($langs->trans(
'JobDisabled')).
'">'.
img_picto($langs->trans(
'JobDisabled'),
"playdisabled",
'', 0, 0, 0,
'',
'marginleftonly').
'</a>';
899 print
'<a href="#" class="cursornotallowed" title="'.dol_escape_htmltag($langs->trans(
'NotEnoughPermissions')).
'">'.
img_picto($langs->trans(
'NotEnoughPermissions'),
"playdisabled",
'', 0, 0, 0,
'',
'marginleftonly').
'</a>';
907 if (!
$conf->main_checkbox_left_column) {
908 print
'<td class="nowraponall center">';
909 if ($massactionbutton || $massaction) {
911 if (in_array($obj->rowid, $arrayofselected)) {
914 print
'<input id="cb'.$obj->rowid.
'" class="flat checkforselect valignmiddle" type="checkbox" name="toselect[]" value="'.$obj->rowid.
'"'.($selected ?
' checked="checked"' :
'').
'>';
927 print
'<tr><td colspan="16"><span class="opacitymedium">'.$langs->trans(
'CronNoJobs').
'</span></td></tr>';
932$parameters = array(
'arrayfields' => $arrayfields,
'sql' => $sql);
933$reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object, $action);
934print $hookmanager->resPrint;
936print
'</table>'.
"\n";
941if ($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.
info_admin($text, $infoonimgalt=0, $nodiv=0, $admin='1', $morecss='hideonsmartphone', $textfordropdown='', $picto='', $textonpictotooltip='')
Show information in HTML for admin users or standard users.
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.
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.
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...
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.
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
buildzip.php
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.