dolibarr 25.0.0-alpha
list.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2012 Nicolas Villa aka Boyquotes http://informetic.fr
3 * Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
4 * Copyright (C) 2013-2021 Laurent Destailleur <eldy@users.sourceforge.net>
5 * Copyright (C) 2019-2024 Frédéric France <frederic.france@free.fr>
6 * Copyright (C) 2024-2026 MDW <mdeweerd@users.noreply.github.com>
7 * Copyright (C) 2024 Alexandre Spangaro <alexandre@inovea-conseil.com>
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 3 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program. If not, see <https://www.gnu.org/licenses/>.
21 */
22
29// Load Dolibarr environment
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';
43
44// Load translation files required by the page
45$langs->loadLangs(array("admin", "cron", "bills", "members"));
46
47$action = GETPOST('action', 'aZ09');
48$massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists)
49$confirm = GETPOST('confirm', 'alpha');
50$toselect = GETPOST('toselect', 'array:int'); // Array of ids of elements selected into a list
51$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'cronjoblist'; // To manage different context of search
52$optioncss = GETPOST('optioncss', 'alpha');
53$mode = GETPOST('mode', 'aZ09');
54
55//Search criteria
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');
62$filter = array(); // Search filter built later, initialized here so it is always defined (e.g. when a hook intercepts the Actions section)
63
64$id = GETPOSTINT('id');
65
66// Load variable for pagination
67$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit;
68$sortfield = GETPOST('sortfield', 'aZ09comma');
69$sortorder = GETPOST('sortorder', 'aZ09comma');
70$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT('page');
71if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) {
72 // If $page is not defined, or '' or -1 or if we click on clear filters
73 $page = 0;
74}
75$offset = $limit * $page;
76$pageprev = $page - 1;
77$pagenext = $page + 1;
78
79$outputdir = $conf->cron->dir_output;
80if (empty($outputdir)) {
81 $outputdir = $conf->cronjob->dir_output;
82}
83
84// Initialize technical objects
85$object = new Cronjob($db);
86$extrafields = new ExtraFields($db);
87$diroutputmassaction = $outputdir.'/temp/massgeneration/'.$user->id;
88$hookmanager->initHooks(array('cronjoblist'));
89
90// Fetch optionals attributes and labels
91$extrafields->fetch_name_optionals_label($object->table_element);
92
93$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
94
95// Default sort order (if not yet defined by previous GETPOST)
96if (!$sortfield) {
97 $sortfield = 't.priority,t.status';
98}
99if (!$sortorder) {
100 $sortorder = 'ASC,DESC';
101}
102
103// List of fields to search into when doing a "search in all"
104$fieldstosearchall = array();
105// foreach ($object->fields as $key => $val) {
106// if (!empty($val['searchall'])) {
107// $fieldstosearchall['t.'.$key] = $val['label'];
108// }
109// }
110// $parameters = array('fieldstosearchall'=>$fieldstosearchall);
111// $reshook = $hookmanager->executeHooks('completeFieldsToSearchAll', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
112// if ($reshook > 0) {
113// $fieldstosearchall = empty($hookmanager->resArray['fieldstosearchall']) ? array() : $hookmanager->resArray['fieldstosearchall'];
114// } elseif ($reshook == 0) {
115// $fieldstosearchall = array_merge($fieldstosearchall, empty($hookmanager->resArray['fieldstosearchall']) ? array() : $hookmanager->resArray['fieldstosearchall']);
116// }
117
118// Definition of array of fields for columns from ->fields
119$tableprefix = 't';
120$arrayfields = array();
121// Add hook to complete $arrayfield
122$parameters = array('arrayfields' => &$arrayfields);
123$reshook = $hookmanager->executeHooks('completeArrayFields', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
124/*
125foreach ($object->fields as $key => $val) {
126 // If $val['visible']==0, then we never show the field
127 if (!empty($val['visible'])) {
128 $visible = (int) dol_eval((string) $val['visible'], 1);
129 $arrayfields[$tableprefix.'.'.$key] = array(
130 'label' => $val['label'],
131 'checked' => (($visible < 0) ? '0' : '1'),
132 'enabled' => (string) (int) (abs($visible) != 3 && (bool) dol_eval((string) $val['enabled'], 1)),
133 'position' => $val['position'],
134 'help' => isset($val['help']) ? $val['help'] : ''
135 );
136 }
137}
138*/
139
140$object->fields = dol_sort_array($object->fields, 'position');
141$arrayfields = dol_sort_array($arrayfields, 'position');
142
143
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');
148
149// Security
150if (!$permissiontoread) {
152}
153// after this test $permissiontoread is always true and never can't be false
154
155$error = 0;
156//var_dump($arrayfields);
157
158
159/*
160 * Actions
161 */
162
163if (GETPOST('cancel', 'alpha')) {
164 $action = 'list';
165 $massaction = '';
166}
167if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') {
168 $massaction = '';
169}
170
171$parameters = array('arrayfields' => &$arrayfields);
172$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
173if ($reshook < 0) {
174 setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
175}
176
177if (empty($reshook)) {
178 // Selection of new fields
179 include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
180
181 // Purge search criteria
182 if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers
183 $search_label = '';
184 $search_status = -1;
185 $search_lastresult = '';
186 $search_module_name = '';
187 $toselect = array();
188 $search_array_options = array();
189 }
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')) {
192 $massaction = ''; // Protection to avoid mass action if we force a new search during a mass action confirmation
193 }
194
195 $filter = array();
196 if (!empty($search_label)) {
197 $filter['t.label'] = $search_label;
198 }
199
200 // Delete jobs
201 if ($action == 'confirm_delete' && $confirm == "yes" && $permissiontodelete) {
202 //Delete cron task
203 $object = new Cronjob($db);
204 $object->id = $id;
205 $result = $object->delete($user);
206
207 if ($result < 0) {
208 setEventMessages($object->error, $object->errors, 'errors');
209 }
210 }
211
212 // Execute jobs
213 if ($action == 'confirm_execute' && $confirm == "yes" && $permissiontoexecute) {
214 if (getDolGlobalString('CRON_KEY') && getDolGlobalString('CRON_KEY') != $securitykey) {
215 setEventMessages('Security key '.$securitykey.' is wrong', null, 'errors');
216 $action = '';
217 } else {
218 $object = new Cronjob($db);
219 $job = $object->fetch($id);
220
221 $now = dol_now(); // Date we start
222
223 $resrunjob = $object->run_jobs($user->login); // Return -1 if KO, 1 if OK
224 if ($resrunjob < 0) {
225 setEventMessages($object->error, $object->errors, 'errors');
226 }
227
228 // Plan next run
229 $res = $object->reprogram_jobs($user->login, $now);
230 if ($res > 0) {
231 if ($resrunjob >= 0) { // We show the result of reprogram only if no error message already reported
232 if ($object->lastresult >= 0) {
233 setEventMessages($langs->trans("JobFinished"), null, 'mesgs');
234 } else {
235 setEventMessages($langs->trans("JobFinished"), null, 'errors');
236 }
237 }
238 $action = '';
239 } else {
240 setEventMessages($object->error, $object->errors, 'errors');
241 $action = '';
242 }
243
244 $param = '&search_status='.urlencode($search_status);
245 if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
246 $param .= '&contextpage='.urlencode($contextpage);
247 }
248 if ($limit > 0 && $limit != $conf->liste_limit) {
249 $param .= '&limit='.((int) $limit);
250 }
251 if ($search_label) {
252 $param .= '&search_label='.urlencode($search_label);
253 }
254 if ($optioncss != '') {
255 $param .= '&optioncss='.urlencode($optioncss);
256 }
257 // Add $param from extra fields
258 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
259
260 header("Location: ".DOL_URL_ROOT.'/cron/list.php?'.$param.'&sortfield='.$sortfield.'&sortorder='.$sortorder); // Make a redirect to avoid to run twice the job when using back
261 exit;
262 }
263 }
264
265 // Mass actions
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) {
271 $tmpcron = new Cronjob($db);
272 foreach ($toselect as $id) {
273 $result = $tmpcron->fetch($id);
274 if ($result) {
275 $result = 0;
276 if ($massaction == 'disable') {
277 $result = $tmpcron->setStatut(Cronjob::STATUS_DISABLED);
278 } elseif ($massaction == 'enable') {
279 $result = $tmpcron->setStatut(Cronjob::STATUS_ENABLED);
280 }
281 //else dol_print_error($db, 'Bad value for massaction');
282 if ($result < 0) {
283 setEventMessages($tmpcron->error, $tmpcron->errors, 'errors');
284 }
285 } else {
286 $error++;
287 }
288 }
289 }
290}
291
292
293/*
294 * View
295 */
296
297$now = dol_now();
298
299$form = new Form($db);
300$cronjob = new Cronjob($db);
301
302$title = $langs->trans("CronList");
303
304llxHeader('', $title, '', '', 0, 0, '', '', '', 'bodyforlist');
305
306$TTestNotAllowed = array();
307$sqlTest = 'SELECT rowid, test FROM '.MAIN_DB_PREFIX.'cronjob';
308$resultTest = $db->query($sqlTest);
309if ($resultTest) {
310 while ($objTest = $db->fetch_object($resultTest)) {
311 $veriftest = verifCond($objTest->test);
312 if (!$veriftest) {
313 $TTestNotAllowed[$objTest->rowid] = $objTest->rowid;
314 }
315 }
316}
317
318// Build and execute select
319// --------------------------------------------------------------------
320$sql = "SELECT";
321$sql .= " t.rowid,";
322$sql .= " t.tms,";
323$sql .= " t.datec,";
324$sql .= " t.jobtype,";
325$sql .= " t.label,";
326$sql .= " t.command,";
327$sql .= " t.classesname,";
328$sql .= " t.objectname,";
329$sql .= " t.methodename,";
330$sql .= " t.params,";
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,";
344$sql .= " t.status,";
345$sql .= " t.fk_user_author,";
346$sql .= " t.fk_user_mod,";
347$sql .= " t.note,";
348$sql .= " t.maxrun,";
349$sql .= " t.nbrun,";
350$sql .= " t.libname,";
351$sql .= " t.test";
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)).')';
356}
357if ($search_status >= 0 && $search_status < 2 && $search_status != '') {
358 $sql .= " AND t.status = ".(empty($search_status) ? '0' : '1');
359}
360if ($search_lastresult != '') {
361 $sql .= natural_search("t.lastresult", $search_lastresult, 1);
362}
363if (GETPOSTISSET('search_processing')) {
364 $sql .= " AND t.processing = ".((int) $search_processing);
365}
366// Manage filter
367if (count($filter) > 0) {
368 foreach ($filter as $key => $value) {
369 $sql .= " AND ".$db->sanitize($key)." LIKE '%".$db->escape($value)."%'";
370 }
371}
372if (!empty($search_module_name)) {
373 $sql .= natural_search("t.module_name", $search_module_name);
374}
375// Add where from extra fields
376include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
377// Add where from hooks
378$parameters = array();
379$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
380$sql .= $hookmanager->resPrint;
381
382
383// Count total nb of records
384$nbtotalofrecords = '';
385if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
386 $sqlforcount = $sql;
387
388 $resql = $db->query($sqlforcount);
389 if ($resql) {
390 $nbtotalofrecords = $db->num_rows($resql);
391 } else {
393 }
394
395 if (($page * $limit) > (int) $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
396 $page = 0;
397 $offset = 0;
398 }
399 $db->free($resql);
400}
401
402// Complete request and execute it with limit
403$sql .= $db->order($sortfield, $sortorder);
404if ($limit) {
405 $sql .= $db->plimit($limit + 1, $offset);
406}
407
408$resql = $db->query($sql);
409if (!$resql) {
411 exit;
412}
413
414$num = $db->num_rows($resql);
415
416$arrayofselected = is_array($toselect) ? $toselect : array();
417
418$param = '';
419if (!empty($mode)) {
420 $param .= '&mode='.urlencode($mode);
421}
422if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
423 $param .= '&contextpage='.urlencode($contextpage);
424}
425if ($limit > 0 && $limit != $conf->liste_limit) {
426 $param .= '&limit='.((int) $limit);
427}
428if ($optioncss != '') {
429 $param .= '&optioncss='.urlencode($optioncss);
430}
431if ($search_status) {
432 $param .= '&search_status='.urlencode($search_status);
433}
434if ($search_label) {
435 $param .= '&search_label='.urlencode($search_label);
436}
437if ($search_module_name) {
438 $param .= '&search_module_name='.urlencode($search_module_name);
439}
440if ($search_lastresult) {
441 $param .= '&search_lastresult='.urlencode($search_lastresult);
442}
443// Add $param from extra fields
444include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
445
446$stringcurrentdate = $langs->trans("CurrentHour").': '.dol_print_date(dol_now(), 'dayhour');
447
448if ($action == 'execute') {
449 print $form->formconfirm($_SERVER['PHP_SELF']."?id=".$id.'&securitykey='.$securitykey.$param, $langs->trans("CronExecute"), $langs->trans("CronConfirmExecute"), "confirm_execute", '', '', 1);
450}
451
452if ($action == 'delete' && empty($toselect)) { // Used when we make a delete on 1 line (not used for mass delete)
453 print $form->formconfirm($_SERVER['PHP_SELF']."?id=".$id.$param, $langs->trans("CronDelete"), $langs->trans("CronConfirmDelete"), "confirm_delete", '', '', 1);
454}
455
456// List of mass actions available
457$arrayofmassactions = array(
458//'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"),
459//'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
460 'enable' => img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("CronStatusActiveBtn"),
461 'disable' => img_picto('', 'uncheck', 'class="pictofixedwidth"').$langs->trans("CronStatusInactiveBtn"),
462);
463if ($user->hasRight('cron', 'delete')) {
464 $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
465}
466if (GETPOSTINT('nomassaction') || in_array($massaction, array('presend', 'predelete'))) {
467 $arrayofmassactions = array();
468}
469$massactionbutton = $form->selectMassAction('', $arrayofmassactions);
470
471$head = [];
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');
475
476 // Configuration header
477 $head = cronadmin_prepare_head();
478}
479
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.'">';
483}
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.'">';
492
493// Line with explanation and button new
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'));
495
496
497if ($mode == 'modulesetup') {
498 print dol_get_fiche_head($head, 'jobs', $langs->trans("Module2300Name"), -1, 'cron');
499
500 //print '<span class="opacitymedium">'.$langs->trans('CronInfo').'</span><br>';
501}
502
503
504print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, ($mode == 'modulesetup' ? '' : 'title_setup'), 0, $newcardbutton, '', $limit);
505
506// Add code for pre mass action (confirmation or email presend form)
507$topicmail = "SendCronRef";
508$modelmail = "cron";
509$objecttmp = new Cronjob($db);
510$trackid = 'cron'.$object->id;
511include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
512
513$text = $langs->trans("HoursOnThisPageAreOnServerTZ").' '.$stringcurrentdate.'<br>';
514if (getDolGlobalString('CRON_WARNING_DELAY_HOURS')) {
515 $text .= $langs->trans("WarningCronDelayed", getDolGlobalString('CRON_WARNING_DELAY_HOURS'));
516}
517print info_admin($text);
518//print '<br>';
519
520$moreforfilter = '';
521
522$parameters = array();
523$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
524if (empty($reshook)) {
525 $moreforfilter .= $hookmanager->resPrint;
526} else {
527 $moreforfilter = $hookmanager->resPrint;
528}
529$parameters = array(
530 'arrayfields' => &$arrayfields,
531);
532
533if (!empty($moreforfilter)) {
534 print '<div class="liste_titre liste_titre_bydiv centpercent">';
535 print $moreforfilter;
536 print '</div>';
537}
538
539$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
540$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, $conf->main_checkbox_left_column); // This also change content of $arrayfields with user setup
541$selectedfields = (($mode != 'kanban' && $mode != 'kanbangroupby') ? $htmlofselectarray : '');
542$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
543
544print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table
545print '<table class="tagtable nobottomiftotal noborder liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
546
547// Fields title search
548// --------------------------------------------------------------------
549print '<tr class="liste_titre_filter">';
550// Action column
551if ($conf->main_checkbox_left_column) {
552 print '<td class="liste_titre center maxwidthsearch">';
553 $searchpicto = $form->showFilterButtons('left');
554 print $searchpicto;
555 print '</td>';
556}
557print '<td class="liste_titre">&nbsp;</td>';
558print '<td class="liste_titre">';
559print '<input type="text" class="flat width75" name="search_label" value="'.$search_label.'">';
560print '</td>';
561print '<td class="liste_titre">&nbsp;</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">&nbsp;</td>';
564print '<td class="liste_titre">&nbsp;</td>';
565//print '<td class="liste_titre">&nbsp;</td>';
566//print '<td class="liste_titre">&nbsp;</td>';
567print '<td class="liste_titre">&nbsp;</td>';
568print '<td class="liste_titre">&nbsp;</td>';
569print '<td class="liste_titre">&nbsp;</td>';
570print '<td class="liste_titre center"><input type="text" class="width50" name="search_lastresult" value="'.$search_lastresult.'"></td>';
571print '<td class="liste_titre">&nbsp;</td>';
572print '<td class="liste_titre">&nbsp;</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');
575print '</td>';
576print '<td class="liste_titre">&nbsp;</td>';
577// Action column
578if (!$conf->main_checkbox_left_column) {
579 print '<td class="liste_titre right">';
580 $searchpicto = $form->showFilterButtons();
581 print $searchpicto;
582 print '</td>';
583}
584print '</tr>'."\n";
585
586$totalarray = array();
587$totalarray['nbfield'] = 0;
588
589// Fields title label
590// --------------------------------------------------------------------
591print '<tr class="liste_titre">';
592// Action column
593if ($conf->main_checkbox_left_column) {
594 print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", "", $param, '', $sortfield, $sortorder, 'center maxwidthsearch ');
595}
596print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "t.rowid", "", $param, '', $sortfield, $sortorder);
597print_liste_field_titre("CronLabel", $_SERVER["PHP_SELF"], "t.label", "", $param, '', $sortfield, $sortorder);
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);
600print_liste_field_titre("", '', '', "", $param, '', $sortfield, $sortorder, 'tdoverflowmax50 ');
601print_liste_field_titre("CronFrequency", '', "", "", $param, '', $sortfield, $sortorder);
602//print_liste_field_titre("CronDtStart", $_SERVER["PHP_SELF"], "t.datestart", "", $param, 'align="center"', $sortfield, $sortorder);
603//print_liste_field_titre("CronDtEnd", $_SERVER["PHP_SELF"], "t.dateend", "", $param, 'align="center"', $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 ');
611print_liste_field_titre("", $_SERVER["PHP_SELF"], "", "", $param, '', $sortfield, $sortorder, 'center ');
612// Action column
613if (!$conf->main_checkbox_left_column) {
614 print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", "", $param, '', $sortfield, $sortorder, 'center maxwidthsearch ');
615}
616print '</tr>'."\n";
617
618// Loop on record
619// --------------------------------------------------------------------
620$i = 0;
621$savnbfield = $totalarray['nbfield'];
622$totalarray = array();
623$totalarray['nbfield'] = 0;
624$imaxinloop = ($limit ? min($num, $limit) : $num);
625
626if ($num > 0) {
627 // Loop on each job
628
629 while ($i < $imaxinloop) {
630 $obj = $db->fetch_object($resql);
631 if (empty($obj)) {
632 break;
633 }
634
635 $reg = array();
636 if (preg_match('/:(.*)$/', $obj->label, $reg)) {
637 $langs->load($reg[1]);
638 }
639
640 $object->id = $obj->rowid;
641 $object->ref = $obj->rowid;
642 $object->label = preg_replace('/:.*$/', '', $obj->label);
643 $object->status = $obj->status;
644 $object->priority = $obj->priority;
645 $object->processing = $obj->processing;
646 $object->lastresult = (string) $obj->lastresult;
647 $object->datestart = $db->jdate($obj->datestart);
648 $object->dateend = $db->jdate($obj->dateend);
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);
653
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'));
657
658
659 print '<tr class="oddeven row-with-select">';
660
661 // Action column
662 if ($conf->main_checkbox_left_column) {
663 print '<td class="nowraponall center">';
664 if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
665 $selected = 0;
666 if (in_array($obj->rowid, $arrayofselected)) {
667 $selected = 1;
668 }
669 print '<input id="cb'.$obj->rowid.'" class="flat checkforselect valignmiddle" type="checkbox" name="toselect[]" value="'.$obj->rowid.'"'.($selected ? ' checked="checked"' : '').'>';
670 }
671 print '</td>';
672 if (!$i) {
673 $totalarray['nbfield']++;
674 }
675 }
676
677 // Ref
678 print '<td class="nowraponall">';
679 print $object->getNomUrl(1);
680 print '</td>';
681 if (!$i) {
682 $totalarray['nbfield']++;
683 }
684
685 // Label
686 print '<td class="minwidth150">';
687 if (!empty($object->label)) {
688 $object->ref = $langs->trans($object->label);
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);
691 print '</div>';
692 $object->ref = $obj->rowid;
693 } else {
694 //print $langs->trans('CronNone');
695 }
696 print '</td>';
697 if (!$i) {
698 $totalarray['nbfield']++;
699 }
700
701 // Priority
702 print '<td class="right">';
703 print dol_escape_htmltag($object->priority);
704 print '</td>';
705
706 // Module
707 print '<td>';
708 print dol_escape_htmltag($object->module_name);
709 print '</td>';
710 if (!$i) {
711 $totalarray['nbfield']++;
712 }
713
714 // Class/Method
715 print '<td class="nowraponall">';
716 if ($obj->jobtype == 'method') {
717 $text = img_picto('', 'code');
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') {
726 $text = img_picto('', 'terminal');
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);
731 } else {
732 $texttoshow = '';
733 $texttoshow = '';
734 }
735 print '<span class="classfortooltip" title="'.dol_escape_htmltag($texttoshow, 1, 1).'">'.$text.'</a>';
736 print '</td>';
737 if (!$i) {
738 $totalarray['nbfield']++;
739 }
740
741 // Frequency
742 $s = '';
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'));
753 }
754 print '<td class="tdoverflowmax125 center" title="'.dol_escape_htmltag($s).'">';
755 print dol_escape_htmltag($s);
756 print '</td>';
757 if (!$i) {
758 $totalarray['nbfield']++;
759 }
760
761 /*
762 print '<td class="center">';
763 if (!empty($obj->datestart)) {
764 print dol_print_date($db->jdate($obj->datestart), 'dayhour', 'tzserver');
765 }
766 print '</td>';
767 if (!$i) {
768 $totalarray['nbfield']++;
769 }
770
771 print '<td class="center">';
772 if (!empty($obj->dateend)) {
773 print dol_print_date($db->jdate($obj->dateend), 'dayhour', 'tzserver');
774 }
775 print '</td>';
776 if (!$i) {
777 $totalarray['nbfield']++;
778 }
779 */
780
781 print '<td class="right">';
782 if (!empty($obj->nbrun)) {
783 print dol_escape_htmltag($obj->nbrun);
784 } else {
785 print '0';
786 }
787 if (!empty($obj->maxrun)) {
788 print ' <span class="'.$langs->trans("Max").'">/ '.dol_escape_htmltag($obj->maxrun).'</span>';
789 }
790 print '</td>';
791 if (!$i) {
792 $totalarray['nbfield']++;
793 }
794
795 // Date start last run
796 print '<td class="center celldateheight" title="'.dol_escape_htmltag($datefromto).'">';
797 if (!empty($datelastrun)) {
798 print dolOutputDates($datelastrun, null, 0, 1, '', 'tzserver');
799 }
800 print '</td>';
801 if (!$i) {
802 $totalarray['nbfield']++;
803 }
804
805 // Duration
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");
810 }
811 print '</td>';
812 if (!$i) {
813 $totalarray['nbfield']++;
814 }
815
816 // Return code of last run
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; // Print '0'
821 } else {
822 print '<span class="error">'.dol_escape_htmltag(dol_trunc($obj->lastresult)).'</div>';
823 }
824 }
825 print '</td>';
826 if (!$i) {
827 $totalarray['nbfield']++;
828 }
829
830 // Output of last run
831 print '<td class="small minwidth150">';
832 if (!empty($obj->lastoutput)) {
833 print '<div class="twolinesmax lineheightsmall classfortooltip" title="'.dolPrintHTMLForAttribute($obj->lastoutput).'">';
834 print dol_trunc(dolGetFirstLineOfText($obj->lastoutput, 2), 100);
835 print '</div>';
836 }
837 print '</td>';
838 if (!$i) {
839 $totalarray['nbfield']++;
840 }
841
842 // Next run date
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">';
848 }
849
850 $pictotoadd = '';
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) {
855 $pictotoadd .= img_warning($langs->trans("Late"));
856 }
857 }
858
859 print dolOutputDates($datenextrun, null, 0, 1, $pictotoadd);
860
861 if (empty($obj->status)) {
862 print '</span>';
863 }
864 }
865 print '</td>';
866 if (!$i) {
867 $totalarray['nbfield']++;
868 }
869
870 // Status
871 print '<td class="center">';
872 print $object->getLibStatut(5);
873 print '</td>';
874 if (!$i) {
875 $totalarray['nbfield']++;
876 }
877
878 // Action
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> &nbsp;";
884 }
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> &nbsp; ';
888 } else {
889 print '<a href="#" title="'.dol_escape_htmltag($langs->trans('NotEnoughPermissions')).'">'.img_picto($langs->trans('NotEnoughPermissions'), 'delete', '', 0, 0, 0, '', 'marginleftonly').'</a> &nbsp; ';
890 }
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();
894 print(!getDolGlobalString('CRON_KEY') ? '' : '&securitykey=' . getDolGlobalString('CRON_KEY'));
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>';
898 } else {
899 print '<a href="#" class="cursordefault" title="'.dol_escape_htmltag($langs->trans('JobDisabled')).'">'.img_picto($langs->trans('JobDisabled'), "playdisabled", '', 0, 0, 0, '', 'marginleftonly').'</a>';
900 }
901 } else {
902 print '<a href="#" class="cursornotallowed" title="'.dol_escape_htmltag($langs->trans('NotEnoughPermissions')).'">'.img_picto($langs->trans('NotEnoughPermissions'), "playdisabled", '', 0, 0, 0, '', 'marginleftonly').'</a>';
903 }
904 print '</td>';
905 if (!$i) {
906 $totalarray['nbfield']++;
907 }
908
909 // Action column
910 if (!$conf->main_checkbox_left_column) {
911 print '<td class="nowraponall center">';
912 if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
913 $selected = 0;
914 if (in_array($obj->rowid, $arrayofselected)) {
915 $selected = 1;
916 }
917 print '<input id="cb'.$obj->rowid.'" class="flat checkforselect valignmiddle" type="checkbox" name="toselect[]" value="'.$obj->rowid.'"'.($selected ? ' checked="checked"' : '').'>';
918 }
919 print '</td>';
920 if (!$i) {
921 $totalarray['nbfield']++;
922 }
923 }
924
925 print '</tr>'."\n";
926
927 $i++;
928 }
929} else {
930 print '<tr><td colspan="16"><span class="opacitymedium">'.$langs->trans('CronNoJobs').'</span></td></tr>';
931}
932
933$db->free($resql);
934
935$parameters = array('arrayfields' => $arrayfields, 'sql' => $sql);
936$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
937print $hookmanager->resPrint;
938
939print '</table>'."\n";
940print '</div>'."\n";
941
942print '</form>'."\n";
943
944if ($mode == 'modulesetup') {
945 print dol_get_fiche_end();
946}
947
948
949llxFooter();
950
951$db->close();
$id
Support class for third parties, contacts, members, users or resources.
Definition account.php:47
if(! $sortfield) if(! $sortorder) $object
Definition account.php:100
$totalarray
Definition list.php:501
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
Definition wrapper.php:91
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.
Definition wrapper.php:73
Cron Job class.
Class to manage standard extra fields.
Class to manage generation of HTML components Only common components must be here.
cronadmin_prepare_head()
Return array of tabs to used on pages to setup cron module.
Definition cron.lib.php:33
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $conf
The main.inc.php has been included so the following variable are now defined:
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $db
API class for accounts.
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.
Definition html.lib.php:519
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.
Definition html.lib.php:717
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...
Definition html.lib.php:172
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.