30require
'../main.inc.php';
31require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
32require_once DOL_DOCUMENT_ROOT.
'/cron/class/cronjob.class.php';
33require_once DOL_DOCUMENT_ROOT.
'/core/lib/cron.lib.php';
34require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
37$langs->loadLangs(array(
"admin",
"cron",
"bills",
"members"));
39$action =
GETPOST(
'action',
'aZ09');
40$massaction =
GETPOST(
'massaction',
'alpha');
41$confirm =
GETPOST(
'confirm',
'alpha');
42$toselect =
GETPOST(
'toselect',
'array');
43$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'cronjoblist';
48$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
49$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
51if (empty($page) || $page == -1) {
54$offset = $limit * $page;
58 $sortfield =
't.priority,t.status';
61 $sortorder =
'ASC,DESC';
63$optioncss =
GETPOST(
'optioncss',
'alpha');
66$search_status =
GETPOST(
'search_status',
'intcomma');
67$search_label =
GETPOST(
"search_label",
'alpha');
68$search_module_name =
GETPOST(
"search_module_name",
'alpha');
69$search_lastresult =
GETPOST(
"search_lastresult",
"alphawithlgt");
70$search_processing =
GETPOST(
"search_processing",
'int');
71$securitykey =
GETPOST(
'securitykey',
'alpha');
73$outputdir = $conf->cron->dir_output;
74if (empty($outputdir)) {
75 $outputdir = $conf->cronjob->dir_output;
77$diroutputmassaction = $outputdir.
'/temp/massgeneration/'.$user->id;
82$hookmanager->initHooks(array(
'cronjoblist'));
86$extrafields->fetch_name_optionals_label(
$object->table_element);
88$search_array_options = $extrafields->getOptionalsFromPost(
$object->table_element,
'',
'search_');
91if (!$user->hasRight(
'cron',
'read')) {
95$permissiontoread = $user->hasRight(
'cron',
'read');
96$permissiontoadd = $user->hasRight(
'cron',
'create') ? $user->hasRight(
'cron',
'create') : $user->hasRight(
'cron',
'write');
97$permissiontodelete = $user->hasRight(
'cron',
'delete');
98$permissiontoexecute = $user->hasRight(
'cron',
'execute');
105if (
GETPOST(
'cancel',
'alpha')) {
109if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
113$parameters = array();
114$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
119if (empty($reshook)) {
121 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
124 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
127 $search_module_name =
'';
128 $search_lastresult =
'';
130 $search_array_options = array();
132 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')
133 ||
GETPOST(
'button_search_x',
'alpha') ||
GETPOST(
'button_search.x',
'alpha') ||
GETPOST(
'button_search',
'alpha')) {
138 if (!empty($search_label)) {
139 $filter[
't.label'] = $search_label;
143 if ($action ==
'confirm_delete' && $confirm ==
"yes" && $permissiontodelete) {
147 $result =
$object->delete($user);
155 if ($action ==
'confirm_execute' && $confirm ==
"yes" && $permissiontoexecute) {
165 $resrunjob =
$object->run_jobs($user->login);
166 if ($resrunjob < 0) {
171 $res =
$object->reprogram_jobs($user->login, $now);
173 if ($resrunjob >= 0) {
174 if (
$object->lastresult >= 0) {
186 $param =
'&search_status='.urlencode($search_status);
187 if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
188 $param .=
'&contextpage='.urlencode($contextpage);
190 if ($limit > 0 && $limit != $conf->liste_limit) {
191 $param .=
'&limit='.((int) $limit);
194 $param .=
'&search_label='.urlencode($search_label);
196 if ($search_module_name) {
197 $param .=
'&search_module_name='.urlencode($search_module_name);
199 if ($search_lastresult) {
200 $param .=
'&search_lastresult='.urlencode($search_lastresult);
203 $param .=
'&mode='.urlencode($mode);
205 if ($optioncss !=
'') {
206 $param .=
'&optioncss='.urlencode($optioncss);
209 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
211 header(
"Location: ".DOL_URL_ROOT.
'/cron/list.php?'.$param.($sortfield ?
'&sortfield='.$sortfield :
'').($sortorder ?
'&sortorder='.$sortorder :
''));
217 $objectclass =
'CronJob';
218 $objectlabel =
'CronJob';
219 $uploaddir = $conf->cron->dir_output;
220 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
221 if ($massaction && $permissiontoadd) {
223 foreach ($toselect as $id) {
224 $result = $tmpcron->fetch($id);
227 if ($massaction ==
'disable') {
228 $result = $tmpcron->setStatut(Cronjob::STATUS_DISABLED);
229 } elseif ($massaction ==
'enable') {
230 $result = $tmpcron->setStatut(Cronjob::STATUS_ENABLED);
248$form =
new Form($db);
251$title = $langs->trans(
"CronList");
253llxHeader(
'', $title,
'', 0, 0,
'',
'',
'',
'bodyforlist');
255$TTestNotAllowed = array();
256$sqlTest =
'SELECT rowid, test FROM '.MAIN_DB_PREFIX.
'cronjob';
257$resultTest = $db->query($sqlTest);
259 while ($objTest = $db->fetch_object($resultTest)) {
262 $TTestNotAllowed[$objTest->rowid] = $objTest->rowid;
271$sql .=
" t.jobtype,";
273$sql .=
" t.command,";
274$sql .=
" t.classesname,";
275$sql .=
" t.objectname,";
276$sql .=
" t.methodename,";
278$sql .=
" t.md5params,";
279$sql .=
" t.module_name,";
280$sql .=
" t.priority,";
281$sql .=
" t.processing,";
282$sql .=
" t.datelastrun,";
283$sql .=
" t.datenextrun,";
284$sql .=
" t.dateend,";
285$sql .=
" t.datestart,";
286$sql .=
" t.lastresult,";
287$sql .=
" t.datelastresult,";
288$sql .=
" t.lastoutput,";
289$sql .=
" t.unitfrequency,";
290$sql .=
" t.frequency,";
292$sql .=
" t.fk_user_author,";
293$sql .=
" t.fk_user_mod,";
297$sql .=
" t.libname,";
299$sql .=
" FROM ".MAIN_DB_PREFIX.
"cronjob as t";
300$sql .=
" WHERE entity IN (0,".$conf->entity.
")";
301if (!empty($TTestNotAllowed)) {
302 $sql .=
' AND t.rowid NOT IN ('.$db->sanitize(implode(
',', $TTestNotAllowed)).
')';
304if ($search_status >= 0 && $search_status < 2 && $search_status !=
'') {
305 $sql .=
" AND t.status = ".(empty($search_status) ?
'0' :
'1');
307if ($search_lastresult !=
'') {
310if (GETPOSTISSET(
'search_processing')) {
311 $sql .=
" AND t.processing = ".((int) $search_processing);
314if (is_array($filter) && count($filter) > 0) {
315 foreach ($filter as $key => $value) {
316 $sql .=
" AND ".$key.
" LIKE '%".$db->escape($value).
"%'";
319if (!empty($search_module_name)) {
323include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
325$parameters = array();
326$reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters);
327$sql .= $hookmanager->resPrint;
329$sql .= $db->order($sortfield, $sortorder);
331$nbtotalofrecords =
'';
333 $result = $db->query($sql);
334 $nbtotalofrecords = $db->num_rows($result);
335 if (($page * $limit) > $nbtotalofrecords) {
341$sql .= $db->plimit($limit + 1, $offset);
343$result = $db->query($sql);
348$num = $db->num_rows($result);
350$arrayofselected = is_array($toselect) ? $toselect : array();
353if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
354 $param .=
'&contextpage='.urlencode($contextpage);
356if ($limit > 0 && $limit != $conf->liste_limit) {
357 $param .=
'&limit='.((int) $limit);
360 $param .=
'&search_status='.urlencode($search_status);
363 $param .=
'&search_label='.urlencode($search_label);
365if ($search_module_name) {
366 $param .=
'&search_module_name='.urlencode($search_module_name);
368if ($search_lastresult) {
369 $param .=
'&search_lastresult='.urlencode($search_lastresult);
372 $param .=
'&mode='.urlencode($mode);
374if ($optioncss !=
'') {
375 $param .=
'&optioncss='.urlencode($optioncss);
378include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
382if ($action ==
'execute') {
383 print $form->formconfirm($_SERVER[
'PHP_SELF'].
"?id=".$id.
'&securitykey='.$securitykey.$param, $langs->trans(
"CronExecute"), $langs->trans(
"CronConfirmExecute"),
"confirm_execute",
'',
'', 1);
386if ($action ==
'delete' && empty($toselect)) {
387 print $form->formconfirm($_SERVER[
'PHP_SELF'].
"?id=".$id.$param, $langs->trans(
"CronDelete"), $langs->trans(
"CronConfirmDelete"),
"confirm_delete",
'',
'', 1);
391$arrayofmassactions = array(
394 'enable' =>
img_picto(
'',
'check',
'class="pictofixedwidth"').$langs->trans(
"CronStatusActiveBtn"),
395 'disable' =>
img_picto(
'',
'uncheck',
'class="pictofixedwidth"').$langs->trans(
"CronStatusInactiveBtn"),
397if ($user->hasRight(
'cron',
'delete')) {
398 $arrayofmassactions[
'predelete'] =
img_picto(
'',
'delete',
'class="pictofixedwidth"').$langs->trans(
"Delete");
400if (
GETPOSTINT(
'nomassaction') || in_array($massaction, array(
'presend',
'predelete'))) {
401 $arrayofmassactions = array();
403$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
405if ($mode ==
'modulesetup') {
406 $linkback =
'<a href="'.DOL_URL_ROOT.
'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToModuleList").
'</a>';
407 print
load_fiche_titre($langs->trans(
"CronSetup"), $linkback,
'title_setup');
413print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'" name="search_form">'.
"\n";
414if ($optioncss !=
'') {
415 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
417print
'<input type="hidden" name="token" value="'.newToken().
'">';
418print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
419print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
420print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
421print
'<input type="hidden" name="page" value="'.$page.
'">';
422print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
423print
'<input type="hidden" name="mode" value="'.$mode.
'">';
427$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'));
430if ($mode ==
'modulesetup') {
437print_barre_liste($title, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, ($mode ==
'modulesetup' ?
'' :
'title_setup'), 0, $newcardbutton,
'', $limit);
440$topicmail =
"SendCronRef";
443$trackid =
'cron'.$object->id;
444include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
446$text = $langs->trans(
"HoursOnThisPageAreOnServerTZ").
' '.$stringcurrentdate.
'<br>';
448 $text .= $langs->trans(
"WarningCronDelayed",
getDolGlobalString(
'CRON_WARNING_DELAY_HOURS'));
456$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons(
'checkforselect', 1) :
'');
458print
'<div class="div-table-responsive">';
459print
'<table class="noborder liste">';
461print
'<tr class="liste_titre_filter">';
464 print
'<td class="liste_titre right">';
465 $searchpicto = $form->showFilterButtons();
469print
'<td class="liste_titre"> </td>';
470print
'<td class="liste_titre">';
471print
'<input type="text" class="flat width75" name="search_label" value="'.$search_label.
'">';
474print
'<td class="liste_titre"><input type="text" class="width50" name="search_module_name" value="'.$search_module_name.
'"></td>';
475print
'<td class="liste_titre"> </td>';
476print
'<td class="liste_titre"> </td>';
479print
'<td class="liste_titre"> </td>';
480print
'<td class="liste_titre"> </td>';
481print
'<td class="liste_titre"> </td>';
482print
'<td class="liste_titre center"><input type="text" class="width50" name="search_lastresult" value="'.$search_lastresult.
'"></td>';
483print
'<td class="liste_titre"> </td>';
484print
'<td class="liste_titre"> </td>';
485print
'<td class="liste_titre center">';
486print $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');
488print
'<td class="liste_titre"> </td>';
491 print
'<td class="liste_titre right">';
492 $searchpicto = $form->showFilterButtons();
498print
'<tr class="liste_titre">';
501 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
"", $param,
'', $sortfield, $sortorder,
'center maxwidthsearch ');
506print_liste_field_titre(
"CronModule", $_SERVER[
"PHP_SELF"],
"t.module_name",
"", $param,
'', $sortfield, $sortorder);
511print_liste_field_titre(
"CronNbRun", $_SERVER[
"PHP_SELF"],
"t.nbrun",
"", $param,
'', $sortfield, $sortorder,
'right tdoverflowmax50 maxwidth50imp ');
512print_liste_field_titre(
"CronDtLastLaunch", $_SERVER[
"PHP_SELF"],
"t.datelastrun",
"", $param,
'', $sortfield, $sortorder,
'center tdoverflowmax100 ');
513print_liste_field_titre(
"Duration", $_SERVER[
"PHP_SELF"],
"",
"", $param,
'', $sortfield, $sortorder,
'center ');
514print_liste_field_titre(
"CronLastResult", $_SERVER[
"PHP_SELF"],
"t.lastresult",
"", $param,
'', $sortfield, $sortorder,
'center ');
515print_liste_field_titre(
"CronLastOutput", $_SERVER[
"PHP_SELF"],
"t.lastoutput",
"", $param,
'', $sortfield, $sortorder);
516print_liste_field_titre(
"CronDtNextLaunch", $_SERVER[
"PHP_SELF"],
"t.datenextrun",
"", $param,
'', $sortfield, $sortorder,
'center ');
517print_liste_field_titre(
"Status", $_SERVER[
"PHP_SELF"],
"t.status,t.priority",
"", $param,
'', $sortfield, $sortorder,
'center ');
521 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
"", $param,
'', $sortfield, $sortorder,
'center maxwidthsearch ');
531 while ($i < min($num, $limit)) {
532 $obj = $db->fetch_object($result);
539 if (preg_match(
'/:(.*)$/', $obj->label, $reg)) {
540 $langs->load($reg[1]);
545 $object->label = preg_replace(
'/:.*$/',
'', $obj->label);
546 $object->status = $obj->status;
547 $object->priority = $obj->priority;
548 $object->processing = $obj->processing;
549 $object->lastresult = (string) $obj->lastresult;
550 $object->datestart = $db->jdate($obj->datestart);
551 $object->dateend = $db->jdate($obj->dateend);
552 $object->module_name = $obj->module_name;
553 $object->params = $obj->params;
554 $object->datelastrun = $db->jdate($obj->datelastrun);
555 $object->datenextrun = $db->jdate($obj->datenextrun);
557 $datelastrun = $db->jdate($obj->datelastrun);
558 $datelastresult = $db->jdate($obj->datelastresult);
560 print
'<tr class="oddeven">';
564 print
'<td class="nowraponall center">';
565 if ($massactionbutton || $massaction) {
567 if (in_array($obj->rowid, $arrayofselected)) {
570 print
'<input id="cb'.$obj->rowid.
'" class="flat checkforselect valignmiddle" type="checkbox" name="toselect[]" value="'.$obj->rowid.
'"'.($selected ?
' checked="checked"' :
'').
'>';
576 print
'<td class="nowraponall">';
581 print
'<td class="minwidth125">';
584 print
'<div class="small twolinesmax minwidth150 maxwidth250 classfortooltip" title="'.dol_escape_htmltag($langs->trans(
$object->label), 0, 0).
'">';
585 print
$object->getNomUrl(0,
'', 1);
604 print
'<td class="nowraponall">';
605 if ($obj->jobtype ==
'method') {
607 $texttoshow =
'<b>'.$langs->trans(
"CronType_method").
'</b><br><br>';
608 $texttoshow .= $langs->trans(
'CronModule').
': '.$obj->module_name.
'<br>';
609 $texttoshow .= $langs->trans(
'CronClass').
': '.$obj->classesname.
'<br>';
610 $texttoshow .= $langs->trans(
'CronObject').
': '.$obj->objectname.
'<br>';
611 $texttoshow .= $langs->trans(
'CronMethod').
': '.$obj->methodename;
612 $texttoshow .=
'<br>'.$langs->trans(
'CronArgs').
': '.$obj->params;
613 $texttoshow .=
'<br>'.$langs->trans(
'Comment').
': '.$langs->trans($obj->note);
614 } elseif ($obj->jobtype ==
'command') {
616 $texttoshow =
'<b>'.$langs->trans(
'CronType_command').
'</b><br><br>';
617 $texttoshow .= $langs->trans(
'CronCommand').
': '.
dol_trunc($obj->command);
618 $texttoshow .=
'<br>'.$langs->trans(
'CronArgs').
': '.$obj->params;
619 $texttoshow .=
'<br>'.$langs->trans(
'Comment').
': '.$langs->trans($obj->note);
621 print
'<span class="classfortooltip" title="'.dol_escape_htmltag($texttoshow, 1, 1).
'">'.$text.
'</a>';
626 if ($obj->unitfrequency ==
"60") {
627 $s = ($obj->frequency).
" ".$langs->trans(
'MinuteShort');
628 } elseif ($obj->unitfrequency ==
"3600") {
629 $s = ($obj->frequency).
" ".$langs->trans(
'HourShort');
630 } elseif ($obj->unitfrequency ==
"86400") {
631 $s = ($obj->frequency).
" ".($obj->frequency > 1 ? $langs->trans(
'DurationDays') : $langs->trans(
'DurationDay'));
632 } elseif ($obj->unitfrequency ==
"604800") {
633 $s = ($obj->frequency).
" ".($obj->frequency > 1 ? $langs->trans(
'DurationWeeks') : $langs->trans(
'DurationWeek'));
634 } elseif ($obj->unitfrequency ==
"2678400") {
635 $s = ($obj->frequency).
" ".($obj->frequency > 1 ? $langs->trans(
'DurationMonths') : $langs->trans(
'DurationMonth'));
637 print
'<td class="tdoverflowmax125 center" title="'.dol_escape_htmltag($s).
'">';
655 print
'<td class="right">';
656 if (!empty($obj->nbrun)) {
661 if (!empty($obj->maxrun)) {
662 print
' <span class="'.$langs->trans(
"Max").
'">/ '.
dol_escape_htmltag($obj->maxrun).
'</span>';
666 $datefromto = (empty($datelastrun) ?
'' :
dol_print_date($datelastrun,
'dayhoursec',
'tzserver')).
' - '.(empty($datelastresult) ?
'' :
dol_print_date($datelastresult,
'dayhoursec',
'tzserver'));
669 print
'<td class="center" title="'.dol_escape_htmltag($datefromto).
'">';
670 if (!empty($datelastrun)) {
676 print
'<td class="center nowraponall" title="'.dol_escape_htmltag($datefromto).
'">';
677 if (!empty($datelastresult) && ($datelastresult >= $datelastrun)) {
678 $nbseconds = max($datelastresult - $datelastrun, 1);
679 print $nbseconds.
' '.$langs->trans(
"SecondShort");
684 print
'<td class="center tdlastresultcode" title="'.dol_escape_htmltag($obj->lastresult).
'">';
685 if ($obj->lastresult !=
'') {
686 if (empty($obj->lastresult)) {
687 print $obj->lastresult;
689 print
'<span class="error">'.dol_escape_htmltag(
dol_trunc($obj->lastresult)).
'</div>';
695 print
'<td class="small minwidth150">';
696 if (!empty($obj->lastoutput)) {
697 print
'<div class="twolinesmax classfortooltip" title="'.dol_escape_htmltag($obj->lastoutput, 1, 1).
'">';
704 print
'<td class="center">';
705 if (!empty($obj->datenextrun)) {
706 $datenextrun = $db->jdate($obj->datenextrun);
707 if (empty($obj->status)) {
708 print
'<span class="opacitymedium strikefordisabled">';
711 if ($obj->status == Cronjob::STATUS_ENABLED) {
712 if ($obj->maxrun && $obj->nbrun >= $obj->maxrun) {
714 } elseif ($datenextrun && $datenextrun < $now) {
718 if (empty($obj->status)) {
725 print
'<td class="center">';
726 print
$object->getLibStatut(5);
729 print
'<td class="nowraponall right">';
731 $backtopage = urlencode($_SERVER[
"PHP_SELF"].
'?'.$param.($sortfield ?
'&sortfield='.$sortfield :
'').($sortorder ?
'&sortorder='.$sortorder :
''));
732 if ($user->hasRight(
'cron',
'create')) {
733 print
'<a class="editfielda" href="'.DOL_URL_ROOT.
"/cron/card.php?id=".$obj->rowid.
'&action=edit&token='.
newToken().($sortfield ?
'&sortfield='.$sortfield :
'').($sortorder ?
'&sortorder='.$sortorder :
'').$param;
734 print
"&backtopage=".$backtopage.
"\" title=\"".
dol_escape_htmltag($langs->trans(
'Edit')).
"\">".
img_picto($langs->trans(
'Edit'),
'edit').
"</a> ";
736 if ($user->hasRight(
'cron',
'delete')) {
737 print
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
"?id=".$obj->rowid.
'&action=delete&token='.
newToken().($page ?
'&page='.$page :
'').($sortfield ?
'&sortfield='.$sortfield :
'').($sortorder ?
'&sortorder='.$sortorder :
'').$param;
738 print
'" title="'.dol_escape_htmltag($langs->trans(
'CronDelete')).
'">'.
img_picto($langs->trans(
'CronDelete'),
'delete',
'',
false, 0, 0,
'',
'marginleftonly').
'</a> ';
740 print
'<a href="#" title="'.dol_escape_htmltag($langs->trans(
'NotEnoughPermissions')).
'">'.
img_picto($langs->trans(
'NotEnoughPermissions'),
'delete',
'',
false, 0, 0,
'',
'marginleftonly').
'</a> ';
742 if ($user->hasRight(
'cron',
'execute')) {
743 if (!empty($obj->status)) {
744 print
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?id='.$obj->rowid.
'&action=execute&token='.
newToken();
746 print($sortfield ?
'&sortfield='.$sortfield :
'');
747 print($sortorder ?
'&sortorder='.$sortorder :
'');
748 print $param.
"\" title=\"".
dol_escape_htmltag($langs->trans(
'CronExecute')).
"\">".
img_picto($langs->trans(
'CronExecute'),
"play",
'',
false, 0, 0,
'',
'marginleftonly').
'</a>';
750 print
'<a href="#" class="cursordefault" title="'.dol_escape_htmltag($langs->trans(
'JobDisabled')).
'">'.
img_picto($langs->trans(
'JobDisabled'),
"playdisabled",
'',
false, 0, 0,
'',
'marginleftonly').
'</a>';
753 print
'<a href="#" class="cursornotallowed" title="'.dol_escape_htmltag($langs->trans(
'NotEnoughPermissions')).
'">'.
img_picto($langs->trans(
'NotEnoughPermissions'),
"playdisabled",
'',
false, 0, 0,
'',
'marginleftonly').
'</a>';
760 print
'<td class="nowraponall center">';
761 if ($massactionbutton || $massaction) {
763 if (in_array($obj->rowid, $arrayofselected)) {
766 print
'<input id="cb'.$obj->rowid.
'" class="flat checkforselect valignmiddle" type="checkbox" name="toselect[]" value="'.$obj->rowid.
'"'.($selected ?
' checked="checked"' :
'').
'>';
776 print
'<tr><td colspan="16"><span class="opacitymedium">'.$langs->trans(
'CronNoJobs').
'</span></td></tr>';
784if ($mode ==
'modulesetup') {
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
Empty header.
cronadmin_prepare_head()
Return array of tabs to used on pages to setup cron module.
verifCond($strToEvaluate, $onlysimplestring='1')
Verify if condition in string is ok or not.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
img_warning($titlealt='default', $moreatt='', $morecss='pictowarning')
Show warning logo.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
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)
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)
Generate natural SQL search string for a criteria (this criteria can be tested on one or several fiel...
dol_now($mode='auto')
Return date for now.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
newToken()
Return the value of token currently saved into session with name 'newtoken'.
print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $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, $hideselectlimit=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow='')
Print a title with navigation controls for pagination.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
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 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.