dolibarr  16.0.5
target_list.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2007-2017 Laurent Destailleur <eldy@users.sourceforge.net>
3  * Copyright (C) ---Put here your own copyright and developer email---
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <https://www.gnu.org/licenses/>.
17  */
18 
25 //if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db
26 //if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user
27 //if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc
28 //if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs
29 //if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters
30 //if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters
31 //if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on).
32 //if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on)
33 //if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data
34 //if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu
35 //if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php
36 //if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library
37 //if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too.
38 //if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip
39 //if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value
40 //if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler
41 //if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message
42 //if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies
43 //if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET
44 //if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification
45 //if (! defined('NOSESSION')) define('NOSESSION', '1'); // On CLI mode, no need to use web sessions
46 
47 // Load Dolibarr environment
48 $res = 0;
49 // Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined)
50 if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) {
51  $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php";
52 }
53 // Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
54 $tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1;
55 while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) {
56  $i--; $j--;
57 }
58 if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) {
59  $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php";
60 }
61 if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) {
62  $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php";
63 }
64 // Try main.inc.php using relative path
65 if (!$res && file_exists("../main.inc.php")) {
66  $res = @include "../main.inc.php";
67 }
68 if (!$res && file_exists("../../main.inc.php")) {
69  $res = @include "../../main.inc.php";
70 }
71 if (!$res && file_exists("../../../main.inc.php")) {
72  $res = @include "../../../main.inc.php";
73 }
74 if (!$res) {
75  die("Include of main fails");
76 }
77 
78 require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
79 require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
80 require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
81 
82 // load webhook libraries
83 require_once __DIR__.'/class/target.class.php';
84 
85 // for other modules
86 //dol_include_once('/othermodule/class/otherobject.class.php');
87 
88 // Load translation files required by the page
89 $langs->loadLangs(array("webhook@webhook", "other"));
90 
91 $action = GETPOST('action', 'aZ09') ?GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ...
92 $massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists)
93 $show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ?
94 $confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation
95 $cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button
96 $toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list
97 $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'targetlist'; // To manage different context of search
98 $backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page
99 $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
100 $mode = GETPOST('mode', 'aZ');
101 
102 $id = GETPOST('id', 'int');
103 
104 // Load variable for pagination
105 $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
106 $sortfield = GETPOST('sortfield', 'aZ09comma');
107 $sortorder = GETPOST('sortorder', 'aZ09comma');
108 $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
109 if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) {
110  // If $page is not defined, or '' or -1 or if we click on clear filters
111  $page = 0;
112 }
113 $offset = $limit * $page;
114 $pageprev = $page - 1;
115 $pagenext = $page + 1;
116 
117 // Initialize technical objects
118 $object = new Target($db);
119 $extrafields = new ExtraFields($db);
120 $diroutputmassaction = $conf->webhook->dir_output.'/temp/massgeneration/'.$user->id;
121 $hookmanager->initHooks(array('targetlist')); // Note that conf->hooks_modules contains array
122 
123 // Fetch optionals attributes and labels
124 $extrafields->fetch_name_optionals_label($object->table_element);
125 //$extrafields->fetch_name_optionals_label($object->table_element_line);
126 
127 $search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
128 
129 // Default sort order (if not yet defined by previous GETPOST)
130 if (!$sortfield) {
131  reset($object->fields); // Reset is required to avoid key() to return null.
132  $sortfield = "t.".key($object->fields); // Set here default search field. By default 1st field in definition.
133 }
134 if (!$sortorder) {
135  $sortorder = "ASC";
136 }
137 
138 // Initialize array of search criterias
139 $search_all = GETPOST('search_all', 'alphanohtml');
140 $search = array();
141 foreach ($object->fields as $key => $val) {
142  if (GETPOST('search_'.$key, 'alpha') !== '') {
143  $search[$key] = GETPOST('search_'.$key, 'alpha');
144  }
145  if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) {
146  $search[$key.'_dtstart'] = dol_mktime(0, 0, 0, GETPOST('search_'.$key.'_dtstartmonth', 'int'), GETPOST('search_'.$key.'_dtstartday', 'int'), GETPOST('search_'.$key.'_dtstartyear', 'int'));
147  $search[$key.'_dtend'] = dol_mktime(23, 59, 59, GETPOST('search_'.$key.'_dtendmonth', 'int'), GETPOST('search_'.$key.'_dtendday', 'int'), GETPOST('search_'.$key.'_dtendyear', 'int'));
148  }
149 }
150 
151 // List of fields to search into when doing a "search in all"
152 $fieldstosearchall = array();
153 foreach ($object->fields as $key => $val) {
154  if (!empty($val['searchall'])) {
155  $fieldstosearchall['t.'.$key] = $val['label'];
156  }
157 }
158 
159 // Definition of array of fields for columns
160 $arrayfields = array();
161 foreach ($object->fields as $key => $val) {
162  // If $val['visible']==0, then we never show the field
163  if (!empty($val['visible'])) {
164  $visible = (int) dol_eval($val['visible'], 1);
165  $arrayfields['t.'.$key] = array(
166  'label'=>$val['label'],
167  'checked'=>(($visible < 0) ? 0 : 1),
168  'enabled'=>(abs($visible) != 3 && dol_eval($val['enabled'], 1)),
169  'position'=>$val['position'],
170  'help'=> isset($val['help']) ? $val['help'] : ''
171  );
172  }
173 }
174 // Extra fields
175 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
176 
177 $object->fields = dol_sort_array($object->fields, 'position');
178 //$arrayfields['anotherfield'] = array('type'=>'integer', 'label'=>'AnotherField', 'checked'=>1, 'enabled'=>1, 'position'=>90, 'csslist'=>'right');
179 $arrayfields = dol_sort_array($arrayfields, 'position');
180 
181 // There is several ways to check permission.
182 // Set $enablepermissioncheck to 1 to enable a minimum low level of checks
183 $enablepermissioncheck = 0;
184 if ($enablepermissioncheck) {
185  $permissiontoread = $user->rights->webhook->target->read;
186  $permissiontoadd = $user->rights->webhook->target->write;
187  $permissiontodelete = $user->rights->webhook->target->delete;
188 } else {
189  $permissiontoread = 1;
190  $permissiontoadd = 1;
191  $permissiontodelete = 1;
192 }
193 
194 // Security check (enable the most restrictive one)
195 if ($user->socid > 0) accessforbidden();
196 //if ($user->socid > 0) accessforbidden();
197 //$socid = 0; if ($user->socid > 0) $socid = $user->socid;
198 //$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
199 //restrictedArea($user, $object->element, 0, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
200 if (empty($conf->webhook->enabled)) accessforbidden('Module not enabled');
201 if (!$permissiontoread) accessforbidden();
202 
203 
204 /*
205  * Actions
206  */
207 
208 if (GETPOST('cancel', 'alpha')) {
209  $action = 'list';
210  $massaction = '';
211 }
212 if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') {
213  $massaction = '';
214 }
215 
216 $parameters = array();
217 $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
218 if ($reshook < 0) {
219  setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
220 }
221 
222 if (empty($reshook)) {
223  // Selection of new fields
224  include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
225 
226  // Purge search criteria
227  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
228  foreach ($object->fields as $key => $val) {
229  $search[$key] = '';
230  if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) {
231  $search[$key.'_dtstart'] = '';
232  $search[$key.'_dtend'] = '';
233  }
234  }
235  $toselect = array();
236  $search_array_options = array();
237  }
238  if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')
239  || GETPOST('button_search_x', 'alpha') || GETPOST('button_search.x', 'alpha') || GETPOST('button_search', 'alpha')) {
240  $massaction = ''; // Protection to avoid mass action if we force a new search during a mass action confirmation
241  }
242 
243  // Mass actions
244  $objectclass = 'Target';
245  $objectlabel = 'Target';
246  $uploaddir = $conf->webhook->dir_output;
247  include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
248 }
249 
250 
251 
252 /*
253  * View
254  */
255 
256 $form = new Form($db);
257 
258 $now = dol_now();
259 //$help_url = "EN:Module_Target|FR:Module_Target_FR|ES:Módulo_Target";
260 $help_url = '';
261 $title = $langs->trans('ListOf', $langs->transnoentitiesnoconv("Targets"));
262 $morejs = array();
263 $morecss = array();
264 
265 // Build and execute select
266 // --------------------------------------------------------------------
267 $sql = 'SELECT ';
268 $sql .= $object->getFieldList('t');
269 // Add fields from extrafields
270 if (!empty($extrafields->attributes[$object->table_element]['label'])) {
271  foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
272  $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key : '');
273  }
274 }
275 // Add fields from hooks
276 $parameters = array();
277 $reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
278 $sql .= preg_replace('/^,/', '', $hookmanager->resPrint);
279 $sql = preg_replace('/,\s*$/', '', $sql);
280 //$sql .= ", COUNT(rc.rowid) as anotherfield";
281 $sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t";
282 //$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."anothertable as rc ON rc.parent = t.rowid";
283 if (isset($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
284  $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (t.rowid = ef.fk_object)";
285 }
286 // Add table from hooks
287 $parameters = array();
288 $reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object); // Note that $action and $object may have been modified by hook
289 $sql .= $hookmanager->resPrint;
290 if ($object->ismultientitymanaged == 1) {
291  $sql .= " WHERE t.entity IN (".getEntity($object->element).")";
292 } else {
293  $sql .= " WHERE 1 = 1";
294 }
295 foreach ($search as $key => $val) {
296  if (array_key_exists($key, $object->fields)) {
297  if ($key == 'status' && $search[$key] == -1) {
298  continue;
299  }
300  $mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0);
301  if ((strpos($object->fields[$key]['type'], 'integer:') === 0) || (strpos($object->fields[$key]['type'], 'sellist:') === 0) || !empty($object->fields[$key]['arrayofkeyval'])) {
302  if ($search[$key] == '-1' || ($search[$key] === '0' && (empty($object->fields[$key]['arrayofkeyval']) || !array_key_exists('0', $object->fields[$key]['arrayofkeyval'])))) {
303  $search[$key] = '';
304  }
305  $mode_search = 2;
306  }
307  if ($search[$key] != '') {
308  $sql .= natural_search("t.".$db->escape($key), $search[$key], (($key == 'status') ? 2 : $mode_search));
309  }
310  } else {
311  if (preg_match('/(_dtstart|_dtend)$/', $key) && $search[$key] != '') {
312  $columnName = preg_replace('/(_dtstart|_dtend)$/', '', $key);
313  if (preg_match('/^(date|timestamp|datetime)/', $object->fields[$columnName]['type'])) {
314  if (preg_match('/_dtstart$/', $key)) {
315  $sql .= " AND t.".$db->escape($columnName)." >= '".$db->idate($search[$key])."'";
316  }
317  if (preg_match('/_dtend$/', $key)) {
318  $sql .= " AND t.".$db->escape($columnName)." <= '".$db->idate($search[$key])."'";
319  }
320  }
321  }
322  }
323 }
324 if ($search_all) {
325  $sql .= natural_search(array_keys($fieldstosearchall), $search_all);
326 }
327 //$sql.= dolSqlDateFilter("t.field", $search_xxxday, $search_xxxmonth, $search_xxxyear);
328 // Add where from extra fields
329 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
330 // Add where from hooks
331 $parameters = array();
332 $reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $object); // Note that $action and $object may have been modified by hook
333 $sql .= $hookmanager->resPrint;
334 
335 /* If a group by is required
336 $sql .= " GROUP BY ";
337 foreach($object->fields as $key => $val) {
338  $sql .= "t.".$db->escape($key).", ";
339 }
340 // Add fields from extrafields
341 if (!empty($extrafields->attributes[$object->table_element]['label'])) {
342  foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
343  $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.', ' : '');
344  }
345 }
346 // Add where from hooks
347 $parameters = array();
348 $reshook = $hookmanager->executeHooks('printFieldListGroupBy', $parameters, $object); // Note that $action and $object may have been modified by hook
349 $sql .= $hookmanager->resPrint;
350 $sql = preg_replace('/,\s*$/', '', $sql);
351 */
352 
353 // Add HAVING from hooks
354 /*
355 $parameters = array();
356 $reshook = $hookmanager->executeHooks('printFieldListHaving', $parameters, $object); // Note that $action and $object may have been modified by hook
357 $sql .= empty($hookmanager->resPrint) ? "" : " HAVING 1=1 ".$hookmanager->resPrint;
358 */
359 
360 // Count total nb of records
361 $nbtotalofrecords = '';
362 if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
363  /* This old and fast method to get and count full list returns all record so use a high amount of memory.
364  $resql = $db->query($sql);
365  $nbtotalofrecords = $db->num_rows($resql);
366  */
367  /* The slow method does not consume memory on mysql (not tested on pgsql) */
368  /*$resql = $db->query($sql, 0, 'auto', 1);
369  while ($db->fetch_object($resql)) {
370  if (empty($nbtotalofrecords)) {
371  $nbtotalofrecords = 1; // We can't make +1 because init value is ''
372  } else {
373  $nbtotalofrecords++;
374  }
375  }*/
376  /* The fast and low memory method to get and count full list converts the sql into a sql count */
377  $sqlforcount = preg_replace('/^SELECT[a-zA-Z0-9\._\s\(\),=<>\:\-\']+\sFROM/', 'SELECT COUNT(*) as nbtotalofrecords FROM', $sql);
378  $resql = $db->query($sqlforcount);
379  $objforcount = $db->fetch_object($resql);
380  $nbtotalofrecords = $objforcount->nbtotalofrecords;
381 
382  if (($page * $limit) > $nbtotalofrecords) { // if total of record found is smaller than page * limit, 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);
391 if ($limit) {
392  $sql .= $db->plimit($limit + 1, $offset);
393 }
394 
395 $resql = $db->query($sql);
396 if (!$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
405 if ($num == 1 && !empty($conf->global->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/target_card.php', 1).'?id='.$id);
409  exit;
410 }
411 
412 
413 // Output page
414 // --------------------------------------------------------------------
415 $title = $langs->trans("Targets");
416 llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', '');
417 
418 if ($mode == 'modulesetup') {
419  require_once 'lib/webhook.lib.php';
420 
421  $help_url = '';
422  $page_name = "WebhookSetup";
423  // Subheader
424  $linkback = '<a href="'.($backtopage ? $backtopage : DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1').'">'.$langs->trans("BackToModuleList").'</a>';
425  print load_fiche_titre($langs->trans($page_name), $linkback, 'title_setup');
426 
427  $head = webhookAdminPrepareHead();
428  print dol_get_fiche_head($head, 'targets', $langs->trans($page_name), -1, "webhook@webhook");
429 }
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 = '';
449 if (!empty($mode)) {
450  $param .= '&mode='.urlencode($mode);
451 }
452 if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
453  $param .= '&contextpage='.urlencode($contextpage);
454 }
455 if ($limit > 0 && $limit != $conf->liste_limit) {
456  $param .= '&limit='.urlencode($limit);
457 }
458 foreach ($search as $key => $val) {
459  if (is_array($search[$key]) && count($search[$key])) {
460  foreach ($search[$key] as $skey) {
461  if ($skey != '') {
462  $param .= '&search_'.$key.'[]='.urlencode($skey);
463  }
464  }
465  } elseif ($search[$key] != '') {
466  $param .= '&search_'.$key.'='.urlencode($search[$key]);
467  }
468 }
469 if ($optioncss != '') {
470  $param .= '&optioncss='.urlencode($optioncss);
471 }
472 // Add $param from extra fields
473 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
474 // Add $param from hooks
475 $parameters = array();
476 $reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object); // Note that $action and $object may have been modified by hook
477 $param .= $hookmanager->resPrint;
478 
479 // List of mass actions available
480 $arrayofmassactions = array(
481  //'validate'=>img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Validate"),
482  //'generate_doc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"),
483  //'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
484  //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"),
485 );
486 if ($permissiontodelete) {
487  $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
488 }
489 if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) {
490  $arrayofmassactions = array();
491 }
492 $massactionbutton = $form->selectMassAction('', $arrayofmassactions);
493 
494 print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n";
495 if ($optioncss != '') {
496  print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
497 }
498 print '<input type="hidden" name="token" value="'.newToken().'">';
499 print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
500 print '<input type="hidden" name="action" value="list">';
501 print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
502 print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
503 print '<input type="hidden" name="page" value="'.$page.'">';
504 print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
505 print '<input type="hidden" name="mode" value="'.$mode.'">';
506 
507 
508 $newcardbutton = '';
509 //$newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/^&mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss'=>'reposition'));
510 //$newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-list-alt imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/^&mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss'=>'reposition'));
511 //$newcardbutton .= dolGetButtonTitleSeparator();
512 $newcardbutton .= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', dol_buildpath('/webhook/target_card.php', 1).'?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']).'?mode=modulesetup', '', $permissiontoadd);
513 
514 print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, "", 0, $newcardbutton, '', $limit, 0, 0, 1);
515 
516 // Add code for pre mass action (confirmation or email presend form)
517 $topicmail = "SendTargetRef";
518 $modelmail = "target";
519 $objecttmp = new Target($db);
520 $trackid = 'xxxx'.$object->id;
521 include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
522 
523 if ($search_all) {
524  foreach ($fieldstosearchall as $key => $val) {
525  $fieldstosearchall[$key] = $langs->trans($val);
526  }
527  print '<div class="divsearchfieldfilter">'.$langs->trans("FilterOnInto", $search_all).join(', ', $fieldstosearchall).'</div>';
528 }
529 
530 $moreforfilter = '';
531 /*$moreforfilter.='<div class="divsearchfield">';
532 $moreforfilter.= $langs->trans('MyFilter') . ': <input type="text" name="search_myfield" value="'.dol_escape_htmltag($search_myfield).'">';
533 $moreforfilter.= '</div>';*/
534 
535 $parameters = array();
536 $reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook
537 if (empty($reshook)) {
538  $moreforfilter .= $hookmanager->resPrint;
539 } else {
540  $moreforfilter = $hookmanager->resPrint;
541 }
542 
543 if (!empty($moreforfilter)) {
544  print '<div class="liste_titre liste_titre_bydiv centpercent">';
545  print $moreforfilter;
546  print '</div>';
547 }
548 
549 $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
550 $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
551 $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
552 
553 print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
554 print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
555 
556 
557 // Fields title search
558 // --------------------------------------------------------------------
559 print '<tr class="liste_titre">';
560 foreach ($object->fields as $key => $val) {
561  $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']);
562  if ($key == 'status') {
563  $cssforfield .= ($cssforfield ? ' ' : '').'center';
564  } elseif (in_array($val['type'], array('date', 'datetime', 'timestamp'))) {
565  $cssforfield .= ($cssforfield ? ' ' : '').'center';
566  } elseif (in_array($val['type'], array('timestamp'))) {
567  $cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
568  } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) {
569  $cssforfield .= ($cssforfield ? ' ' : '').'right';
570  }
571  if (!empty($arrayfields['t.'.$key]['checked'])) {
572  print '<td class="liste_titre'.($cssforfield ? ' '.$cssforfield : '').'">';
573  if (!empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) {
574  print $form->selectarray('search_'.$key, $val['arrayofkeyval'], (isset($search[$key]) ? $search[$key] : ''), $val['notnull'], 0, 0, '', 1, 0, 0, '', 'maxwidth100', 1);
575  } elseif ((strpos($val['type'], 'integer:') === 0) || (strpos($val['type'], 'sellist:') === 0)) {
576  print $object->showInputField($val, $key, (isset($search[$key]) ? $search[$key] : ''), '', '', 'search_', 'maxwidth125', 1);
577  } elseif (preg_match('/^(date|timestamp|datetime)/', $val['type'])) {
578  print '<div class="nowrap">';
579  print $form->selectDate($search[$key.'_dtstart'] ? $search[$key.'_dtstart'] : '', "search_".$key."_dtstart", 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From'));
580  print '</div>';
581  print '<div class="nowrap">';
582  print $form->selectDate($search[$key.'_dtend'] ? $search[$key.'_dtend'] : '', "search_".$key."_dtend", 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to'));
583  print '</div>';
584  } elseif ($key == 'lang') {
585  require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
586  $formadmin = new FormAdmin($db);
587  print $formadmin->select_language($search[$key], 'search_lang', 0, null, 1, 0, 0, 'minwidth150 maxwidth200', 2);
588  } else {
589  print '<input type="text" class="flat maxwidth75" name="search_'.$key.'" value="'.dol_escape_htmltag(isset($search[$key]) ? $search[$key] : '').'">';
590  }
591  print '</td>';
592  }
593 }
594 // Extra fields
595 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php';
596 
597 // Fields from hook
598 $parameters = array('arrayfields'=>$arrayfields);
599 $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object); // Note that $action and $object may have been modified by hook
600 print $hookmanager->resPrint;
601 /*if (!empty($arrayfields['anotherfield']['checked'])) {
602  print '<td class="liste_titre"></td>';
603 }*/
604 // Action column
605 print '<td class="liste_titre maxwidthsearch">';
606 $searchpicto = $form->showFilterButtons();
607 print $searchpicto;
608 print '</td>';
609 print '</tr>'."\n";
610 
611 $totalarray = array();
612 $totalarray['nbfield'] = 0;
613 
614 // Fields title label
615 // --------------------------------------------------------------------
616 print '<tr class="liste_titre">';
617 foreach ($object->fields as $key => $val) {
618  $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']);
619  if ($key == 'status') {
620  $cssforfield .= ($cssforfield ? ' ' : '').'center';
621  } elseif (in_array($val['type'], array('date', 'datetime', 'timestamp'))) {
622  $cssforfield .= ($cssforfield ? ' ' : '').'center';
623  } elseif (in_array($val['type'], array('timestamp'))) {
624  $cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
625  } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) {
626  $cssforfield .= ($cssforfield ? ' ' : '').'right';
627  }
628  if (!empty($arrayfields['t.'.$key]['checked'])) {
629  print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($cssforfield ? 'class="'.$cssforfield.'"' : ''), $sortfield, $sortorder, ($cssforfield ? $cssforfield.' ' : ''))."\n";
630  $totalarray['nbfield']++;
631  }
632 }
633 // Extra fields
634 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
635 // Hook fields
636 $parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder, 'totalarray'=>&$totalarray);
637 $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook
638 print $hookmanager->resPrint;
639 /*if (!empty($arrayfields['anotherfield']['checked'])) {
640  print '<th class="liste_titre right">'.$langs->trans("AnotherField").'</th>';
641  $totalarray['nbfield']++;
642 }*/
643 // Action column
644 print getTitleFieldOfList(($mode != 'kanban' ? $selectedfields : ''), 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
645 $totalarray['nbfield']++;
646 print '</tr>'."\n";
647 
648 
649 // Detect if we need a fetch on each output line
650 $needToFetchEachLine = 0;
651 if (isset($extrafields->attributes[$object->table_element]['computed']) && is_array($extrafields->attributes[$object->table_element]['computed']) && count($extrafields->attributes[$object->table_element]['computed']) > 0) {
652  foreach ($extrafields->attributes[$object->table_element]['computed'] as $key => $val) {
653  if (preg_match('/\$object/', $val)) {
654  $needToFetchEachLine++; // There is at least one compute field that use $object
655  }
656  }
657 }
658 
659 
660 // Loop on record
661 // --------------------------------------------------------------------
662 $i = 0;
663 $savnbfield = $totalarray['nbfield'];
664 $totalarray['nbfield'] = 0;
665 $imaxinloop = ($limit ? min($num, $limit) : $num);
666 while ($i < $imaxinloop) {
667  $obj = $db->fetch_object($resql);
668  if (empty($obj)) {
669  break; // Should not happen
670  }
671 
672  // Store properties in $object
673  $object->setVarsFromFetchObj($obj);
674 
675  if ($mode == 'kanban') {
676  if ($i == 0) {
677  print '<tr><td colspan="'.$savnbfield.'">';
678  print '<div class="box-flex-container">';
679  }
680  // Output Kanban
681  print $object->getKanbanView('');
682  if ($i == ($imaxinloop - 1)) {
683  print '</div>';
684  print '</td></tr>';
685  }
686  } else {
687  // Show here line of result
688  $j = 0;
689  print '<tr data-rowid="'.$object->id.'" class="oddeven">';
690  foreach ($object->fields as $key => $val) {
691  $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']);
692  if (in_array($val['type'], array('date', 'datetime', 'timestamp'))) {
693  $cssforfield .= ($cssforfield ? ' ' : '').'center';
694  } elseif ($key == 'status') {
695  $cssforfield .= ($cssforfield ? ' ' : '').'center';
696  }
697 
698  if (in_array($val['type'], array('timestamp'))) {
699  $cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
700  } elseif ($key == 'ref') {
701  $cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
702  }
703 
704  if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('rowid', 'status')) && empty($val['arrayofkeyval'])) {
705  $cssforfield .= ($cssforfield ? ' ' : '').'right';
706  }
707  //if (in_array($key, array('fk_soc', 'fk_user', 'fk_warehouse'))) $cssforfield = 'tdoverflowmax100';
708 
709  if (!empty($arrayfields['t.'.$key]['checked'])) {
710  print '<td'.($cssforfield ? ' class="'.$cssforfield.'"' : '').'>';
711  if ($key == 'status') {
712  print $object->getLibStatut(5);
713  } elseif ($key == 'rowid') {
714  print $object->showOutputField($val, $key, $object->id, '');
715  } else {
716  print $object->showOutputField($val, $key, $object->$key, '');
717  }
718  print '</td>';
719  if (!$i) {
720  $totalarray['nbfield']++;
721  }
722  if (!empty($val['isameasure']) && $val['isameasure'] == 1) {
723  if (!$i) {
724  $totalarray['pos'][$totalarray['nbfield']] = 't.'.$key;
725  }
726  if (!isset($totalarray['val'])) {
727  $totalarray['val'] = array();
728  }
729  if (!isset($totalarray['val']['t.'.$key])) {
730  $totalarray['val']['t.'.$key] = 0;
731  }
732  $totalarray['val']['t.'.$key] += $object->$key;
733  }
734  }
735  }
736  // Extra fields
737  include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
738  // Fields from hook
739  $parameters = array('arrayfields'=>$arrayfields, 'object'=>$object, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray);
740  $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object); // Note that $action and $object may have been modified by hook
741  print $hookmanager->resPrint;
742  /*if (!empty($arrayfields['anotherfield']['checked'])) {
743  print '<td class="right">'.$obj->anotherfield.'</td>';
744  }*/
745  // Action column
746  print '<td class="nowrap center">';
747  if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
748  $selected = 0;
749  if (in_array($object->id, $arrayofselected)) {
750  $selected = 1;
751  }
752  print '<input id="cb'.$object->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.'"'.($selected ? ' checked="checked"' : '').'>';
753  }
754  print '</td>';
755  if (!$i) {
756  $totalarray['nbfield']++;
757  }
758 
759  print '</tr>'."\n";
760  }
761 
762  $i++;
763 }
764 
765 // Show total line
766 include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php';
767 
768 // If no record found
769 if ($num == 0) {
770  $colspan = 1;
771  foreach ($arrayfields as $key => $val) {
772  if (!empty($val['checked'])) {
773  $colspan++;
774  }
775  }
776  print '<tr><td colspan="'.$colspan.'"><span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span></td></tr>';
777 }
778 
779 
780 $db->free($resql);
781 
782 $parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql);
783 $reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object); // Note that $action and $object may have been modified by hook
784 print $hookmanager->resPrint;
785 
786 print '</table>'."\n";
787 print '</div>'."\n";
788 
789 print '</form>'."\n";
790 
791 if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) {
792  $hidegeneratedfilelistifempty = 1;
793  if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) {
794  $hidegeneratedfilelistifempty = 0;
795  }
796 
797  require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
798  $formfile = new FormFile($db);
799 
800  // Show list of available documents
801  $urlsource = $_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder;
802  $urlsource .= str_replace('&amp;', '&', $param);
803 
804  $filedir = $diroutputmassaction;
805  $genallowed = $permissiontoread;
806  $delallowed = $permissiontoadd;
807 
808  print $formfile->showdocuments('massfilesarea_webhook', '', $filedir, $urlsource, 0, $delallowed, '', 1, 1, 0, 48, 1, $param, $title, '', '', '', null, $hidegeneratedfilelistifempty);
809 }
810 
811 // End of page
812 llxFooter();
813 $db->close();
dol_escape_htmltag
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0)
Returns text escaped for inclusion in HTML alt or title tags, or into values of HTML input fields.
Definition: functions.lib.php:1468
llxFooter
llxFooter()
Empty footer.
Definition: wrapper.php:73
getTitleFieldOfList
getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $disablesortlink=0, $tooltip='', $forcenowrapcolumntitle=0)
Get title line of an array.
Definition: functions.lib.php:5049
load_fiche_titre
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
Definition: functions.lib.php:5204
GETPOST
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
Definition: functions.lib.php:484
dol_print_error
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
Definition: functions.lib.php:4844
dol_sort_array
dol_sort_array(&$array, $index, $order='asc', $natsort=0, $case_sensitive=0, $keepindex=0)
Advanced sort array by second index function, which produces ascending (default) or descending output...
Definition: functions.lib.php:8385
dol_buildpath
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
Definition: functions.lib.php:1062
$form
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
Definition: card.php:142
FormAdmin
Class to generate html code for admin pages.
Definition: html.formadmin.class.php:30
$help_url
if(GETPOST('button_removefilter_x', 'alpha')||GETPOST('button_removefilter.x', 'alpha')||GETPOST('button_removefilter', 'alpha')) if(GETPOST('button_search_x', 'alpha')||GETPOST('button_search.x', 'alpha')||GETPOST('button_search', 'alpha')) if($action=="save" &&empty($cancel)) $help_url
View.
Definition: agenda.php:116
img_picto
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
Definition: functions.lib.php:3880
FormFile
Class to offer components to list and upload files.
Definition: html.formfile.class.php:36
dolGetButtonTitle
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.
Definition: functions.lib.php:10605
print_barre_liste
print_barre_liste($titre, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='generic', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $hideselectlimit=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow='')
Print a title with navigation controls for pagination.
Definition: functions.lib.php:5257
dol_get_fiche_head
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='')
Show tabs of a record.
Definition: functions.lib.php:1822
webhookAdminPrepareHead
webhookAdminPrepareHead()
Prepare admin pages header.
Definition: webhook.lib.php:29
GETPOSTISSET
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
Definition: functions.lib.php:386
natural_search
natural_search($fields, $value, $mode=0, $nofirstand=0)
Generate natural SQL search string for a criteria (this criteria can be tested on one or several fiel...
Definition: functions.lib.php:9420
dol_eval
dol_eval($s, $returnvalue=0, $hideerrors=1, $onlysimplestring='1')
Replace eval function to add more security.
Definition: functions.lib.php:8611
ExtraFields
Class to manage standard extra fields.
Definition: extrafields.class.php:39
Target
Class for Target.
Definition: target.class.php:33
Form
Class to manage generation of HTML components Only common components must be here.
Definition: html.form.class.php:52
dol_now
dol_now($mode='auto')
Return date for now.
Definition: functions.lib.php:2845
$resql
if(isModEnabled('facture') &&!empty($user->rights->facture->lire)) if((isModEnabled('fournisseur') &&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->facture->lire)||(isModEnabled('supplier_invoice') && $user->rights->supplier_invoice->lire)) if(isModEnabled('don') &&!empty($user->rights->don->lire)) if(isModEnabled('tax') &&!empty($user->rights->tax->charges->lire)) if(isModEnabled('facture') &&isModEnabled('commande') && $user->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $resql
Social contributions to pay.
Definition: index.php:742
setEventMessages
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='')
Set event messages in dol_events session object.
Definition: functions.lib.php:8137
accessforbidden
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program Calling this function terminate execution ...
Definition: security.lib.php:933
dol_mktime
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm='auto', $check=1)
Return a timestamp date built from detailed informations (by default a local PHP server timestamp) Re...
Definition: functions.lib.php:2757
llxHeader
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOCSRFCHECK')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
Definition: wrapper.php:59