dolibarr 24.0.1
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// TODO Because the cron is run by an admin user, to allow write/run of con tasks without begin admin, we must first manage a field runner_user_id with ID of user to set who run the cron.
146$permissiontoadd = $user->hasRight('cron', 'write') && $user->admin;
147$permissiontoexecute = $user->hasRight('cron', 'write') && $user->admin;
148$permissiontodelete = $user->hasRight('cron', 'delete');
149
150// Security
151if (!$permissiontoread) {
153}
154// after this test $permissiontoread is always true and never can't be false
155
156$error = 0;
157//var_dump($arrayfields);
158
159
160/*
161 * Actions
162 */
163
164if (GETPOST('cancel', 'alpha')) {
165 $action = 'list';
166 $massaction = '';
167}
168if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') {
169 $massaction = '';
170}
171
172$parameters = array('arrayfields' => &$arrayfields);
173$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
174if ($reshook < 0) {
175 setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
176}
177
178if (empty($reshook)) {
179 // Selection of new fields
180 include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
181
182 // Purge search criteria
183 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
184 $search_label = '';
185 $search_status = -1;
186 $search_module_name = '';
187 $search_lastresult = '';
188 $search_module_name = '';
189 $toselect = array();
190 $search_array_options = array();
191 }
192 if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')
193 || GETPOST('button_search_x', 'alpha') || GETPOST('button_search.x', 'alpha') || GETPOST('button_search', 'alpha')) {
194 $massaction = ''; // Protection to avoid mass action if we force a new search during a mass action confirmation
195 }
196
197 $filter = array();
198 if (!empty($search_label)) {
199 $filter['t.label'] = $search_label;
200 }
201
202 // Delete jobs
203 if ($action == 'confirm_delete' && $confirm == "yes" && $permissiontodelete) {
204 //Delete cron task
205 $object = new Cronjob($db);
206 $object->id = $id;
207 $result = $object->delete($user);
208
209 if ($result < 0) {
210 setEventMessages($object->error, $object->errors, 'errors');
211 }
212 }
213
214 // Execute jobs
215 if ($action == 'confirm_execute' && $confirm == "yes" && $permissiontoexecute) {
216 if (getDolGlobalString('CRON_KEY') && getDolGlobalString('CRON_KEY') != $securitykey) {
217 setEventMessages('Security key '.$securitykey.' is wrong', null, 'errors');
218 $action = '';
219 } else {
220 $object = new Cronjob($db);
221 $job = $object->fetch($id);
222
223 $now = dol_now(); // Date we start
224
225 $resrunjob = $object->run_jobs($user->login); // Return -1 if KO, 1 if OK
226 if ($resrunjob < 0) {
227 setEventMessages($object->error, $object->errors, 'errors');
228 }
229
230 // Plan next run
231 $res = $object->reprogram_jobs($user->login, $now);
232 if ($res > 0) {
233 if ($resrunjob >= 0) { // We show the result of reprogram only if no error message already reported
234 if ($object->lastresult >= 0) {
235 setEventMessages($langs->trans("JobFinished"), null, 'mesgs');
236 } else {
237 setEventMessages($langs->trans("JobFinished"), null, 'errors');
238 }
239 }
240 $action = '';
241 } else {
242 setEventMessages($object->error, $object->errors, 'errors');
243 $action = '';
244 }
245
246 $param = '&search_status='.urlencode($search_status);
247 if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
248 $param .= '&contextpage='.urlencode($contextpage);
249 }
250 if ($limit > 0 && $limit != $conf->liste_limit) {
251 $param .= '&limit='.((int) $limit);
252 }
253 if ($search_label) {
254 $param .= '&search_label='.urlencode($search_label);
255 }
256 if ($search_module_name) {
257 $param .= '&search_module_name='.urlencode($search_module_name);
258 }
259 if ($search_lastresult) {
260 $param .= '&search_lastresult='.urlencode($search_lastresult);
261 }
262 if ($mode) {
263 $param .= '&mode='.urlencode($mode);
264 }
265 if ($optioncss != '') {
266 $param .= '&optioncss='.urlencode($optioncss);
267 }
268 // Add $param from extra fields
269 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
270
271 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
272 exit;
273 }
274 }
275
276 // Mass actions
277 $objectclass = 'CronJob';
278 $objectlabel = 'CronJob';
279 $uploaddir = $conf->cron->dir_output;
280 include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
281 if ($massaction && $permissiontoadd) {
282 $tmpcron = new Cronjob($db);
283 foreach ($toselect as $id) {
284 $result = $tmpcron->fetch($id);
285 if ($result) {
286 $result = 0;
287 if ($massaction == 'disable') {
288 $result = $tmpcron->setStatut(Cronjob::STATUS_DISABLED);
289 } elseif ($massaction == 'enable') {
290 $result = $tmpcron->setStatut(Cronjob::STATUS_ENABLED);
291 }
292 //else dol_print_error($db, 'Bad value for massaction');
293 if ($result < 0) {
294 setEventMessages($tmpcron->error, $tmpcron->errors, 'errors');
295 }
296 } else {
297 $error++;
298 }
299 }
300 }
301}
302
303
304/*
305 * View
306 */
307
308$now = dol_now();
309
310$form = new Form($db);
311$cronjob = new Cronjob($db);
312
313$title = $langs->trans("CronList");
314
315llxHeader('', $title, '', '', 0, 0, '', '', '', 'bodyforlist');
316
317$TTestNotAllowed = array();
318$sqlTest = 'SELECT rowid, test FROM '.MAIN_DB_PREFIX.'cronjob';
319$resultTest = $db->query($sqlTest);
320if ($resultTest) {
321 while ($objTest = $db->fetch_object($resultTest)) {
322 $veriftest = verifCond($objTest->test);
323 if (!$veriftest) {
324 $TTestNotAllowed[$objTest->rowid] = $objTest->rowid;
325 }
326 }
327}
328
329// Build and execute select
330// --------------------------------------------------------------------
331$sql = "SELECT";
332$sql .= " t.rowid,";
333$sql .= " t.tms,";
334$sql .= " t.datec,";
335$sql .= " t.jobtype,";
336$sql .= " t.label,";
337$sql .= " t.command,";
338$sql .= " t.classesname,";
339$sql .= " t.objectname,";
340$sql .= " t.methodename,";
341$sql .= " t.params,";
342$sql .= " t.md5params,";
343$sql .= " t.module_name,";
344$sql .= " t.priority,";
345$sql .= " t.processing,";
346$sql .= " t.datelastrun,";
347$sql .= " t.datenextrun,";
348$sql .= " t.dateend,";
349$sql .= " t.datestart,";
350$sql .= " t.lastresult,";
351$sql .= " t.datelastresult,";
352$sql .= " t.lastoutput,";
353$sql .= " t.unitfrequency,";
354$sql .= " t.frequency,";
355$sql .= " t.status,";
356$sql .= " t.fk_user_author,";
357$sql .= " t.fk_user_mod,";
358$sql .= " t.note,";
359$sql .= " t.maxrun,";
360$sql .= " t.nbrun,";
361$sql .= " t.libname,";
362$sql .= " t.test";
363$sql .= " FROM ".MAIN_DB_PREFIX."cronjob as t";
364$sql .= " WHERE entity IN (0,".((int) $conf->entity).")";
365if (!empty($TTestNotAllowed)) {
366 $sql .= ' AND t.rowid NOT IN ('.$db->sanitize(implode(',', $TTestNotAllowed)).')';
367}
368if ($search_status >= 0 && $search_status < 2 && $search_status != '') {
369 $sql .= " AND t.status = ".(empty($search_status) ? '0' : '1');
370}
371if ($search_lastresult != '') {
372 $sql .= natural_search("t.lastresult", $search_lastresult, 1);
373}
374if (GETPOSTISSET('search_processing')) {
375 $sql .= " AND t.processing = ".((int) $search_processing);
376}
377// Manage filter
378if (count($filter) > 0) {
379 foreach ($filter as $key => $value) {
380 $sql .= " AND ".$db->sanitize($key)." LIKE '%".$db->escape($value)."%'";
381 }
382}
383if (!empty($search_module_name)) {
384 $sql .= natural_search("t.module_name", $search_module_name);
385}
386// Add where from extra fields
387include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
388// Add where from hooks
389$parameters = array();
390$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
391$sql .= $hookmanager->resPrint;
392
393
394// Count total nb of records
395$nbtotalofrecords = '';
396if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
397 $sqlforcount = $sql;
398
399 $resql = $db->query($sqlforcount);
400 if ($resql) {
401 $nbtotalofrecords = $db->num_rows($resql);
402 } else {
404 }
405
406 if (($page * $limit) > (int) $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
407 $page = 0;
408 $offset = 0;
409 }
410 $db->free($resql);
411}
412
413// Complete request and execute it with limit
414$sql .= $db->order($sortfield, $sortorder);
415if ($limit) {
416 $sql .= $db->plimit($limit + 1, $offset);
417}
418
419$resql = $db->query($sql);
420if (!$resql) {
422 exit;
423}
424
425$num = $db->num_rows($resql);
426
427$arrayofselected = is_array($toselect) ? $toselect : array();
428
429$param = '';
430if (!empty($mode)) {
431 $param .= '&mode='.urlencode($mode);
432}
433if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
434 $param .= '&contextpage='.urlencode($contextpage);
435}
436if ($limit > 0 && $limit != $conf->liste_limit) {
437 $param .= '&limit='.((int) $limit);
438}
439if ($optioncss != '') {
440 $param .= '&optioncss='.urlencode($optioncss);
441}
442if ($search_status) {
443 $param .= '&search_status='.urlencode($search_status);
444}
445if ($search_label) {
446 $param .= '&search_label='.urlencode($search_label);
447}
448if ($search_module_name) {
449 $param .= '&search_module_name='.urlencode($search_module_name);
450}
451if ($search_lastresult) {
452 $param .= '&search_lastresult='.urlencode($search_lastresult);
453}
454// Add $param from extra fields
455include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
456
457$stringcurrentdate = $langs->trans("CurrentHour").': '.dol_print_date(dol_now(), 'dayhour');
458
459if ($action == 'execute') {
460 print $form->formconfirm($_SERVER['PHP_SELF']."?id=".$id.'&securitykey='.$securitykey.$param, $langs->trans("CronExecute"), $langs->trans("CronConfirmExecute"), "confirm_execute", '', '', 1);
461}
462
463if ($action == 'delete' && empty($toselect)) { // Used when we make a delete on 1 line (not used for mass delete)
464 print $form->formconfirm($_SERVER['PHP_SELF']."?id=".$id.$param, $langs->trans("CronDelete"), $langs->trans("CronConfirmDelete"), "confirm_delete", '', '', 1);
465}
466
467// List of mass actions available
468$arrayofmassactions = array(
469//'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"),
470//'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
471 'enable' => img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("CronStatusActiveBtn"),
472 'disable' => img_picto('', 'uncheck', 'class="pictofixedwidth"').$langs->trans("CronStatusInactiveBtn"),
473);
474if ($permissiontodelete) {
475 $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
476}
477if (GETPOSTINT('nomassaction') || in_array($massaction, array('presend', 'predelete'))) {
478 $arrayofmassactions = array();
479}
480$massactionbutton = $form->selectMassAction('', $arrayofmassactions);
481
482$head = [];
483if ($mode == 'modulesetup') {
484 $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>';
485 print load_fiche_titre($langs->trans("CronSetup"), $linkback, 'title_setup');
486
487 // Configuration header
488 $head = cronadmin_prepare_head();
489}
490
491print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'" name="search_form">'."\n";
492if ($optioncss != '') {
493 print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
494}
495print '<input type="hidden" name="token" value="'.newToken().'">';
496print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
497print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
498print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
499print '<input type="hidden" name="page" value="'.$page.'">';
500print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
501print '<input type="hidden" name="page_y" value="">';
502print '<input type="hidden" name="mode" value="'.$mode.'">';
503
504// Line with explanation and button new
505$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'), '', $permissiontoadd ? 1 : 0);
506
507
508if ($mode == 'modulesetup') {
509 print dol_get_fiche_head($head, 'jobs', $langs->trans("Module2300Name"), -1, 'cron');
510
511 //print '<span class="opacitymedium">'.$langs->trans('CronInfo').'</span><br>';
512}
513
514
515print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, ($mode == 'modulesetup' ? '' : 'title_setup'), 0, $newcardbutton, '', $limit);
516
517// Add code for pre mass action (confirmation or email presend form)
518$topicmail = "SendCronRef";
519$modelmail = "cron";
520$objecttmp = new Cronjob($db);
521$trackid = 'cron'.$object->id;
522include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
523
524$text = $langs->trans("HoursOnThisPageAreOnServerTZ").' '.$stringcurrentdate.'<br>';
525if (getDolGlobalString('CRON_WARNING_DELAY_HOURS')) {
526 $text .= $langs->trans("WarningCronDelayed", getDolGlobalString('CRON_WARNING_DELAY_HOURS'));
527}
528print info_admin($text);
529//print '<br>';
530
531$moreforfilter = '';
532
533$parameters = array();
534$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
535if (empty($reshook)) {
536 $moreforfilter .= $hookmanager->resPrint;
537} else {
538 $moreforfilter = $hookmanager->resPrint;
539}
540$parameters = array(
541 'arrayfields' => &$arrayfields,
542);
543
544if (!empty($moreforfilter)) {
545 print '<div class="liste_titre liste_titre_bydiv centpercent">';
546 print $moreforfilter;
547 print '</div>';
548}
549
550$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
551$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, $conf->main_checkbox_left_column); // This also change content of $arrayfields with user setup
552$selectedfields = (($mode != 'kanban' && $mode != 'kanbangroupby') ? $htmlofselectarray : '');
553$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
554
555print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table
556print '<table class="tagtable nobottomiftotal noborder liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
557
558// Fields title search
559// --------------------------------------------------------------------
560print '<tr class="liste_titre_filter">';
561// Action column
562if ($conf->main_checkbox_left_column) {
563 print '<td class="liste_titre center maxwidthsearch">';
564 $searchpicto = $form->showFilterButtons('left');
565 print $searchpicto;
566 print '</td>';
567}
568print '<td class="liste_titre">&nbsp;</td>';
569print '<td class="liste_titre">';
570print '<input type="text" class="flat width75" name="search_label" value="'.$search_label.'">';
571print '</td>';
572print '<td class="liste_titre">&nbsp;</td>';
573print '<td class="liste_titre"><input type="text" class="width50" name="search_module_name" value="'.$search_module_name.'"></td>';
574print '<td class="liste_titre">&nbsp;</td>';
575print '<td class="liste_titre">&nbsp;</td>';
576//print '<td class="liste_titre">&nbsp;</td>';
577//print '<td class="liste_titre">&nbsp;</td>';
578print '<td class="liste_titre">&nbsp;</td>';
579print '<td class="liste_titre">&nbsp;</td>';
580print '<td class="liste_titre">&nbsp;</td>';
581print '<td class="liste_titre center"><input type="text" class="width50" name="search_lastresult" value="'.$search_lastresult.'"></td>';
582print '<td class="liste_titre">&nbsp;</td>';
583print '<td class="liste_titre">&nbsp;</td>';
584print '<td class="liste_titre center">';
585print $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');
586print '</td>';
587print '<td class="liste_titre">&nbsp;</td>';
588// Action column
589if (!$conf->main_checkbox_left_column) {
590 print '<td class="liste_titre right">';
591 $searchpicto = $form->showFilterButtons();
592 print $searchpicto;
593 print '</td>';
594}
595print '</tr>'."\n";
596
597$totalarray = array();
598$totalarray['nbfield'] = 0;
599
600// Fields title label
601// --------------------------------------------------------------------
602print '<tr class="liste_titre">';
603// Action column
604if ($conf->main_checkbox_left_column) {
605 print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", "", $param, '', $sortfield, $sortorder, 'center maxwidthsearch ');
606}
607print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "t.rowid", "", $param, '', $sortfield, $sortorder);
608print_liste_field_titre("CronLabel", $_SERVER["PHP_SELF"], "t.label", "", $param, '', $sortfield, $sortorder);
609print_liste_field_titre("Priority", $_SERVER["PHP_SELF"], "t.priority", "", $param, '', $sortfield, $sortorder);
610print_liste_field_titre("CronModule", $_SERVER["PHP_SELF"], "t.module_name", "", $param, '', $sortfield, $sortorder);
611print_liste_field_titre("", '', '', "", $param, '', $sortfield, $sortorder, 'tdoverflowmax50 ');
612print_liste_field_titre("CronFrequency", '', "", "", $param, '', $sortfield, $sortorder);
613//print_liste_field_titre("CronDtStart", $_SERVER["PHP_SELF"], "t.datestart", "", $param, 'align="center"', $sortfield, $sortorder);
614//print_liste_field_titre("CronDtEnd", $_SERVER["PHP_SELF"], "t.dateend", "", $param, 'align="center"', $sortfield, $sortorder);
615print_liste_field_titre("CronNbRun", $_SERVER["PHP_SELF"], "t.nbrun", "", $param, '', $sortfield, $sortorder, 'right tdoverflowmax50 maxwidth50imp ');
616print_liste_field_titre("CronDtLastLaunch", $_SERVER["PHP_SELF"], "t.datelastrun", "", $param, '', $sortfield, $sortorder, 'center tdoverflowmax100 ');
617print_liste_field_titre("Duration", $_SERVER["PHP_SELF"], "", "", $param, '', $sortfield, $sortorder, 'center ');
618print_liste_field_titre("CronLastResult", $_SERVER["PHP_SELF"], "t.lastresult", "", $param, '', $sortfield, $sortorder, 'center ');
619print_liste_field_titre("CronLastOutput", $_SERVER["PHP_SELF"], "t.lastoutput", "", $param, '', $sortfield, $sortorder);
620print_liste_field_titre("CronDtNextLaunch", $_SERVER["PHP_SELF"], "t.datenextrun", "", $param, '', $sortfield, $sortorder, 'center ');
621print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "t.status,t.priority", "", $param, '', $sortfield, $sortorder, 'center ');
622print_liste_field_titre("", $_SERVER["PHP_SELF"], "", "", $param, '', $sortfield, $sortorder, 'center ');
623// Action column
624if (!$conf->main_checkbox_left_column) {
625 print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", "", $param, '', $sortfield, $sortorder, 'center maxwidthsearch ');
626}
627print '</tr>'."\n";
628
629// Loop on record
630// --------------------------------------------------------------------
631$i = 0;
632$savnbfield = $totalarray['nbfield'];
633$totalarray = array();
634$totalarray['nbfield'] = 0;
635$imaxinloop = ($limit ? min($num, $limit) : $num);
636
637if ($num > 0) {
638 // Loop on each job
639
640 while ($i < $imaxinloop) {
641 $obj = $db->fetch_object($resql);
642 if (empty($obj)) {
643 break;
644 }
645
646 $reg = array();
647 if (preg_match('/:(.*)$/', $obj->label, $reg)) {
648 $langs->load($reg[1]);
649 }
650
651 $object->id = $obj->rowid;
652 $object->ref = $obj->rowid;
653 $object->label = preg_replace('/:.*$/', '', $obj->label);
654 $object->status = $obj->status;
655 $object->priority = $obj->priority;
656 $object->processing = $obj->processing;
657 $object->lastresult = (string) $obj->lastresult;
658 $object->datestart = $db->jdate($obj->datestart);
659 $object->dateend = $db->jdate($obj->dateend);
660 $object->module_name = $obj->module_name;
661 $object->params = $obj->params;
662 $object->datelastrun = $db->jdate($obj->datelastrun);
663 $object->datenextrun = $db->jdate($obj->datenextrun);
664
665 $datelastrun = $db->jdate($obj->datelastrun);
666 $datelastresult = $db->jdate($obj->datelastresult);
667 $datefromto = (empty($datelastrun) ? '' : dol_print_date($datelastrun, 'dayhoursec', 'tzserver')).' - '.(empty($datelastresult) ? '' : dol_print_date($datelastresult, 'dayhoursec', 'tzserver'));
668
669
670 print '<tr class="oddeven row-with-select">';
671
672 // Action column
673 if ($conf->main_checkbox_left_column) {
674 print '<td class="nowraponall center">';
675 if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
676 $selected = 0;
677 if (in_array($obj->rowid, $arrayofselected)) {
678 $selected = 1;
679 }
680 print '<input id="cb'.$obj->rowid.'" class="flat checkforselect valignmiddle" type="checkbox" name="toselect[]" value="'.$obj->rowid.'"'.($selected ? ' checked="checked"' : '').'>';
681 }
682 print '</td>';
683 if (!$i) {
684 $totalarray['nbfield']++;
685 }
686 }
687
688 // Ref
689 print '<td class="nowraponall">';
690 print $object->getNomUrl(1);
691 print '</td>';
692 if (!$i) {
693 $totalarray['nbfield']++;
694 }
695
696 // Label
697 print '<td class="minwidth150">';
698 if (!empty($object->label)) {
699 $object->ref = $langs->trans($object->label);
700 print '<div class="small twolinesmax lineheightsmall minwidth150 maxwidth250 classfortooltip" title="'.dol_escape_htmltag($langs->trans($object->label), 0, 0).'">';
701 print $object->getNomUrl(0, '', 1);
702 print '</div>';
703 $object->ref = $obj->rowid;
704 } else {
705 //print $langs->trans('CronNone');
706 }
707 print '</td>';
708 if (!$i) {
709 $totalarray['nbfield']++;
710 }
711
712 // Priority
713 print '<td class="right">';
714 print dol_escape_htmltag($object->priority);
715 print '</td>';
716
717 // Module
718 print '<td>';
719 print dol_escape_htmltag($object->module_name);
720 print '</td>';
721 if (!$i) {
722 $totalarray['nbfield']++;
723 }
724
725 // Class/Method
726 print '<td class="nowraponall">';
727 if ($obj->jobtype == 'method') {
728 $text = img_picto('', 'code');
729 $texttoshow = '<b>'.$langs->trans("CronType_method").'</b><br><br>';
730 $texttoshow .= $langs->trans('CronModule').': '.$obj->module_name.'<br>';
731 $texttoshow .= $langs->trans('CronClass').': '.$obj->classesname.'<br>';
732 $texttoshow .= $langs->trans('CronObject').': '.$obj->objectname.'<br>';
733 $texttoshow .= $langs->trans('CronMethod').': '.$obj->methodename;
734 $texttoshow .= '<br>'.$langs->trans('CronArgs').': '.$obj->params;
735 $texttoshow .= '<br>'.$langs->trans('Comment').': '.$langs->trans($obj->note);
736 } elseif ($obj->jobtype == 'command') {
737 $text = img_picto('', 'terminal');
738 $texttoshow = '<b>'.$langs->trans('CronType_command').'</b><br><br>';
739 $texttoshow .= $langs->trans('CronCommand').': '.dol_trunc($obj->command);
740 $texttoshow .= '<br>'.$langs->trans('CronArgs').': '.$obj->params;
741 $texttoshow .= '<br>'.$langs->trans('Comment').': '.$langs->trans($obj->note);
742 } else {
743 $texttoshow = '';
744 $texttoshow = '';
745 }
746 print '<span class="classfortooltip" title="'.dol_escape_htmltag($texttoshow, 1, 1).'">'.$text.'</a>';
747 print '</td>';
748 if (!$i) {
749 $totalarray['nbfield']++;
750 }
751
752 // Frequency
753 $s = '';
754 if ($obj->unitfrequency == "60") {
755 $s = ($obj->frequency)." ".$langs->trans('MinuteShort');
756 } elseif ($obj->unitfrequency == "3600") {
757 $s = ($obj->frequency)." ".$langs->trans('HourShort');
758 } elseif ($obj->unitfrequency == "86400") {
759 $s = ($obj->frequency)." ".($obj->frequency > 1 ? $langs->trans('DurationDays') : $langs->trans('DurationDay'));
760 } elseif ($obj->unitfrequency == "604800") {
761 $s = ($obj->frequency)." ".($obj->frequency > 1 ? $langs->trans('DurationWeeks') : $langs->trans('DurationWeek'));
762 } elseif ($obj->unitfrequency == "2678400") {
763 $s = ($obj->frequency)." ".($obj->frequency > 1 ? $langs->trans('DurationMonths') : $langs->trans('DurationMonth'));
764 }
765 print '<td class="tdoverflowmax125 center" title="'.dol_escape_htmltag($s).'">';
766 print dol_escape_htmltag($s);
767 print '</td>';
768 if (!$i) {
769 $totalarray['nbfield']++;
770 }
771
772 /*
773 print '<td class="center">';
774 if (!empty($obj->datestart)) {
775 print dol_print_date($db->jdate($obj->datestart), 'dayhour', 'tzserver');
776 }
777 print '</td>';
778 if (!$i) {
779 $totalarray['nbfield']++;
780 }
781
782 print '<td class="center">';
783 if (!empty($obj->dateend)) {
784 print dol_print_date($db->jdate($obj->dateend), 'dayhour', 'tzserver');
785 }
786 print '</td>';
787 if (!$i) {
788 $totalarray['nbfield']++;
789 }
790 */
791
792 print '<td class="right">';
793 if (!empty($obj->nbrun)) {
794 print dol_escape_htmltag($obj->nbrun);
795 } else {
796 print '0';
797 }
798 if (!empty($obj->maxrun)) {
799 print ' <span class="'.$langs->trans("Max").'">/ '.dol_escape_htmltag($obj->maxrun).'</span>';
800 }
801 print '</td>';
802 if (!$i) {
803 $totalarray['nbfield']++;
804 }
805
806 // Date start last run
807 print '<td class="center celldateheight" title="'.dol_escape_htmltag($datefromto).'">';
808 if (!empty($datelastrun)) {
809 print dolOutputDates($datelastrun, null, 0, 1, '', 'tzserver');
810 }
811 print '</td>';
812 if (!$i) {
813 $totalarray['nbfield']++;
814 }
815
816 // Duration
817 print '<td class="center nowraponall" title="'.dol_escape_htmltag($datefromto).'">';
818 if (!empty($datelastresult) && ($datelastresult >= $datelastrun)) {
819 $nbseconds = max($datelastresult - $datelastrun, 1);
820 print $nbseconds.' '.$langs->trans("SecondShort");
821 }
822 print '</td>';
823 if (!$i) {
824 $totalarray['nbfield']++;
825 }
826
827 // Return code of last run
828 print '<td class="center tdlastresultcode" title="'.dol_escape_htmltag($obj->lastresult).'">';
829 if ($obj->lastresult != '') {
830 if (empty($obj->lastresult) || $obj->status == Cronjob::STATUS_DISABLED) {
831 print $obj->lastresult; // Print '0'
832 } else {
833 print '<span class="error">'.dol_escape_htmltag(dol_trunc($obj->lastresult)).'</div>';
834 }
835 }
836 print '</td>';
837 if (!$i) {
838 $totalarray['nbfield']++;
839 }
840
841 // Output of last run
842 print '<td class="small minwidth150">';
843 if (!empty($obj->lastoutput)) {
844 print '<div class="twolinesmax lineheightsmall classfortooltip" title="'.dolPrintHTMLForAttribute($obj->lastoutput).'">';
845 print dol_trunc(dolGetFirstLineOfText($obj->lastoutput, 2), 100);
846 print '</div>';
847 }
848 print '</td>';
849 if (!$i) {
850 $totalarray['nbfield']++;
851 }
852
853 // Next run date
854 print '<td class="center celldateheight">';
855 if (!empty($obj->datenextrun)) {
856 $datenextrun = $db->jdate($obj->datenextrun);
857 if (empty($obj->status)) {
858 print '<span class="opacitymedium strikefordisabled">';
859 }
860
861 $pictotoadd = '';
862 if ($obj->status == Cronjob::STATUS_ENABLED) {
863 if ($obj->maxrun && $obj->nbrun >= $obj->maxrun) {
864 $pictotoadd .= img_warning($langs->trans("MaxRunReached"));
865 } elseif ($datenextrun && $datenextrun < $now) {
866 $pictotoadd .= img_warning($langs->trans("Late"));
867 }
868 }
869
870 print dolOutputDates($datenextrun, null, 0, 1, $pictotoadd);
871
872 if (empty($obj->status)) {
873 print '</span>';
874 }
875 }
876 print '</td>';
877 if (!$i) {
878 $totalarray['nbfield']++;
879 }
880
881 // Status
882 print '<td class="center">';
883 print $object->getLibStatut(5);
884 print '</td>';
885 if (!$i) {
886 $totalarray['nbfield']++;
887 }
888
889 // Action
890 print '<td class="nowraponall right">';
891 $backtopage = urlencode($_SERVER["PHP_SELF"].'?'.$param.'&sortfield='.$sortfield.'&sortorder='.$sortorder);
892 if ($permissiontoadd) {
893 print '<a class="editfielda" href="'.DOL_URL_ROOT."/cron/card.php?id=".$obj->rowid.'&action=edit&token='.newToken().'&sortfield='.$sortfield.'&sortorder='.$sortorder.$param;
894 print "&backtopage=".$backtopage."\" title=\"".dol_escape_htmltag($langs->trans('Edit'))."\">".img_picto($langs->trans('Edit'), 'edit')."</a> &nbsp;";
895 }
896 if ($permissiontodelete) {
897 print '<a class="reposition" href="'.$_SERVER["PHP_SELF"]."?id=".$obj->rowid.'&action=delete&token='.newToken().($page ? '&page='.$page : '').'&sortfield='.$sortfield.'&sortorder='.$sortorder.$param;
898 print '" title="'.dol_escape_htmltag($langs->trans('CronDelete')).'">'.img_picto($langs->trans('CronDelete'), 'delete', '', 0, 0, 0, '', 'marginleftonly').'</a> &nbsp; ';
899 } else {
900 print '<a href="#" title="'.dol_escape_htmltag($langs->trans('NotEnoughPermissions')).'">'.img_picto($langs->trans('NotEnoughPermissions'), 'delete', '', 0, 0, 0, '', 'marginleftonly').'</a> &nbsp; ';
901 }
902 if ($permissiontoexecute) {
903 if (!empty($obj->status)) {
904 print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$obj->rowid.'&action=execute&token='.newToken();
905 print(!getDolGlobalString('CRON_KEY') ? '' : '&securitykey=' . getDolGlobalString('CRON_KEY'));
906 print '&sortfield='.$sortfield;
907 print '&sortorder='.$sortorder;
908 print $param."\" title=\"".dol_escape_htmltag($langs->trans('CronExecute'))."\">".img_picto($langs->trans('CronExecute'), "play", '', 0, 0, 0, '', 'marginleftonly').'</a>';
909 } else {
910 print '<a href="#" class="cursordefault" title="'.dol_escape_htmltag($langs->trans('JobDisabled')).'">'.img_picto($langs->trans('JobDisabled'), "playdisabled", '', 0, 0, 0, '', 'marginleftonly').'</a>';
911 }
912 } else {
913 print '<a href="#" class="cursornotallowed" title="'.dol_escape_htmltag($langs->trans('NotEnoughPermissions')).'">'.img_picto($langs->trans('NotEnoughPermissions'), "playdisabled", '', 0, 0, 0, '', 'marginleftonly').'</a>';
914 }
915 print '</td>';
916 if (!$i) {
917 $totalarray['nbfield']++;
918 }
919
920 // Action column
921 if (!$conf->main_checkbox_left_column) {
922 print '<td class="nowraponall center">';
923 if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
924 $selected = 0;
925 if (in_array($obj->rowid, $arrayofselected)) {
926 $selected = 1;
927 }
928 print '<input id="cb'.$obj->rowid.'" class="flat checkforselect valignmiddle" type="checkbox" name="toselect[]" value="'.$obj->rowid.'"'.($selected ? ' checked="checked"' : '').'>';
929 }
930 print '</td>';
931 if (!$i) {
932 $totalarray['nbfield']++;
933 }
934 }
935
936 print '</tr>'."\n";
937
938 $i++;
939 }
940} else {
941 print '<tr><td colspan="16"><span class="opacitymedium">'.$langs->trans('CronNoJobs').'</span></td></tr>';
942}
943
944$db->free($resql);
945
946$parameters = array('arrayfields' => $arrayfields, 'sql' => $sql);
947$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
948print $hookmanager->resPrint;
949
950print '</table>'."\n";
951print '</div>'."\n";
952
953print '</form>'."\n";
954
955if ($mode == 'modulesetup') {
956 print dol_get_fiche_end();
957}
958
959
960llxFooter();
961
962$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.
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.
dolGetFirstLineOfText($text, $nboflines=1, $charset='UTF-8')
Return first line of text.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0, $morecssdiv='')
Show tabs of a record.
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.
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_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='', $morecssonpicto='widthpictotitle')
Load a title with picto.
dol_trunc($string, $size=40, $trunc='right', $stringencoding='UTF-8', $nodot=0, $display=0)
Truncate a string to a particular length adding '...' if string larger than length.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
info_admin($text, $infoonimgalt=0, $nodiv=0, $admin='1', $morecss='hideonsmartphone', $textfordropdown='', $picto='', $textonpictotooltip='', $cssfordropdown='info_admin')
Show information in HTML for admin users or standard users.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Returns text escaped for inclusion in HTML alt or title or value tags, or into values of HTML input f...
print $langs trans("Show") . '< td style="' . $timeColor . '" align="center"> s</td > badge status0 badge status4 badge status3 Error badge status8< td align="center">< span class="badge ' . $badge . '"></span ></td >< td align="center">< a href="#" class="button button-small" onclick="openLogModal(this)" data-req="' . dol_escape_htmltag($reqSafe) . '" data-res="' . dol_escape_htmltag($resSafe) . '" data-err="' . dol_escape_htmltag($errSafe) . '">< span class="fa fa-search-plus"></span ></a ></td ></tr >< tr >< td colspan="' . $colspan . '" class="opacitymedium"></td ></tr ></table ></div ></form > logModal none logModal none s a JSON string
buildzip.php
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.