28 require
'../main.inc.php';
29 require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
30 require_once DOL_DOCUMENT_ROOT.
'/cron/class/cronjob.class.php';
31 require_once DOL_DOCUMENT_ROOT.
'/core/lib/cron.lib.php';
32 require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
35 $langs->loadLangs(array(
"admin",
"cron",
"bills",
"members"));
37 $action =
GETPOST(
'action',
'aZ09');
38 $massaction =
GETPOST(
'massaction',
'alpha');
39 $confirm =
GETPOST(
'confirm',
'alpha');
40 $toselect =
GETPOST(
'toselect',
'array');
41 $contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'cronjoblist';
45 $limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
46 $sortfield =
GETPOST(
'sortfield',
'aZ09comma');
47 $sortorder =
GETPOST(
'sortorder',
'aZ09comma');
49 if (empty($page) || $page == -1) {
52 $offset = $limit * $page;
53 $pageprev = $page - 1;
54 $pagenext = $page + 1;
56 $sortfield =
't.status,t.priority';
59 $sortorder =
'DESC,ASC';
61 $optioncss =
GETPOST(
'optioncss',
'alpha');
62 $mode =
GETPOST(
'mode',
'aZ09');
65 $search_label =
GETPOST(
"search_label",
'alpha');
66 $search_module_name =
GETPOST(
"search_module_name",
'alpha');
67 $search_lastresult =
GETPOST(
"search_lastresult",
"alphawithlgt");
68 $search_processing =
GETPOST(
"search_processing",
"int");
69 $securitykey =
GETPOST(
'securitykey',
'alpha');
71 $outputdir = $conf->cron->dir_output;
72 if (empty($outputdir)) {
73 $outputdir = $conf->cronjob->dir_output;
75 $diroutputmassaction = $outputdir.
'/temp/massgeneration/'.$user->id;
80 $hookmanager->initHooks(array(
'cronjoblist'));
84 $extrafields->fetch_name_optionals_label($object->table_element);
86 $search_array_options = $extrafields->getOptionalsFromPost($object->table_element,
'',
'search_');
89 if (!$user->rights->cron->read) {
93 $permissiontoread = $user->rights->cron->read;
94 $permissiontoadd = $user->rights->cron->create ? $user->rights->cron->create : $user->rights->cron->write;
95 $permissiontodelete = $user->rights->cron->delete;
96 $permissiontoexecute = $user->rights->cron->execute;
103 if (
GETPOST(
'cancel',
'alpha')) {
104 $action =
'list'; $massaction =
'';
106 if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
110 $parameters = array();
111 $reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
116 if (empty($reshook)) {
118 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
121 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
124 $search_lastresult =
'';
126 $search_array_options = array();
128 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')
129 ||
GETPOST(
'button_search_x',
'alpha') ||
GETPOST(
'button_search.x',
'alpha') ||
GETPOST(
'button_search',
'alpha')) {
134 if (!empty($search_label)) {
135 $filter[
't.label'] = $search_label;
139 if ($action ==
'confirm_delete' && $confirm ==
"yes" && $permissiontodelete) {
143 $result = $object->delete($user);
151 if ($action ==
'confirm_execute' && $confirm ==
"yes" && $permissiontoexecute) {
152 if (!empty($conf->global->CRON_KEY) && $conf->global->CRON_KEY != $securitykey) {
157 $job = $object->fetch($id);
161 $resrunjob = $object->run_jobs($user->login);
162 if ($resrunjob < 0) {
167 $res = $object->reprogram_jobs($user->login, $now);
169 if ($resrunjob >= 0) {
170 if ($object->lastresult >= 0) {
182 $param =
'&search_status='.urlencode($search_status);
183 if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
184 $param .=
'&contextpage='.urlencode($contextpage);
186 if ($limit > 0 && $limit != $conf->liste_limit) {
187 $param .=
'&limit='.urlencode($limit);
190 $param .=
'&search_label='.urlencode($search_label);
192 if ($optioncss !=
'') {
193 $param .=
'&optioncss='.urlencode($optioncss);
196 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
198 header(
"Location: ".DOL_URL_ROOT.
'/cron/list.php?'.$param.($sortfield ?
'&sortfield='.$sortfield :
'').($sortorder ?
'&sortorder='.$sortorder :
''));
204 $objectclass =
'CronJob';
205 $objectlabel =
'CronJob';
206 $uploaddir = $conf->cron->dir_output;
207 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
208 if ($massaction && $permissiontoadd) {
210 foreach ($toselect as $id) {
211 $result = $tmpcron->fetch($id);
214 if ($massaction ==
'disable') {
215 $result = $tmpcron->setStatut(Cronjob::STATUS_DISABLED);
216 } elseif ($massaction ==
'enable') {
217 $result = $tmpcron->setStatut(Cronjob::STATUS_ENABLED);
238 $pagetitle = $langs->trans(
"CronList");
246 $sql .=
" t.jobtype,";
248 $sql .=
" t.command,";
249 $sql .=
" t.classesname,";
250 $sql .=
" t.objectname,";
251 $sql .=
" t.methodename,";
252 $sql .=
" t.params,";
253 $sql .=
" t.md5params,";
254 $sql .=
" t.module_name,";
255 $sql .=
" t.priority,";
256 $sql .=
" t.processing,";
257 $sql .=
" t.datelastrun,";
258 $sql .=
" t.datenextrun,";
259 $sql .=
" t.dateend,";
260 $sql .=
" t.datestart,";
261 $sql .=
" t.lastresult,";
262 $sql .=
" t.datelastresult,";
263 $sql .=
" t.lastoutput,";
264 $sql .=
" t.unitfrequency,";
265 $sql .=
" t.frequency,";
266 $sql .=
" t.status,";
267 $sql .=
" t.fk_user_author,";
268 $sql .=
" t.fk_user_mod,";
270 $sql .=
" t.maxrun,";
272 $sql .=
" t.libname,";
274 $sql .=
" FROM ".MAIN_DB_PREFIX.
"cronjob as t";
275 $sql .=
" WHERE entity IN (0,".$conf->entity.
")";
276 if ($search_status >= 0 && $search_status < 2 && $search_status !=
'') {
277 $sql .=
" AND t.status = ".(empty($search_status) ?
'0' :
'1');
279 if ($search_lastresult !=
'') {
283 $sql .=
" AND t.processing = ".((int) $search_processing);
286 if (is_array($filter) && count($filter) > 0) {
287 foreach ($filter as $key => $value) {
288 $sql .=
" AND ".$key.
" LIKE '%".$db->escape($value).
"%'";
291 if (!empty($search_module_name)) {
295 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
297 $parameters = array();
298 $reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters);
299 $sql .= $hookmanager->resPrint;
301 $sql .= $db->order($sortfield, $sortorder);
305 if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
306 $result = $db->query($sql);
314 $sql .= $db->plimit($limit + 1, $offset);
316 $result = $db->query($sql);
321 $num = $db->num_rows($result);
323 $arrayofselected = is_array($toselect) ? $toselect : array();
326 if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
327 $param .=
'&contextpage='.urlencode($contextpage);
329 if ($limit > 0 && $limit != $conf->liste_limit) {
330 $param .=
'&limit='.urlencode($limit);
332 if ($search_status) {
333 $param .=
'&search_status='.urlencode($search_status);
336 $param .=
'&search_label='.urlencode($search_label);
338 if ($search_module_name) {
339 $param .=
'&search_module_name='.urlencode($search_module_name);
341 if ($search_lastresult) {
342 $param .=
'&search_lastresult='.urlencode($search_lastresult);
345 $param .=
'&mode='.urlencode($mode);
347 if ($optioncss !=
'') {
348 $param .=
'&optioncss='.urlencode($optioncss);
351 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
355 if ($action ==
'execute') {
356 print
$form->formconfirm($_SERVER[
'PHP_SELF'].
"?id=".$id.
'&securitykey='.$securitykey.$param, $langs->trans(
"CronExecute"), $langs->trans(
"CronConfirmExecute"),
"confirm_execute",
'',
'', 1);
359 if ($action ==
'delete' && empty($toselect)) {
360 print
$form->formconfirm($_SERVER[
'PHP_SELF'].
"?id=".$id.$param, $langs->trans(
"CronDelete"), $langs->trans(
"CronConfirmDelete"),
"confirm_delete",
'',
'', 1);
364 $arrayofmassactions = array(
367 'enable'=>
img_picto(
'',
'check',
'class="pictofixedwidth"').$langs->trans(
"CronStatusActiveBtn"),
368 'disable'=>
img_picto(
'',
'uncheck',
'class="pictofixedwidth"').$langs->trans(
"CronStatusInactiveBtn"),
370 if ($user->rights->cron->delete) {
371 $arrayofmassactions[
'predelete'] =
img_picto(
'',
'delete',
'class="pictofixedwidth"').$langs->trans(
"Delete");
373 if (
GETPOST(
'nomassaction',
'int') || in_array($massaction, array(
'presend',
'predelete'))) {
374 $arrayofmassactions = array();
376 $massactionbutton =
$form->selectMassAction(
'', $arrayofmassactions);
378 if ($mode ==
'modulesetup') {
379 $linkback =
'<a href="'.DOL_URL_ROOT.
'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToModuleList").
'</a>';
380 print
load_fiche_titre($langs->trans(
"CronSetup"), $linkback,
'title_setup');
386 print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'" name="search_form">'.
"\n";
387 if ($optioncss !=
'') {
388 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
390 print
'<input type="hidden" name="token" value="'.newToken().
'">';
391 print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
392 print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
393 print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
394 print
'<input type="hidden" name="page" value="'.$page.
'">';
395 print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
396 print
'<input type="hidden" name="mode" value="'.$mode.
'">';
399 $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->rights->cron->create);
402 if ($mode ==
'modulesetup') {
409 print_barre_liste($pagetitle, $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num,
$nbtotalofrecords, ($mode ==
'modulesetup' ?
'' :
'title_setup'), 0, $newcardbutton,
'', $limit);
412 $topicmail =
"SendCronRef";
415 $trackid =
'cron'.$object->id;
416 include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
418 $text = $langs->trans(
"HoursOnThisPageAreOnServerTZ").
' '.$stringcurrentdate.
'<br>';
419 if (!empty($conf->global->CRON_WARNING_DELAY_HOURS)) {
420 $text .= $langs->trans(
"WarningCronDelayed", $conf->global->CRON_WARNING_DELAY_HOURS);
426 $selectedfields =
'';
428 $selectedfields .= (count($arrayofmassactions) ?
$form->showCheckAddButtons(
'checkforselect', 1) :
'');
430 print
'<div class="div-table-responsive">';
431 print
'<table class="noborder">';
433 print
'<tr class="liste_titre_filter">';
434 print
'<td class="liste_titre"> </td>';
435 print
'<td class="liste_titre">';
436 print
'<input type="text" class="flat" name="search_label" value="'.$search_label.
'">';
438 print
'<td class="liste_titre"> </td>';
439 print
'<td class="liste_titre"><input type="text" class="width50" name="search_module_name" value="'.$search_module_name.
'"></td>';
440 print
'<td class="liste_titre"> </td>';
441 print
'<td class="liste_titre"> </td>';
444 print
'<td class="liste_titre"> </td>';
445 print
'<td class="liste_titre"> </td>';
446 print
'<td class="liste_titre"> </td>';
447 print
'<td class="liste_titre center"><input type="text" class="width50" name="search_lastresult" value="'.$search_lastresult.
'"></td>';
448 print
'<td class="liste_titre"> </td>';
449 print
'<td class="liste_titre"> </td>';
450 print
'<td class="liste_titre center">';
451 print
$form->selectarray(
'search_status', array(
'0'=>$langs->trans(
"Disabled"),
'1'=>$langs->trans(
"Scheduled")), $search_status, 1, 0, 0,
'', 0, 0, 0,
'',
'onrightofpage');
452 print
'</td><td class="liste_titre right">';
453 $searchpicto =
$form->showFilterButtons();
458 print
'<tr class="liste_titre">';
461 print_liste_field_titre(
"Prority", $_SERVER[
"PHP_SELF"],
"t.priority",
"", $param,
'', $sortfield, $sortorder);
462 print_liste_field_titre(
"CronModule", $_SERVER[
"PHP_SELF"],
"t.module_name",
"", $param,
'', $sortfield, $sortorder);
467 print_liste_field_titre(
"CronNbRun", $_SERVER[
"PHP_SELF"],
"t.nbrun",
"", $param,
'', $sortfield, $sortorder,
'right tdoverflowmax50');
468 print_liste_field_titre(
"CronDtLastLaunch", $_SERVER[
"PHP_SELF"],
"t.datelastrun",
"", $param,
'', $sortfield, $sortorder,
'center ');
469 print_liste_field_titre(
"Duration", $_SERVER[
"PHP_SELF"],
"",
"", $param,
'', $sortfield, $sortorder,
'center ');
470 print_liste_field_titre(
"CronLastResult", $_SERVER[
"PHP_SELF"],
"t.lastresult",
"", $param,
'', $sortfield, $sortorder,
'center ');
471 print_liste_field_titre(
"CronLastOutput", $_SERVER[
"PHP_SELF"],
"t.lastoutput",
"", $param,
'', $sortfield, $sortorder);
472 print_liste_field_titre(
"CronDtNextLaunch", $_SERVER[
"PHP_SELF"],
"t.datenextrun",
"", $param,
'', $sortfield, $sortorder,
'center ');
473 print_liste_field_titre(
"Status", $_SERVER[
"PHP_SELF"],
"t.status,t.priority",
"", $param,
'', $sortfield, $sortorder,
'center ');
474 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
"", $param,
'', $sortfield, $sortorder,
'center maxwidthsearch ');
483 while ($i < min($num, $limit)) {
484 $obj = $db->fetch_object($result);
490 if (isset($obj->test)) {
498 if (preg_match(
'/:(.*)$/', $obj->label, $reg)) {
499 $langs->load($reg[1]);
502 $object->id = $obj->rowid;
503 $object->ref = $obj->rowid;
504 $object->label = preg_replace(
'/:.*$/',
'', $obj->label);
505 $object->status = $obj->status;
506 $object->priority = $obj->priority;
507 $object->processing = $obj->processing;
508 $object->lastresult = $obj->lastresult;
509 $object->datestart = $db->jdate($obj->datestart);
510 $object->dateend = $db->jdate($obj->dateend);
511 $object->module_name = $obj->module_name;
513 $datelastrun = $db->jdate($obj->datelastrun);
514 $datelastresult = $db->jdate($obj->datelastresult);
516 print
'<tr class="oddeven">';
519 print
'<td class="nowraponall">';
520 print $object->getNomUrl(1);
524 print
'<td class="tdoverflowmax300">';
525 if (!empty($object->label)) {
526 $object->ref = $langs->trans($object->label);
527 print
'<span title="'.dol_escape_htmltag($langs->trans($object->label)).
'">'.$object->getNomUrl(0,
'', 1).
'</span>';
528 $object->ref = $obj->rowid;
535 print
'<td class="right">';
545 print
'<td class="nowraponall">';
546 if ($obj->jobtype ==
'method') {
547 $text = $langs->trans(
"CronClass");
548 $texttoshow = $langs->trans(
'CronModule').
': '.$obj->module_name.
'<br>';
549 $texttoshow .= $langs->trans(
'CronClass').
': '.$obj->classesname.
'<br>';
550 $texttoshow .= $langs->trans(
'CronObject').
': '.$obj->objectname.
'<br>';
551 $texttoshow .= $langs->trans(
'CronMethod').
': '.$obj->methodename;
552 $texttoshow .=
'<br>'.$langs->trans(
'CronArgs').
': '.$obj->params;
553 $texttoshow .=
'<br>'.$langs->trans(
'Comment').
': '.$langs->trans($obj->note);
554 } elseif ($obj->jobtype ==
'command') {
555 $text = $langs->trans(
'CronCommand');
556 $texttoshow = $langs->trans(
'CronCommand').
': '.
dol_trunc($obj->command);
557 $texttoshow .=
'<br>'.$langs->trans(
'CronArgs').
': '.$obj->params;
558 $texttoshow .=
'<br>'.$langs->trans(
'Comment').
': '.$langs->trans($obj->note);
560 print
$form->textwithpicto($text, $texttoshow, 1);
564 if ($obj->unitfrequency ==
"60") {
565 $s = ($obj->frequency).
" ".($obj->frequency > 1 ? $langs->trans(
'Minutes') : $langs->trans(
'Minute'));
566 } elseif ($obj->unitfrequency ==
"3600") {
567 $s = ($obj->frequency).
" ".($obj->frequency > 1 ? $langs->trans(
'Hours') : $langs->trans(
'Hour'));
568 } elseif ($obj->unitfrequency ==
"86400") {
569 $s = ($obj->frequency).
" ".($obj->frequency > 1 ? $langs->trans(
'Days') : $langs->trans(
'Day'));
570 } elseif ($obj->unitfrequency ==
"604800") {
571 $s = ($obj->frequency).
" ".($obj->frequency > 1 ? $langs->trans(
'Weeks') : $langs->trans(
'Week'));
572 } elseif ($obj->unitfrequency ==
"2678400") {
573 $s = ($obj->frequency).
" ".($obj->frequency > 1 ? $langs->trans(
'Months') : $langs->trans(
'Month'));
575 print
'<td class="tdoverflowmax125" title="'.$s.
'">';
593 print
'<td class="right">';
594 if (!empty($obj->nbrun)) {
599 if (!empty($obj->maxrun)) {
600 print
' <span class="'.$langs->trans(
"Max").
'">/ '.
dol_escape_htmltag($obj->maxrun).
'</span>';
604 $datefromto = (empty($datelastrun) ?
'' :
dol_print_date($datelastrun,
'dayhoursec',
'tzserver')).
' - '.(empty($datelastresult) ?
'' :
dol_print_date($datelastresult,
'dayhoursec',
'tzserver'));
607 print
'<td class="center" title="'.dol_escape_htmltag($datefromto).
'">';
608 if (!empty($datelastrun)) {
614 print
'<td class="center" title="'.dol_escape_htmltag($datefromto).
'">';
615 if (!empty($datelastresult) && ($datelastresult >= $datelastrun)) {
622 print
'<td class="center tdlastresultcode" title="'.dol_escape_htmltag($obj->lastresult).
'">';
623 if ($obj->lastresult !=
'') {
624 if (empty($obj->lastresult)) {
625 print $obj->lastresult;
627 print
'<span class="error">'.dol_escape_htmltag(
dol_trunc($obj->lastresult)).
'</div>';
633 print
'<td class="small minwidth150">';
634 if (!empty($obj->lastoutput)) {
635 print
'<div class="twolinesmax classfortooltip" title="'.dol_escape_htmltag($obj->lastoutput, 1, 1).
'">';
642 print
'<td class="center minwidth100">';
643 if (!empty($obj->datenextrun)) {
644 $datenextrun = $db->jdate($obj->datenextrun);
645 if (empty($obj->status)) {
646 print
'<span class="opacitymedium">';
649 if ($obj->status == Cronjob::STATUS_ENABLED) {
650 if ($obj->maxrun && $obj->nbrun >= $obj->maxrun) {
652 } elseif ($datenextrun && $datenextrun < $now) {
656 if (empty($obj->status)) {
663 print
'<td class="center">';
664 print $object->getLibStatut(5);
667 print
'<td class="nowraponall right">';
669 $backtopage = urlencode($_SERVER[
"PHP_SELF"].
'?'.$param.($sortfield ?
'&sortfield='.$sortfield :
'').($sortorder ?
'&sortorder='.$sortorder :
''));
670 if ($user->rights->cron->create) {
671 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;
672 print
"&backtopage=".$backtopage.
"\" title=\"".
dol_escape_htmltag($langs->trans(
'Edit')).
"\">".
img_picto($langs->trans(
'Edit'),
'edit').
"</a> ";
674 if ($user->rights->cron->delete) {
675 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;
676 print
"\" title=\"".dol_escape_htmltag($langs->trans(
'CronDelete')).
"\">".
img_picto($langs->trans(
'CronDelete'),
'delete',
'',
false, 0, 0,
'',
'marginleftonly').
"</a> ";
678 print
"<a href=\"#\" title=\"".dol_escape_htmltag($langs->trans(
'NotEnoughPermissions')).
"\">".
img_picto($langs->trans(
'NotEnoughPermissions'),
'delete',
'',
false, 0, 0,
'',
'marginleftonly').
"</a> ";
680 if ($user->rights->cron->execute) {
681 if (!empty($obj->status)) {
682 print
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?id='.$obj->rowid.
'&action=execute';
683 print (empty($conf->global->CRON_KEY) ?
'' :
'&securitykey='.$conf->global->CRON_KEY);
684 print ($sortfield ?
'&sortfield='.$sortfield :
'');
685 print ($sortorder ?
'&sortorder='.$sortorder :
'');
686 print $param.
"\" title=\"".
dol_escape_htmltag($langs->trans(
'CronExecute')).
"\">".
img_picto($langs->trans(
'CronExecute'),
"play",
'',
false, 0, 0,
'',
'marginleftonly').
'</a>';
688 print
'<a href="#" class="cursordefault" title="'.dol_escape_htmltag($langs->trans(
'JobDisabled')).
'">'.
img_picto($langs->trans(
'JobDisabled'),
"playdisabled",
'',
false, 0, 0,
'',
'marginleftonly').
'</a>';
691 print
'<a href="#" class="cursornotallowed" title="'.dol_escape_htmltag($langs->trans(
'NotEnoughPermissions')).
'">'.
img_picto($langs->trans(
'NotEnoughPermissions'),
"playdisabled",
'',
false, 0, 0,
'',
'marginleftonly').
'</a>';
693 if ($massactionbutton || $massaction) {
695 if (in_array($obj->rowid, $arrayofselected)) {
698 print
' <input id="cb'.$obj->rowid.
'" class="flat checkforselect valignmiddle" type="checkbox" name="toselect[]" value="'.$obj->rowid.
'"'.($selected ?
' checked="checked"' :
'').
'>';
707 print
'<tr><td colspan="15" class="opacitymedium">'.$langs->trans(
'CronNoJobs').
'</td></tr>';
715 if ($mode ==
'modulesetup') {
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
cronadmin_prepare_head()
Return array of tabs to used on pages to setup cron module.
convertSecondToTime($iSecond, $format='all', $lengthOfDay=86400, $lengthOfWeek=7)
Return, in clear text, value of a number of seconds in days, hours and minutes.
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='')
Show tabs of a record.
img_warning($titlealt='default', $moreatt='', $morecss='pictowarning')
Show warning logo.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0)
Returns text escaped for inclusion in HTML alt or title tags, or into values of HTML input fields.
dolGetFirstLineOfText($text, $nboflines=1, $charset='UTF-8')
Return first line of text.
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
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...
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='')
Set event messages in dol_events session object.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs='', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
dol_now($mode='auto')
Return date for now.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
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.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
info_admin($text, $infoonimgalt=0, $nodiv=0, $admin='1', $morecss='hideonsmartphone', $textfordropdown='')
Show information for admin users or standard users.
print_barre_liste($titre, $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.
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.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
verifCond($strToEvaluate)
Verify if condition in string is ok or not.
$nbtotalofrecords
Count total nb of records.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.