dolibarr 23.0.3
triggerhistory_list.php
1<?php
2/* Copyright (C) 2007-2017 Laurent Destailleur <eldy@users.sourceforge.net>
3 * Copyright (C) 2024-2025 Frédéric France <frederic.france@free.fr>
4 * Copyright (C) 2025 Alice Adminson <myemail@mycompany.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <https://www.gnu.org/licenses/>.
18 */
19
26// Load Dolibarr environment
27require '../main.inc.php';
35require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
36require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
37require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
38// load module libraries
39require_once __DIR__.'/class/triggerhistory.class.php';
40
41
42// Load translation files required by the page
43$langs->loadLangs(array("webhook@webhook", "other", "admin"));
44
45// Get parameters
46$action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'create'/'add', 'edit'/'update', 'view', ...
47$massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists)
48$show_files = GETPOSTINT('show_files'); // Show files area generated by bulk actions ?
49$confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation
50$cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button
51$toselect = GETPOST('toselect', 'array:int'); // Array of ids of elements selected into a list
52$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : str_replace('_', '', basename(dirname(__FILE__)).basename(__FILE__, '.php')); // To manage different context of search
53$backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page
54$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
55$mode = GETPOST('mode', 'aZ'); // The display mode ('list', 'kanban', 'hierarchy', 'calendar', 'gantt', ...)
56$groupby = GETPOST('groupby', 'aZ09'); // Example: $groupby = 'p.fk_opp_status' or $groupby = 'p.fk_statut'
57
58$id = GETPOSTINT('id');
59$ref = GETPOST('ref', 'alpha');
60
61// Load variable for pagination
62$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit;
63$sortfield = GETPOST('sortfield', 'aZ09comma');
64$sortorder = GETPOST('sortorder', 'aZ09comma');
65$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT('page');
66if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) {
67 // If $page is not defined, or '' or -1 or if we click on clear filters
68 $page = 0;
69}
70$offset = $limit * $page;
71$pageprev = $page - 1;
72$pagenext = $page + 1;
73
74// Initialize technical objects
75$object = new TriggerHistory($db);
76$extrafields = new ExtraFields($db);
77$diroutputmassaction = $conf->webhook->dir_output.'/temp/massgeneration/'.$user->id;
78$hookmanager->initHooks(array($contextpage)); // Note that conf->hooks_modules contains array of activated contexes
79
80// Fetch optionals attributes and labels
81$extrafields->fetch_name_optionals_label($object->table_element);
82//$extrafields->fetch_name_optionals_label($object->table_element_line);
83
84$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
85
86// Default sort order (if not yet defined by previous GETPOST)
87if (!$sortfield) {
88 reset($object->fields); // Reset is required to avoid key() to return null.
89 $sortfield = "t.".key($object->fields); // Set here default search field. By default 1st field in definition.
90}
91if (!$sortorder) {
92 $sortorder = "ASC";
93}
94
95// Initialize array of search criteria
96$search_all = trim(GETPOST('search_all', 'alphanohtml'));
97$search = array();
98foreach ($object->fields as $key => $val) {
99 if (GETPOST('search_'.$key, 'alpha') !== '') {
100 $search[$key] = GETPOST('search_'.$key, 'alpha');
101 }
102 if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) {
103 $search[$key.'_dtstart'] = dol_mktime(0, 0, 0, GETPOSTINT('search_'.$key.'_dtstartmonth'), GETPOSTINT('search_'.$key.'_dtstartday'), GETPOSTINT('search_'.$key.'_dtstartyear'));
104 $search[$key.'_dtend'] = dol_mktime(23, 59, 59, GETPOSTINT('search_'.$key.'_dtendmonth'), GETPOSTINT('search_'.$key.'_dtendday'), GETPOSTINT('search_'.$key.'_dtendyear'));
105 }
106}
107
108$fieldstosearchall = array();
109// List of fields to search into when doing a "search in all"
110// foreach ($object->fields as $key => $val) {
111// if (!empty($val['searchall'])) {
112// $fieldstosearchall['t.'.$key] = $val['label'];
113// }
114// }
115// $parameters = array('fieldstosearchall'=>$fieldstosearchall);
116// $reshook = $hookmanager->executeHooks('completeFieldsToSearchAll', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
117// if ($reshook > 0) {
118// $fieldstosearchall = empty($hookmanager->resArray['fieldstosearchall']) ? array() : $hookmanager->resArray['fieldstosearchall'];
119// } elseif ($reshook == 0) {
120// $fieldstosearchall = array_merge($fieldstosearchall, empty($hookmanager->resArray['fieldstosearchall']) ? array() : $hookmanager->resArray['fieldstosearchall']);
121// }
122
123// Definition of array of fields for columns
124$tableprefix = 't';
125$arrayfields = array();
126foreach ($object->fields as $key => $val) {
127 // If $val['visible']==0, then we never show the field
128 if (!empty($val['visible'])) {
129 $visible = (int) dol_eval((string) $val['visible'], 1);
130 $arrayfields[$tableprefix.'.'.$key] = array(
131 'label' => $val['label'],
132 'checked' => (($visible < 0) ? '0' : '1'),
133 'enabled' => (string) (int) (abs($visible) != 3 && (bool) dol_eval((string) $val['enabled'], 1)),
134 'position' => $val['position'],
135 'help' => isset($val['help']) ? $val['help'] : ''
136 );
137 }
138}
139// Extra fields
140include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
141
142$object->fields = dol_sort_array($object->fields, 'position');
143//$arrayfields['anotherfield'] = array('type'=>'integer', 'label'=>'AnotherField', 'checked'=>1, 'enabled'=>1, 'position'=>90, 'csslist'=>'right');
144$arrayfields = dol_sort_array($arrayfields, 'position');
145
146// There is several ways to check permission.
147// Set $enablepermissioncheck to 1 to enable a minimum low level of checks
148$permissiontoread = $permissiontoadd = $permissiontodelete = (!empty($user->admin) ? 1 : 0);
149
150// Security check (enable the most restrictive one)
151if ($user->socid > 0) {
153}
154//if ($user->socid > 0) accessforbidden();
155//$socid = 0; if ($user->socid > 0) $socid = $user->socid;
156//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
157//restrictedArea($user, $object->module, 0, $object->table_element, $object->element, 'fk_soc', 'rowid', $isdraft);
158if (!isModEnabled("webhook")) {
159 accessforbidden('Module webhook not enabled');
160}
161if (!$permissiontoread) {
163}
164
165
166/*
167 * Actions
168 */
169
170if (GETPOST('cancel', 'alpha')) {
171 $action = 'list';
172 $massaction = '';
173}
174if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') {
175 $massaction = '';
176}
177
178$parameters = array('arrayfields' => &$arrayfields);
179$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
180if ($reshook < 0) {
181 setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
182}
183
184if (empty($reshook)) {
185 // Selection of new fields
186 include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
187
188 // Purge search criteria
189 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
190 foreach ($object->fields as $key => $val) {
191 $search[$key] = '';
192 if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) {
193 $search[$key.'_dtstart'] = '';
194 $search[$key.'_dtend'] = '';
195 }
196 }
197 $search_all = '';
198 $toselect = array();
199 $search_array_options = array();
200 }
201 if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')
202 || GETPOST('button_search_x', 'alpha') || GETPOST('button_search.x', 'alpha') || GETPOST('button_search', 'alpha')) {
203 $massaction = ''; // Protection to avoid mass action if we force a new search during a mass action confirmation
204 }
205
206 // Mass actions
207 $objectclass = 'TriggerHistory';
208 $objectlabel = 'TriggerHistory';
209 $uploaddir = $conf->webhook->dir_output;
210
211 global $error;
212 include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
213
214 // You can add more action here
215 // if ($action == 'xxx' && $permissiontoxxx) ...
216}
217
218
219
220/*
221 * View
222 */
223
224$form = new Form($db);
225
226$now = dol_now();
227
228$title = $langs->trans("");
229//$help_url = "EN:Module_History|FR:Module_History_FR|ES:Módulo_History";
230$help_url = '';
231$morejs = array();
232$morecss = array();
233
234
235// Build and execute select
236// --------------------------------------------------------------------
237$sql = "SELECT";
238$sql .= " ".$object->getFieldList('t');
239// Add fields from extrafields
240if (!empty($extrafields->attributes[$object->table_element]['label'])) {
241 foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
242 $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key : "");
243 }
244}
245// Add fields from hooks
246$parameters = array();
247$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
248$sql .= $hookmanager->resPrint;
249$sql = preg_replace('/,\s*$/', '', $sql);
250
251$sqlfields = $sql; // $sql fields to remove for count total
252
253$sql .= " FROM ".$db->prefix().$object->table_element." as t";
254//$sql .= " LEFT JOIN ".$db->prefix()."anothertable as rc ON rc.parent = t.rowid";
255if (isset($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
256 $sql .= " LEFT JOIN ".$db->prefix().$object->table_element."_extrafields as ef on (t.rowid = ef.fk_object)";
257}
258// Add table from hooks
259$parameters = array();
260$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
261$sql .= $hookmanager->resPrint;
262if ($object->ismultientitymanaged == 1) {
263 $sql .= " WHERE t.entity IN (".getEntity($object->element, (GETPOSTINT('search_current_entity') ? 0 : 1)).")";
264} else {
265 $sql .= " WHERE 1 = 1";
266}
267foreach ($search as $key => $val) {
268 if (array_key_exists($key, $object->fields)) {
269 if ($key == 'status' && $search[$key] == -1) {
270 continue;
271 }
272 $field_spec = $object->fields[$key];
273 if ($field_spec === null) {
274 continue;
275 }
276 $mode_search = (($object->isInt($field_spec) || $object->isFloat($field_spec)) ? 1 : 0);
277 if ((strpos($field_spec['type'], 'integer:') === 0) || (strpos($field_spec['type'], 'sellist:') === 0) || !empty($field_spec['arrayofkeyval'])) {
278 if ($search[$key] == '-1' || ($search[$key] === '0' && (empty($field_spec['arrayofkeyval']) || !array_key_exists('0', $field_spec['arrayofkeyval'])))) {
279 $search[$key] = '';
280 }
281 $mode_search = 2;
282 }
283 if ($field_spec['type'] === 'boolean') {
284 $mode_search = 1;
285 if ($search[$key] == '-1') {
286 $search[$key] = '';
287 }
288 }
289 if (empty($field_spec['searchmulti'])) {
290 if (!is_array($search[$key]) && $search[$key] != '') {
291 $sql .= natural_search("t.".$db->escape($key), $search[$key], (($key == 'status') ? 2 : $mode_search));
292 }
293 } else {
294 if (is_array($search[$key]) && !empty($search[$key])) {
295 $sql .= natural_search("t.".$db->escape($key), implode(',', $search[$key]), (($key == 'status') ? 2 : $mode_search));
296 }
297 }
298 } else {
299 if (preg_match('/(_dtstart|_dtend)$/', $key) && $search[$key] != '') {
300 $columnName = preg_replace('/(_dtstart|_dtend)$/', '', $key);
301 if (preg_match('/^(date|timestamp|datetime)/', $object->fields[$columnName]['type'])) {
302 if (preg_match('/_dtstart$/', $key)) {
303 $sql .= " AND t.".$db->sanitize($columnName)." >= '".$db->idate($search[$key])."'";
304 }
305 if (preg_match('/_dtend$/', $key)) {
306 $sql .= " AND t.".$db->sanitize($columnName)." <= '".$db->idate($search[$key])."'";
307 }
308 }
309 }
310 }
311}
312if ($search_all) {
313 $sql .= natural_search(array_keys($fieldstosearchall), $search_all);
314}
315/*
316// If the internal user must only see his customers, force searching by him
317$search_sale = 0;
318if (!$user->hasRight('societe', 'client', 'voir')) {
319 $search_sale = $user->id;
320}
321// Search on sale representative
322if ($search_sale && $search_sale != '-1') {
323 if ($search_sale == -2) {
324 $sql .= " AND NOT EXISTS (SELECT sc.fk_soc FROM ".$db->prefix()."societe_commerciaux as sc WHERE sc.fk_soc = t.fk_soc)";
325 } elseif ($search_sale > 0) {
326 $sql .= " AND EXISTS (SELECT sc.fk_soc FROM ".$db->prefix()."societe_commerciaux as sc WHERE sc.fk_soc = t.fk_soc AND sc.fk_user = ".((int) $search_sale).")";
327 }
328}
329// Search on socid
330if ($socid) {
331 $sql .= " AND t.fk_soc = ".((int) $socid);
332}
333*/
334//$sql.= dolSqlDateFilter("t.field", $search_xxxday, $search_xxxmonth, $search_xxxyear);
335// Add where from extra fields
336include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
337// Add where from hooks
338$parameters = array();
339$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
340$sql .= $hookmanager->resPrint;
341
342/* If a group by is required
343$sql .= " GROUP BY ";
344foreach($object->fields as $key => $val) {
345 $sql .= "t.".$db->sanitize($key).", ";
346}
347// Add fields from extrafields
348if (!empty($extrafields->attributes[$object->table_element]['label'])) {
349 foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
350 $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.', ' : '');
351 }
352}
353// Add groupby from hooks
354$parameters = array();
355$reshook = $hookmanager->executeHooks('printFieldListGroupBy', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
356$sql .= $hookmanager->resPrint;
357$sql = preg_replace('/,\s*$/', '', $sql);
358*/
359
360// Add HAVING from hooks
361/*
362$parameters = array();
363$reshook = $hookmanager->executeHooks('printFieldListHaving', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
364$sql .= empty($hookmanager->resPrint) ? "" : " HAVING 1=1 ".$hookmanager->resPrint;
365*/
366
367// Count total nb of records
368$nbtotalofrecords = '';
369if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
370 /* The fast and low memory method to get and count full list converts the sql into a sql count */
371 $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql);
372 $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount);
373
374 $resql = $db->query($sqlforcount);
375 if ($resql) {
376 $objforcount = $db->fetch_object($resql);
377 $nbtotalofrecords = $objforcount->nbtotalofrecords;
378 } else {
379 dol_print_error($db);
380 }
381
382 if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller than the paging size (filtering), goto and load page 0
383 $page = 0;
384 $offset = 0;
385 }
386 $db->free($resql);
387}
388
389// Complete request and execute it with limit
390$sql .= $db->order($sortfield, $sortorder);
391if ($limit) {
392 $sql .= $db->plimit($limit + 1, $offset);
393}
394
395$resql = $db->query($sql);
396if (!$resql) {
397 dol_print_error($db);
398 exit;
399}
400
401$num = $db->num_rows($resql);
402
403
404// Direct jump if only one record found
405if ($num == 1 && getDolGlobalInt('MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) {
406 $obj = $db->fetch_object($resql);
407 $id = $obj->rowid;
408 header("Location: ".dol_buildpath('/webhook/history_card.php', 1).'?id='.((int) $id));
409 exit;
410}
411
412
413// Output page
414// --------------------------------------------------------------------
415
416llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'mod-webhook page-list bodyforlist'); // Can use also classforhorizontalscrolloftabs instead of bodyforlist for a horizontal scroll in the table instead of page
417
418if ($mode == 'modulesetup') {
419 require_once DOL_DOCUMENT_ROOT.'/webhook/lib/webhook.lib.php';
420
421
422 $help_url = '';
423 $page_name = "WebhookSetup";
424 // Subheader
425 $linkback = '<a href="'.($backtopage ? $backtopage : DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1').'">'.$langs->trans("BackToModuleList").'</a>';
426 print load_fiche_titre($langs->trans($page_name), $linkback, 'title_setup');
427
428 $head = webhookAdminPrepareHead();
429 print dol_get_fiche_head($head, 'triggerhistory', $langs->trans($page_name), -1, "webhook");
430}
431// Example : Adding jquery code
432// print '<script type="text/javascript">
433// jQuery(document).ready(function() {
434// function init_myfunc()
435// {
436// jQuery("#myid").removeAttr(\'disabled\');
437// jQuery("#myid").attr(\'disabled\',\'disabled\');
438// }
439// init_myfunc();
440// jQuery("#mybutton").click(function() {
441// init_myfunc();
442// });
443// });
444// </script>';
445
446$arrayofselected = is_array($toselect) ? $toselect : array();
447
448$param = '';
449if (!empty($mode)) {
450 $param .= '&mode='.urlencode($mode);
451}
452if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
453 $param .= '&contextpage='.urlencode($contextpage);
454}
455if ($limit > 0 && $limit != $conf->liste_limit) {
456 $param .= '&limit='.((int) $limit);
457}
458if ($optioncss != '') {
459 $param .= '&optioncss='.urlencode($optioncss);
460}
461if ($groupby != '') {
462 $param .= '&groupby='.urlencode($groupby);
463}
464foreach ($search as $key => $val) {
465 if (is_array($search[$key])) {
466 foreach ($search[$key] as $skey) {
467 if ($skey != '') {
468 $param .= '&search_'.$key.'[]='.urlencode($skey);
469 }
470 }
471 } elseif (preg_match('/(_dtstart|_dtend)$/', $key) && !empty($val)) {
472 $param .= '&search_'.$key.'month='.GETPOSTINT('search_'.$key.'month');
473 $param .= '&search_'.$key.'day='.GETPOSTINT('search_'.$key.'day');
474 $param .= '&search_'.$key.'year='.GETPOSTINT('search_'.$key.'year');
475 } elseif ($search[$key] != '') {
476 $param .= '&search_'.$key.'='.urlencode($search[$key]);
477 }
478}
479// Add $param from extra fields
480include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
481// Add $param from hooks
482$parameters = array('param' => &$param);
483$reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
484$param .= $hookmanager->resPrint;
485
486// List of mass actions available
487$arrayofmassactions = array(
488 //'validate'=>img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Validate"),
489 //'generate_doc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"),
490 //'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
491 //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"),
492);
493if (!empty($permissiontodelete)) {
494 $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
495}
496if (GETPOSTINT('nomassaction') || in_array($massaction, array('presend', 'predelete'))) {
497 $arrayofmassactions = array();
498}
499$massactionbutton = $form->selectMassAction('', $arrayofmassactions);
500
501print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n";
502if ($optioncss != '') {
503 print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
504}
505print '<input type="hidden" name="token" value="'.newToken().'">';
506print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
507print '<input type="hidden" name="action" value="list">';
508print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
509print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
510print '<input type="hidden" name="page" value="'.$page.'">';
511print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
512print '<input type="hidden" name="page_y" value="">';
513print '<input type="hidden" name="mode" value="'.$mode.'">';
514
515
516$newcardbutton = '';
517$newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*(mode|groupby)=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss' => 'reposition'));
518$newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*(mode|groupby)=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss' => 'reposition'));
519//$newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanbanGroupBy'), '', 'fa fa-grip-vertical imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanbangroupby&groupby=p.fk_opp_status'.preg_replace('/(&|\?)*(mode|groupby)=[^&]+/', '', $param), '', ($mode == 'kanbangroupby' ? 2 : 1), array('morecss' => 'reposition'));
520//$newcardbutton .= dolGetButtonTitle($langs->trans('HierarchicView'), '', 'fa fa-stream paddingleft imgforviewmode', $_SERVER["PHP_SELF"].'?mode=hierarchy'.preg_replace('/(&|\?)*(mode|groupby)=[^&]+/', '', $param), '', (($mode == 'hierarchy') ? 2 : 1), array('morecss' => 'reposition'));
521//$newcardbutton .= dolGetButtonTitleSeparator();
522//$newcardbutton .= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', dol_buildpath('/webhook/history_card.php', 1).'?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $permissiontoadd);
523
524print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, $object->picto, 0, $newcardbutton, '', $limit, 0, 0, 1);
525
526// Add code for pre mass action (confirmation or email presend form)
527$topicmail = "SendHistoryRef";
528$modelmail = "triggerhistory";
529$objecttmp = new TriggerHistory($db);
530$trackid = 'xxxx'.$object->id;
531include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
532
533if ($search_all) {
534 $setupstring = '';
535 // @phan-suppress-next-line PhanEmptyForeach
536 foreach ($fieldstosearchall as $key => $val) {
537 $fieldstosearchall[$key] = $langs->trans($val);
538 $setupstring .= $key."=".$val.";";
539 }
540 print '<!-- Search done like if MYOBJECT_QUICKSEARCH_ON_FIELDS = '.$setupstring.' -->'."\n";
541 print '<div class="divsearchfieldfilter">'.$langs->trans("FilterOnInto", $search_all).implode(', ', $fieldstosearchall).'</div>'."\n";
542}
543
544$moreforfilter = '';
545/*$moreforfilter.='<div class="divsearchfield">';
546$moreforfilter.= $langs->trans('MyFilter') . ': <input type="text" name="search_myfield" value="'.dol_escape_htmltag($search_myfield).'">';
547$moreforfilter.= '</div>';*/
548
549$parameters = array();
550$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
551if (empty($reshook)) {
552 $moreforfilter .= $hookmanager->resPrint;
553} else {
554 $moreforfilter = $hookmanager->resPrint;
555}
556$parameters = array(
557 'arrayfields' => &$arrayfields,
558);
559
560if (!empty($moreforfilter)) {
561 print '<div class="liste_titre liste_titre_bydiv centpercent">';
562 print $moreforfilter;
563 print '</div>';
564}
565
566$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
567$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, $conf->main_checkbox_left_column); // This also change content of $arrayfields with user setup
568$selectedfields = (($mode != 'kanban' && $mode != 'kanbangroupby') ? $htmlofselectarray : '');
569$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
570
571print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table
572print '<table class="tagtable nobottomiftotal noborder liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
573
574// Fields title search
575// --------------------------------------------------------------------
576print '<tr class="liste_titre_filter">';
577// Action column
578if ($conf->main_checkbox_left_column) {
579 print '<td class="liste_titre center maxwidthsearch">';
580 $searchpicto = $form->showFilterButtons('left');
581 print $searchpicto;
582 print '</td>';
583}
584foreach ($object->fields as $key => $val) {
585 //$searchkey = empty($search[$key]) ? '' : $search[$key];
586 $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']);
587 if ($key == 'status') {
588 $cssforfield .= ($cssforfield ? ' ' : '').'center';
589 } elseif (in_array($val['type'], array('date', 'datetime', 'timestamp'))) {
590 $cssforfield .= ($cssforfield ? ' ' : '').'center';
591 } elseif (in_array($val['type'], array('timestamp'))) {
592 $cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
593 } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('id', 'rowid', 'ref', 'status')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) {
594 $cssforfield .= ($cssforfield ? ' ' : '').'right';
595 }
596 if (!empty($arrayfields['t.'.$key]['checked'])) {
597 print '<td class="liste_titre'.($cssforfield ? ' '.$cssforfield : '').($key == 'status' ? ' parentonrightofpage' : '').'">';
598 if (!empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) {
599 if (empty($val['searchmulti'])) {
600 print $form->selectarray('search_'.$key, $val['arrayofkeyval'], (isset($search[$key]) ? $search[$key] : ''), 1, 0, 0, '', 1, 0, 0, '', 'maxwidth100'.($key == 'status' ? ' search_status width100 onrightofpage' : ''), 1);
601 } else {
602 print $form->multiselectarray('search_'.$key, $val['arrayofkeyval'], (isset($search[$key]) ? $search[$key] : ''), 0, 0, 'maxwidth100'.($key == 'status' ? ' search_status width100 onrightofpage' : ''), 1);
603 }
604 } elseif ((strpos($val['type'], 'integer:') === 0) || (strpos($val['type'], 'sellist:') === 0)) {
605 print $object->showInputField($val, $key, (isset($search[$key]) ? $search[$key] : ''), '', '', 'search_', $cssforfield.' maxwidth250', 1);
606 } elseif (preg_match('/^(date|timestamp|datetime)/', $val['type'])) {
607 print '<div class="nowrap">';
608 print $form->selectDate($search[$key.'_dtstart'] ? $search[$key.'_dtstart'] : '', "search_".$key."_dtstart", 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From'));
609 print '</div>';
610 print '<div class="nowrap">';
611 print $form->selectDate($search[$key.'_dtend'] ? $search[$key.'_dtend'] : '', "search_".$key."_dtend", 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to'));
612 print '</div>';
613 } elseif ($key == 'lang') {
614 require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
615 $formadmin = new FormAdmin($db);
616 print $formadmin->select_language((isset($search[$key]) ? $search[$key] : ''), 'search_lang', 0, array(), 1, 0, 0, 'minwidth100imp maxwidth125', 2);
617 } elseif ($val['type'] === 'boolean') {
618 print $form->selectyesno('search_' . $key, $search[$key] ?? '', 1, false, 1);
619 } else {
620 print '<input type="text" class="flat maxwidth'.(in_array($val['type'], array('integer', 'price')) ? '50' : '75').'" name="search_'.$key.'" value="'.dol_escape_htmltag(isset($search[$key]) ? $search[$key] : '').'">';
621 }
622 print '</td>';
623 }
624}
625// Extra fields
626include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php';
627
628// Fields from hook
629$parameters = array('arrayfields' => $arrayfields);
630$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
631print $hookmanager->resPrint;
632/*if (!empty($arrayfields['anotherfield']['checked'])) {
633 print '<td class="liste_titre"></td>';
634}*/
635// Action column
636if (!$conf->main_checkbox_left_column) {
637 print '<td class="liste_titre center maxwidthsearch">';
638 $searchpicto = $form->showFilterButtons();
639 print $searchpicto;
640 print '</td>';
641}
642print '</tr>'."\n";
643
644$totalarray = array();
645$totalarray['nbfield'] = 0;
646
647// Fields title label
648// --------------------------------------------------------------------
649print '<tr class="liste_titre">';
650// Action column
651if ($conf->main_checkbox_left_column) {
652 print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
653 $totalarray['nbfield']++;
654}
655foreach ($object->fields as $key => $val) {
656 $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']);
657 if ($key == 'status') {
658 $cssforfield .= ($cssforfield ? ' ' : '').'center';
659 } elseif (in_array($val['type'], array('date', 'datetime', 'timestamp'))) {
660 $cssforfield .= ($cssforfield ? ' ' : '').'center';
661 } elseif (in_array($val['type'], array('timestamp'))) {
662 $cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
663 } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('id', 'rowid', 'ref', 'status')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) {
664 $cssforfield .= ($cssforfield ? ' ' : '').'right';
665 }
666 $cssforfield = preg_replace('/small\s*/', '', $cssforfield); // the 'small' css must not be used for the title label
667 if (!empty($arrayfields['t.'.$key]['checked'])) {
668 print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($cssforfield ? 'class="'.$cssforfield.'"' : ''), $sortfield, $sortorder, ($cssforfield ? $cssforfield.' ' : ''), 0, (empty($val['helplist']) ? '' : $val['helplist']))."\n";
669 $totalarray['nbfield']++;
670 }
671}
672// Extra fields
673include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
674// Hook fields
675$parameters = array('arrayfields' => $arrayfields, 'param' => $param, 'sortfield' => $sortfield, 'sortorder' => $sortorder, 'totalarray' => &$totalarray);
676$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
677print $hookmanager->resPrint;
678/*if (!empty($arrayfields['anotherfield']['checked'])) {
679 print '<th class="liste_titre">'.$langs->trans("AnotherField").'</th>';
680 $totalarray['nbfield']++;
681}*/
682// Action column
683if (!$conf->main_checkbox_left_column) {
684 print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
685 $totalarray['nbfield']++;
686}
687print '</tr>'."\n";
688
689// Detect if we need a fetch on each output line
690$needToFetchEachLine = 0;
691if (isset($extrafields->attributes[$object->table_element]['computed']) && is_array($extrafields->attributes[$object->table_element]['computed']) && count($extrafields->attributes[$object->table_element]['computed']) > 0) {
692 foreach ($extrafields->attributes[$object->table_element]['computed'] as $key => $val) {
693 if (!is_null($val) && preg_match('/\$object/', $val)) {
694 $needToFetchEachLine++; // There is at least one compute field that use $object
695 }
696 }
697}
698
699
700// Loop on record
701// --------------------------------------------------------------------
702$i = 0;
703$savnbfield = $totalarray['nbfield'];
704$totalarray = array();
705$totalarray['nbfield'] = 0;
706$imaxinloop = ($limit ? min($num, $limit) : $num);
707while ($i < $imaxinloop) {
708 $obj = $db->fetch_object($resql);
709 if (empty($obj)) {
710 break; // Should not happen
711 }
712
713 // Store properties in $object
714 $object->setVarsFromFetchObj($obj);
715
716 /*
717 $object->thirdparty = null;
718 if ($obj->fk_soc > 0) {
719 if (!empty($conf->cache['thirdparty'][$obj->fk_soc])) {
720 $companyobj = $conf->cache['thirdparty'][$obj->fk_soc];
721 } else {
722 $companyobj = new Societe($db);
723 $companyobj->fetch($obj->fk_soc);
724 $conf->cache['thirdparty'][$obj->fk_soc] = $companyobj;
725 }
726
727 $object->thirdparty = $companyobj;
728 }*/
729
730 if ($mode == 'kanban' || $mode == 'kanbangroupby') {
731 if ($i == 0) {
732 print '<tr class="trkanban"><td colspan="'.$savnbfield.'">';
733 print '<div class="box-flex-container kanban">';
734 }
735 // Output Kanban
736 $selected = -1;
737 if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
738 $selected = 0;
739 if (in_array($object->id, $arrayofselected)) {
740 $selected = 1;
741 }
742 }
743 //print $object->getKanbanView('', array('thirdparty'=>$object->thirdparty, 'selected' => $selected));
744 print $object->getKanbanView('', array('selected' => $selected));
745 if ($i == ($imaxinloop - 1)) {
746 print '</div>';
747 print '</td></tr>';
748 }
749 } else {
750 // Show line of result
751 $j = 0;
752 print '<tr data-rowid="'.$object->id.'" class="oddeven">';
753
754 // Action column
755 if ($conf->main_checkbox_left_column) {
756 print '<td class="nowrap center">';
757 if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
758 $selected = 0;
759 if (in_array($object->id, $arrayofselected)) {
760 $selected = 1;
761 }
762 print '<input id="cb'.$object->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.'"'.($selected ? ' checked="checked"' : '').'>';
763 }
764 print '</td>';
765 if (!$i) {
766 $totalarray['nbfield']++;
767 }
768 }
769 // Fields
770 foreach ($object->fields as $key => $val) {
771 $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']);
772 if (in_array($val['type'], array('date', 'datetime', 'timestamp'))) {
773 $cssforfield .= ($cssforfield ? ' ' : '').'center';
774 } elseif ($key == 'status') {
775 $cssforfield .= ($cssforfield ? ' ' : '').'center';
776 }
777
778 if (in_array($val['type'], array('timestamp'))) {
779 $cssforfield .= ($cssforfield ? ' ' : '').'nowraponall';
780 } elseif ($key == 'ref') {
781 $cssforfield .= ($cssforfield ? ' ' : '').'nowraponall';
782 }
783
784 if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('id', 'rowid', 'ref', 'status')) && empty($val['arrayofkeyval'])) {
785 $cssforfield .= ($cssforfield ? ' ' : '').'right';
786 }
787 //if (in_array($key, array('fk_soc', 'fk_user', 'fk_warehouse'))) $cssforfield = 'tdoverflowmax100';
788
789 if (!empty($arrayfields['t.'.$key]['checked'])) {
790 print '<td'.($cssforfield ? ' class="'.$cssforfield.((preg_match('/tdoverflow/', $cssforfield) && !in_array($val['type'], array('ip', 'url')) && !is_numeric($object->$key)) ? ' classfortooltip' : '').'"' : '');
791 if (preg_match('/tdoverflow/', $cssforfield) && !in_array($val['type'], array('ip', 'url')) && !is_numeric($object->$key) && !in_array($key, array('ref'))) {
792 print ' title="'.dol_escape_htmltag((string) $object->$key).'"';
793 }
794 print '>';
795 if ($key == 'status') {
796 print $object->getLibStatut(5);
797 } elseif ($key == 'rowid') {
798 print $object->showOutputField($val, $key, (string) $object->id, '');
799 } else {
800 print $object->showOutputField($val, $key, (string) $object->$key, '');
801 }
802 print '</td>';
803 if (!$i) {
804 $totalarray['nbfield']++;
805 }
806 if (!empty($val['isameasure']) && $val['isameasure'] == 1) {
807 if (!$i) {
808 $totalarray['pos'][$totalarray['nbfield']] = 't.'.$key;
809 }
810 if (!isset($totalarray['val'])) {
811 $totalarray['val'] = array();
812 }
813 if (!isset($totalarray['val']['t.'.$key])) {
814 $totalarray['val']['t.'.$key] = 0;
815 }
816 $totalarray['val']['t.'.$key] += $object->$key;
817 }
818 }
819 }
820 // Extra fields
821 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
822 // Fields from hook
823 $parameters = array('arrayfields' => $arrayfields, 'object' => $object, 'obj' => $obj, 'i' => $i, 'totalarray' => &$totalarray);
824 $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
825 print $hookmanager->resPrint;
826
827 /*if (!empty($arrayfields['anotherfield']['checked'])) {
828 print '<td class="right">'.$obj->anotherfield.'</td>';
829 }*/
830
831 // Action column
832 if (empty($conf->main_checkbox_left_column)) {
833 print '<td class="nowrap center">';
834 if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
835 $selected = 0;
836 if (in_array($object->id, $arrayofselected)) {
837 $selected = 1;
838 }
839 print '<input id="cb'.$object->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.'"'.($selected ? ' checked="checked"' : '').'>';
840 }
841 print '</td>';
842 if (!$i) {
843 $totalarray['nbfield']++;
844 }
845 }
846
847 print '</tr>'."\n";
848 }
849
850 $i++;
851}
852
853// Show total line
854include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php';
855
856// If no record found
857if ($num == 0) {
858 $colspan = 1;
859 foreach ($arrayfields as $key => $val) {
860 if (!empty($val['checked'])) {
861 $colspan++;
862 }
863 }
864 print '<tr><td colspan="'.$colspan.'"><span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span></td></tr>';
865}
866
867
868$db->free($resql);
869
870$parameters = array('arrayfields' => $arrayfields, 'sql' => $sql);
871$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
872print $hookmanager->resPrint;
873
874print '</table>'."\n";
875print '</div>'."\n";
876
877print '</form>'."\n";
878
879if (in_array('builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords === '' || $nbtotalofrecords)) {
880 $hidegeneratedfilelistifempty = 1;
881 if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) {
882 $hidegeneratedfilelistifempty = 0;
883 }
884
885 require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
886 $formfile = new FormFile($db);
887
888 // Show list of available documents
889 $urlsource = $_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder;
890 $urlsource .= str_replace('&amp;', '&', $param);
891
892 $filedir = $diroutputmassaction;
893 $genallowed = $permissiontoread;
894 $delallowed = $permissiontoadd;
895
896 print $formfile->showdocuments('massfilesarea_'.$object->module, '', $filedir, $urlsource, 0, $delallowed, '', 1, 1, 0, 48, 1, $param, $title, '', '', '', null, $hidegeneratedfilelistifempty);
897}
898
899// End of page
900llxFooter();
901$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 export.php:1216
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
Class to manage standard extra fields.
Class to generate html code for admin pages.
Class to offer components to list and upload files.
Class to manage generation of HTML components Only common components must be here.
dol_now($mode='gmt')
Return date for now.
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm='auto', $check=1)
Return a timestamp date built from detailed information (by default a local PHP server timestamp) Rep...
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
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)
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
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.
dol_eval($s, $returnvalue=1, $hideerrors=1, $onlysimplestring='1')
Replace eval function to add more security.
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...
getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $disablesortlink=0, $tooltip='', $forcenowrapcolumntitle=0)
Get 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.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
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.
isModEnabled($module)
Is Dolibarr module enabled.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Returns text escaped for inclusion in HTML alt or title or value tags, or into values of HTML input f...
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.
webhookAdminPrepareHead()
Prepare admin pages header.