dolibarr 20.0.2
list.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2016 Marcos García <marcosgdf@gmail.com>
3 * Copyright (C) 2022 Open-Dsi <support@open-dsi.fr>
4 * Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
5 * Copyright (C) 2024 Benjamin Falière <benjamin.faliere@altairis.fr>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <https://www.gnu.org/licenses/>.
19 */
20
27// Load Dolibarr environment
28require '../main.inc.php';
29require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
30require_once DOL_DOCUMENT_ROOT.'/variants/class/ProductAttribute.class.php';
31
32// Load translation files required by the page
33$langs->loadLangs(array("products", "other"));
34
35$action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'create'/'add', 'edit'/'update', 'view', ...
36$massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists)
37$show_files = GETPOSTINT('show_files'); // Show files area generated by bulk actions
38$confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation
39$cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button
40$toselect = GETPOST('toselect', 'array:int'); // Array of ids of elements selected into a list
41$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : str_replace('_', '', basename(dirname(__FILE__)).basename(__FILE__, '.php')); // To manage different context of search
42$backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page
43$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
44$mode = GETPOST('mode', 'aZ'); // The display mode ('list', 'kanban', 'hierarchy', 'calendar', 'gantt', ...)
45
46$id = GETPOSTINT('id');
47
48// Load variable for pagination
49$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit;
50$sortfield = GETPOST('sortfield', 'aZ09comma');
51$sortorder = GETPOST('sortorder', 'aZ09comma');
52$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT('page');
53if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) {
54 // If $page is not defined, or '' or -1 or if we click on clear filters
55 $page = 0;
56}
57$offset = $limit * $page;
58$pageprev = $page - 1;
59$pagenext = $page + 1;
60
61// Initialize technical objects
62$object = new ProductAttribute($db);
63//$extrafields = new ExtraFields($db);
64$diroutputmassaction = $conf->variants->dir_output.'/temp/massgeneration/'.$user->id;
65$hookmanager->initHooks(array('productattributelist')); // Note that conf->hooks_modules contains array
66
67// Fetch optionals attributes and labels
68//$extrafields->fetch_name_optionals_label($object->table_element);
69
70//$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
71
72// Default sort order (if not yet defined by previous GETPOST)
73if (!$sortfield) {
74 $sortfield = "t.position"; // Set here default search field. By default 1st field in definition.
75}
76if (!$sortorder) {
77 $sortorder = "ASC";
78}
79
80// Initialize array of search criteria
81$search_all = trim(GETPOST('search_all', 'alphanohtml'));
82$search = array();
83foreach ($object->fields as $key => $val) {
84 if (GETPOST('search_'.$key, 'alpha') !== '') {
85 $search[$key] = GETPOST('search_'.$key, 'alpha');
86 }
87 if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) {
88 $search[$key.'_dtstart'] = dol_mktime(0, 0, 0, GETPOSTINT('search_'.$key.'_dtstartmonth'), GETPOSTINT('search_'.$key.'_dtstartday'), GETPOSTINT('search_'.$key.'_dtstartyear'));
89 $search[$key.'_dtend'] = dol_mktime(23, 59, 59, GETPOSTINT('search_'.$key.'_dtendmonth'), GETPOSTINT('search_'.$key.'_dtendday'), GETPOSTINT('search_'.$key.'_dtendyear'));
90 }
91}
92$search['nb_of_values'] = GETPOST('search_nb_of_values', 'alpha');
93$search['nb_products'] = GETPOST('search_nb_products', 'alpha');
94
95$fieldstosearchall = array();
96// List of fields to search into when doing a "search in all"
97foreach ($object->fields as $key => $val) {
98 if (!empty($val['searchall'])) {
99 $fieldstosearchall['t.'.$key] = $val['label'];
100 }
101}
102$parameters = array('fieldstosearchall' => $fieldstosearchall);
103$reshook = $hookmanager->executeHooks('completeFieldsToSearchAll', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
104if ($reshook > 0) {
105 $fieldstosearchall = empty($hookmanager->resArray['fieldstosearchall']) ? array() : $hookmanager->resArray['fieldstosearchall'];
106} elseif ($reshook == 0) {
107 $fieldstosearchall = array_merge($fieldstosearchall, empty($hookmanager->resArray['fieldstosearchall']) ? array() : $hookmanager->resArray['fieldstosearchall']);
108}
109
110// Definition of array of fields for columns
111$arrayfields = array();
112foreach ($object->fields as $key => $val) {
113 // If $val['visible']==0, then we never show the field
114 if (!empty($val['visible'])) {
115 $visible = (int) dol_eval($val['visible'], 1);
116 $arrayfields['t.'.$key] = array(
117 'label' => $val['label'],
118 'checked' => (($visible < 0) ? 0 : 1),
119 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)),
120 'position' => $val['position'],
121 'help' => isset($val['help']) ? $val['help'] : ''
122 );
123 }
124}
125$arrayfields['nb_of_values'] = array(
126 'label' => $langs->trans('NbOfDifferentValues'),
127 'checked' => 1,
128 'enabled' => 1,
129 'position' => 40,
130 'help' => ''
131);
132$arrayfields['nb_products'] = array(
133 'label' => $langs->trans('NbProducts'),
134 'checked' => 1,
135 'enabled' => 1,
136 'position' => 50,
137 'help' => ''
138);
139// Extra fields
140//include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
141
142$object->fields = dol_sort_array($object->fields, 'position');
143$arrayfields = dol_sort_array($arrayfields, 'position');
144'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan
145
146$permissiontoread = $user->hasRight('variants', 'read');
147$permissiontoadd = $user->hasRight('variants', 'write');
148$permissiontodelete = $user->hasRight('variants', 'delete');
149
150// Security check
151if (!isModEnabled('variants')) {
152 accessforbidden('Module not enabled');
153}
154$socid = 0;
155if ($user->socid > 0) { // Protection if external user
156 //$socid = $user->socid;
158}
159if (!$permissiontoread) {
161}
162
163
164/*
165 * Actions
166 */
167
168if (GETPOST('cancel', 'alpha')) {
169 $action = 'list';
170 $massaction = '';
171}
172if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') {
173 $massaction = '';
174}
175
176$parameters = array('arrayfields' => &$arrayfields);
177$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
178if ($reshook < 0) {
179 setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
180}
181
182if (empty($reshook)) {
183 // Selection of new fields
184 include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
185
186 // Purge search criteria
187 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
188 foreach ($object->fields as $key => $val) {
189 $search[$key] = '';
190 if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) {
191 $search[$key.'_dtstart'] = '';
192 $search[$key.'_dtend'] = '';
193 }
194 }
195 $search['nb_of_values'] = '';
196 $search['nb_products'] = '';
197 $toselect = array();
198 $search_array_options = array();
199 }
200 if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')
201 || GETPOST('button_search_x', 'alpha') || GETPOST('button_search.x', 'alpha') || GETPOST('button_search', 'alpha')) {
202 $massaction = ''; // Protection to avoid mass action if we force a new search during a mass action confirmation
203 }
204
205 if ($action == 'up' && $permissiontoadd) {
206 $object->attributeMoveUp($rowid);
207
208 header('Location: '.$_SERVER['PHP_SELF']);
209 exit();
210 } elseif ($action == 'down' && $permissiontoadd) {
211 $object->attributeMoveDown($rowid);
212
213 header('Location: '.$_SERVER['PHP_SELF']);
214 exit();
215 }
216
217 // Mass actions
218 $objectclass = 'ProductAttribute';
219 $objectlabel = 'ProductAttribute';
220 $uploaddir = $conf->variants->dir_output;
221 include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
222}
223
224
225
226/*
227 * View
228 */
229
230$form = new Form($db);
231
232$now = dol_now();
233
234$title = $langs->trans("ProductAttributes");
235$help_url = '';
236$morejs = array();
237$morecss = array();
238
239
240// Build and execute select
241// --------------------------------------------------------------------
242$sql = "SELECT COUNT(DISTINCT pav.rowid) AS nb_of_values, COUNT(DISTINCT pac2v.fk_prod_combination) AS nb_products, ";
243$sql .= $object->getFieldList("t");
244// Add fields from extrafields
245//if (!empty($extrafields->attributes[$object->table_element]['label'])) {
246// foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
247// $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key." as options_".$key.", " : "");
248// }
249//}
250// Add fields from hooks
251$parameters = array();
252$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
253$sql .= $hookmanager->resPrint;
254$sql = preg_replace('/,\s*$/', '', $sql);
255
256$sqlfields = $sql; // $sql fields to remove for count total
257
258$sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t";
259//if (isset($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
260// $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (t.rowid = ef.fk_object)";
261//}
262$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_attribute_combination2val AS pac2v ON pac2v.fk_prod_attr = t.rowid";
263$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_attribute_value AS pav ON pav.fk_product_attribute = t.rowid";
264// Add table from hooks
265$parameters = array();
266$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
267$sql .= $hookmanager->resPrint;
268if ($object->ismultientitymanaged == 1) {
269 $sql .= " WHERE t.entity IN (".getEntity($object->element, (GETPOST('search_current_entity', 'int') ? 0 : 1)).")";
270} else {
271 $sql .= " WHERE 1 = 1";
272}
273foreach ($search as $key => $val) {
274 if (array_key_exists($key, $object->fields)) {
275 if ($key == 'status' && $search[$key] == -1) {
276 continue;
277 }
278 $mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0);
279 if ((strpos($object->fields[$key]['type'], 'integer:') === 0) || (strpos($object->fields[$key]['type'], 'sellist:') === 0) || !empty($object->fields[$key]['arrayofkeyval'])) {
280 if ($search[$key] == '-1' || ($search[$key] === '0' && (empty($object->fields[$key]['arrayofkeyval']) || !array_key_exists('0', $object->fields[$key]['arrayofkeyval'])))) {
281 $search[$key] = '';
282 }
283 $mode_search = 2;
284 }
285 if ($search[$key] != '') {
286 $sql .= natural_search("t.".$db->sanitize($key), $search[$key], (($key == 'status') ? 2 : $mode_search));
287 }
288 } else {
289 if (preg_match('/(_dtstart|_dtend)$/', $key) && $search[$key] != '') {
290 $columnName = preg_replace('/(_dtstart|_dtend)$/', '', $key);
291 if (preg_match('/^(date|timestamp|datetime)/', $object->fields[$columnName]['type'])) {
292 if (preg_match('/_dtstart$/', $key)) {
293 $sql .= " AND t.".$db->sanitize($columnName)." >= '".$db->idate($search[$key])."'";
294 }
295 if (preg_match('/_dtend$/', $key)) {
296 $sql .= " AND t.".$db->sanitize($columnName)." <= '".$db->idate($search[$key])."'";
297 }
298 }
299 }
300 }
301}
302if ($search_all) {
303 $sql .= natural_search(array_keys($fieldstosearchall), $search_all);
304}
305//$sql.= dolSqlDateFilter("t.field", $search_xxxday, $search_xxxmonth, $search_xxxyear);
306// Add where from extra fields
307//include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
308// Add where from hooks
309$parameters = array();
310$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
311$sql .= $hookmanager->resPrint;
312
313$hasgroupby = true;
314$sql .= " GROUP BY ";
315foreach ($object->fields as $key => $val) {
316 $sql .= "t.".$db->sanitize($key).", ";
317}
318// Add fields from extrafields
319//if (!empty($extrafields->attributes[$object->table_element]['label'])) {
320// foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
321// $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.', ' : '');
322// }
323//}
324// Add where from hooks
325$parameters = array();
326$reshook = $hookmanager->executeHooks('printFieldListGroupBy', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
327$sql .= $hookmanager->resPrint;
328$sql = preg_replace("/,\s*$/", "", $sql);
329
330$sql .= " HAVING 1=1";
331if ($search['nb_of_values'] != '') {
332 $sql .= natural_search("nb_of_values", $search['nb_of_values'], 1);
333}
334if ($search['nb_products'] != '') {
335 $sql .= natural_search("nb_products", $search['nb_products'], 1);
336}
337// Add HAVING from hooks
338$parameters = array();
339$reshook = $hookmanager->executeHooks('printFieldListHaving', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
340$sql .= empty($hookmanager->resPrint) ? "" : " ".$hookmanager->resPrint;
341
342// Count total nb of records
343$nbtotalofrecords = '';
344if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
345 /* This old and fast method to get and count full list returns all record so use a high amount of memory.
346 $resql = $db->query($sql);
347 $nbtotalofrecords = $db->num_rows($resql);
348 */
349 /* The slow method does not consume memory on mysql (not tested on pgsql) */
350 /*$resql = $db->query($sql, 0, 'auto', 1);
351 while ($db->fetch_object($resql)) {
352 $nbtotalofrecords++;
353 }*/
354 /* The fast and low memory method to get and count full list converts the sql into a sql count */
355 $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql);
356 $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount);
357
358 $resql = $db->query($sqlforcount);
359 if ($resql) {
360 if ($hasgroupby) {
361 $nbtotalofrecords = $db->num_rows($resql);
362 } else {
363 $objforcount = $db->fetch_object($resql);
364 $nbtotalofrecords = $objforcount->nbtotalofrecords;
365 }
366 if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller than the paging size (filtering), goto and load page 0
367 $page = 0;
368 $offset = 0;
369 }
370 $db->free($resql);
371 }
372}
373
374// Complete request and execute it with limit
375$sql .= $db->order($sortfield, $sortorder);
376if ($limit) {
377 $sql .= $db->plimit($limit + 1, $offset);
378}
379
380$resql = $db->query($sql);
381if (!$resql) {
382 dol_print_error($db);
383 exit;
384}
385
386$num = $db->num_rows($resql);
387
388
389// Direct jump if only one record found
390if ($num == 1 && getDolGlobalInt('MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) {
391 $obj = $db->fetch_object($resql);
392 $id = $obj->rowid;
393 header("Location: " . dol_buildpath('/variants/card.php', 2) . '?id='.((int) $id));
394 exit;
395}
396
397
398// Output page
399// --------------------------------------------------------------------
400
401llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'bodyforlist');
402
403$arrayofselected = is_array($toselect) ? $toselect : array();
404
405$param = '';
406if (!empty($mode)) {
407 $param .= '&mode='.urlencode($mode);
408}
409if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
410 $param .= '&contextpage='.urlencode($contextpage);
411}
412if ($limit > 0 && $limit != $conf->liste_limit) {
413 $param .= '&limit='.((int) $limit);
414}
415if ($optioncss != '') {
416 $param .= '&optioncss='.urlencode($optioncss);
417}
418if ($groupby != '') {
419 $param .= '&groupby='.urlencode($groupby);
420}
421foreach ($search as $key => $val) {
422 if (is_array($search[$key])) {
423 foreach ($search[$key] as $skey) {
424 if ($skey != '') {
425 $param .= '&search_'.$key.'[]='.urlencode($skey);
426 }
427 }
428 } elseif (preg_match('/(_dtstart|_dtend)$/', $key) && !empty($val)) {
429 $param .= '&search_'.$key.'month='.(GETPOSTINT('search_'.$key.'month'));
430 $param .= '&search_'.$key.'day='.(GETPOSTINT('search_'.$key.'day'));
431 $param .= '&search_'.$key.'year='.(GETPOSTINT('search_'.$key.'year'));
432 } elseif ($search[$key] != '') {
433 $param .= '&search_'.$key.'='.urlencode($search[$key]);
434 }
435}
436// Add $param from extra fields
437include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
438// Add $param from hooks
439$parameters = array('param' => &$param);
440$reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
441$param .= $hookmanager->resPrint;
442
443// List of mass actions available
444$arrayofmassactions = array(
445 //'validate'=>img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Validate"),
446 //'generate_doc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"),
447 //'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
448 //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"),
449);
450if (!empty($permissiontodelete)) {
451 $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
452}
453if (GETPOSTINT('nomassaction') || in_array($massaction, array('presend', 'predelete'))) {
454 $arrayofmassactions = array();
455}
456$massactionbutton = $form->selectMassAction('', $arrayofmassactions);
457
458print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n";
459if ($optioncss != '') {
460 print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
461}
462print '<input type="hidden" name="token" value="'.newToken().'">';
463print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
464print '<input type="hidden" name="action" value="list">';
465print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
466print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
467print '<input type="hidden" name="page" value="'.$page.'">';
468print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
469print '<input type="hidden" name="page_y" value="">';
470print '<input type="hidden" name="mode" value="'.$mode.'">';
471
472$newcardbutton = '';
473$newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss' => 'reposition'));
474$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'));
475$newcardbutton .= dolGetButtonTitleSeparator();
476$newcardbutton .= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/variants/card.php?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $permissiontoadd);
477
478print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'object_'.$object->picto, 0, $newcardbutton, '', $limit, 0, 0, 1);
479
480// Add code for pre mass action (confirmation or email presend form)
481$topicmail = "SendProductAttributeRef";
482$modelmail = "productattribute";
483$objecttmp = new ProductAttribute($db);
484$trackid = 'pa'.$object->id;
485include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
486
487if ($search_all) {
488 $setupstring = '';
489 foreach ($fieldstosearchall as $key => $val) {
490 $fieldstosearchall[$key] = $langs->trans($val);
491 $setupstring .= $key."=".$val.";";
492 }
493 print '<!-- Search done like if MYOBJECT_QUICKSEARCH_ON_FIELDS = '.$setupstring.' -->'."\n";
494 print '<div class="divsearchfieldfilter">'.$langs->trans("FilterOnInto", $search_all).implode(', ', $fieldstosearchall).'</div>'."\n";
495}
496
497$moreforfilter = '';
498/*$moreforfilter.='<div class="divsearchfield">';
499$moreforfilter.= $langs->trans('MyFilter') . ': <input type="text" name="search_myfield" value="'.dol_escape_htmltag($search_myfield).'">';
500$moreforfilter.= '</div>';*/
501
502$parameters = array();
503$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
504if (empty($reshook)) {
505 $moreforfilter .= $hookmanager->resPrint;
506} else {
507 $moreforfilter = $hookmanager->resPrint;
508}
509
510if (!empty($moreforfilter)) {
511 print '<div class="liste_titre liste_titre_bydiv centpercent">';
512 print $moreforfilter;
513 print '</div>';
514}
515
516$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
517$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup
518$selectedfields = ($mode != 'kanban' ? $htmlofselectarray : '');
519$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
520
521print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table
522print '<table id="tableattributes" class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
523
524
525// Fields title search
526// --------------------------------------------------------------------
527print '<tr class="liste_titre_filter">';
528// Action column
529if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
530 print '<td class="liste_titre center maxwidthsearch">';
531 $searchpicto = $form->showFilterButtons('left');
532 print $searchpicto;
533 print '</td>';
534}
535foreach ($object->fields as $key => $val) {
536 //$searchkey = empty($search[$key]) ? '' : $search[$key];
537 $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']);
538 if ($key == 'status') {
539 $cssforfield .= ($cssforfield ? ' ' : '').'center';
540 } elseif (in_array($val['type'], array('date', 'datetime', 'timestamp'))) {
541 $cssforfield .= ($cssforfield ? ' ' : '').'center';
542 } elseif (in_array($val['type'], array('timestamp'))) {
543 $cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
544 } 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'])) {
545 $cssforfield .= ($cssforfield ? ' ' : '').'right';
546 }
547 if (!empty($arrayfields['t.'.$key]['checked'])) {
548 print '<td class="liste_titre'.($cssforfield ? ' '.$cssforfield : '').($key == 'status' ? ' parentonrightofpage' : '').'">';
549 if (!empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) {
550 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);
551 } elseif ((strpos($val['type'], 'integer:') === 0) || (strpos($val['type'], 'sellist:') === 0)) {
552 print $object->showInputField($val, $key, (isset($search[$key]) ? $search[$key] : ''), '', '', 'search_', $cssforfield.' maxwidth250', 1);
553 } elseif (preg_match('/^(date|timestamp|datetime)/', $val['type'])) {
554 print '<div class="nowrap">';
555 print $form->selectDate($search[$key.'_dtstart'] ? $search[$key.'_dtstart'] : '', "search_".$key."_dtstart", 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From'));
556 print '</div>';
557 print '<div class="nowrap">';
558 print $form->selectDate($search[$key.'_dtend'] ? $search[$key.'_dtend'] : '', "search_".$key."_dtend", 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to'));
559 print '</div>';
560 } elseif ($key == 'lang') {
561 require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
562 $formadmin = new FormAdmin($db);
563 print $formadmin->select_language((isset($search[$key]) ? $search[$key] : ''), 'search_lang', 0, null, 1, 0, 0, 'minwidth100imp maxwidth125', 2);
564 } else {
565 print '<input type="text" class="flat maxwidth75" name="search_'.$key.'" value="'.dol_escape_htmltag(isset($search[$key]) ? $search[$key] : '').'">';
566 }
567 print '</td>';
568 }
569}
570// Extra fields
571include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php';
572// Fields from hook
573$parameters = array('arrayfields' => $arrayfields);
574$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
575print $hookmanager->resPrint;
576
577$key = 'nb_of_values';
578if (!empty($arrayfields[$key]['checked'])) {
579 print '<td class="liste_titre center">';
580 print '<input type="text" class="flat maxwidth75" name="search_'.$key.'" value="'.dol_escape_htmltag(isset($search[$key]) ? $search[$key] : '').'">';
581 print '</td>';
582}
583$key = 'nb_products';
584if (!empty($arrayfields[$key]['checked'])) {
585 print '<td class="liste_titre center">';
586 print '<input type="text" class="flat maxwidth75" name="search_'.$key.'" value="'.dol_escape_htmltag(isset($search[$key]) ? $search[$key] : '').'">';
587 print '</td>';
588}
589// Action column
590if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
591 print '<td class="liste_titre center maxwidthsearch">';
592 $searchpicto = $form->showFilterButtons();
593 print $searchpicto;
594 print '</td>';
595}
596// Move
597print '<td class="liste_titre linecolmove width25"></td>';
598print '</tr>'."\n";
599
600$totalarray = array();
601$totalarray['nbfield'] = 0;
602
603// Fields title label
604// --------------------------------------------------------------------
605print '<tr class="liste_titre">';
606// Action column
607if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
608 print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
609 $totalarray['nbfield']++;
610}
611foreach ($object->fields as $key => $val) {
612 $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']);
613 if ($key == 'status') {
614 $cssforfield .= ($cssforfield ? ' ' : '').'center';
615 } elseif (in_array($val['type'], array('date', 'datetime', 'timestamp'))) {
616 $cssforfield .= ($cssforfield ? ' ' : '').'center';
617 } elseif (in_array($val['type'], array('timestamp'))) {
618 $cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
619 } 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'])) {
620 $cssforfield .= ($cssforfield ? ' ' : '').'right';
621 }
622 $cssforfield = preg_replace('/small\s*/', '', $cssforfield); // the 'small' css must not be used for the title label
623 if (!empty($arrayfields['t.'.$key]['checked'])) {
624 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";
625 $totalarray['nbfield']++;
626 }
627}
628// Extra fields
629include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
630// Hook fields
631$parameters = array('arrayfields' => $arrayfields, 'param' => $param, 'sortfield' => $sortfield, 'sortorder' => $sortorder, 'totalarray' => &$totalarray);
632$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
633print $hookmanager->resPrint;
634
635$key = 'nb_of_values';
636if (!empty($arrayfields[$key]['checked'])) {
637 print getTitleFieldOfList($arrayfields[$key]['label'], 0, $_SERVER['PHP_SELF'], $key, '', $param, 'class="center"', $sortfield, $sortorder, 'center ')."\n";
638 $totalarray['nbfield']++;
639}
640$key = 'nb_products';
641if (!empty($arrayfields[$key]['checked'])) {
642 print getTitleFieldOfList($arrayfields[$key]['label'], 0, $_SERVER['PHP_SELF'], $key, '', $param, 'class="center"', $sortfield, $sortorder, 'center ')."\n";
643 $totalarray['nbfield']++;
644}
645// Action column
646if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
647 print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
648 $totalarray['nbfield']++;
649}
650// Move
651print getTitleFieldOfList('', 0, '', '', '', '', '', '', '', 'linecolmove ')."\n";
652$totalarray['nbfield']++;
653print '</tr>'."\n";
654
655
656// Detect if we need a fetch on each output line
657$needToFetchEachLine = 0;
658//if (isset($extrafields->attributes[$object->table_element]['computed']) && is_array($extrafields->attributes[$object->table_element]['computed']) && count($extrafields->attributes[$object->table_element]['computed']) > 0) {
659// foreach ($extrafields->attributes[$object->table_element]['computed'] as $key => $val) {
660// if (!is_null($val) && preg_match('/\$object/', $val)) {
661// $needToFetchEachLine++; // There is at least one compute field that use $object
662// }
663// }
664//}
665
666
667// Loop on record
668// --------------------------------------------------------------------
669$i = 0;
670$savnbfield = $totalarray['nbfield'];
671$totalarray = array();
672$totalarray['nbfield'] = 0;
673$imaxinloop = ($limit ? min($num, $limit) : $num);
674while ($i < $imaxinloop) {
675 $obj = $db->fetch_object($resql);
676 if (empty($obj)) {
677 break; // Should not happen
678 }
679
680 // Store properties in $object
681 $object->setVarsFromFetchObj($obj);
682
683 if ($mode == 'kanban') {
684 if ($i == 0) {
685 print '<tr class="trkanban"><td colspan="'.$savnbfield.'">';
686 print '<div class="box-flex-container kanban">';
687 }
688 // Output Kanban
689 $selected = -1;
690 if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
691 $selected = 0;
692 if (in_array($object->id, $arrayofselected)) {
693 $selected = 1;
694 }
695 }
696 print $object->getKanbanView('', array('selected' => $selected));
697 if ($i == ($imaxinloop - 1)) {
698 print '</div>';
699 print '</td></tr>';
700 }
701 } else {
702 // Show line of result
703 $j = 0;
704 print '<tr data-rowid="'.$object->id.'" class="oddeven">';
705 // Action column
706 if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
707 print '<td class="nowrap center">';
708 if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
709 $selected = 0;
710 if (in_array($object->id, $arrayofselected)) {
711 $selected = 1;
712 }
713 print '<input id="cb'.$object->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.'"'.($selected ? ' checked="checked"' : '').'>';
714 }
715 print '</td>';
716 if (!$i) {
717 $totalarray['nbfield']++;
718 }
719 }
720 // Fields
721 foreach ($object->fields as $key => $val) {
722 $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']);
723 if (in_array($val['type'], array('date', 'datetime', 'timestamp'))) {
724 $cssforfield .= ($cssforfield ? ' ' : '') . 'center';
725 } elseif ($key == 'status') {
726 $cssforfield .= ($cssforfield ? ' ' : '') . 'center';
727 }
728
729 if (in_array($val['type'], array('timestamp'))) {
730 $cssforfield .= ($cssforfield ? ' ' : '') . 'nowraponall';
731 } elseif ($key == 'ref') {
732 $cssforfield .= ($cssforfield ? ' ' : '') . 'nowraponall';
733 }
734
735 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'])) {
736 $cssforfield .= ($cssforfield ? ' ' : '') . 'right';
737 }
738 //if (in_array($key, array('fk_soc', 'fk_user', 'fk_warehouse'))) $cssforfield = 'tdoverflowmax100';
739
740 if (!empty($arrayfields['t.' . $key]['checked'])) {
741 print '<td'.($cssforfield ? ' class="'.$cssforfield.((preg_match('/tdoverflow/', $cssforfield) && !in_array($val['type'], array('ip', 'url')) && !is_numeric($object->$key)) ? ' classfortooltip' : '').'"' : '');
742 if (preg_match('/tdoverflow/', $cssforfield) && !in_array($val['type'], array('ip', 'url')) && !is_numeric($object->$key)) {
743 print ' title="'.dol_escape_htmltag($object->$key).'"';
744 }
745 print '>';
746 if ($key == 'status') {
747 print $object->getLibStatut(5);
748 } elseif ($key == 'rowid') {
749 print $object->showOutputField($val, $key, $object->id, '');
750 } else {
751 print $object->showOutputField($val, $key, $object->$key, '');
752 }
753 print '</td>';
754 if (!$i) {
755 $totalarray['nbfield']++;
756 }
757 if (!empty($val['isameasure']) && $val['isameasure'] == 1) {
758 if (!$i) {
759 $totalarray['pos'][$totalarray['nbfield']] = 't.' . $key;
760 }
761 if (!isset($totalarray['val'])) {
762 $totalarray['val'] = array();
763 }
764 if (!isset($totalarray['val']['t.' . $key])) {
765 $totalarray['val']['t.' . $key] = 0;
766 }
767 $totalarray['val']['t.' . $key] += $object->$key;
768 }
769 }
770 }
771 // Extra fields
772 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
773 // Fields from hook
774 $parameters = array('arrayfields' => $arrayfields, 'object' => $object, 'obj' => $obj, 'i' => $i, 'totalarray' => &$totalarray);
775 $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
776 print $hookmanager->resPrint;
777 // Other
778 $key = 'nb_of_values';
779 if (!empty($arrayfields[$key]['checked'])) {
780 print '<td class="center">';
781 print $obj->$key;
782 print '</td>';
783 if (!$i) {
784 $totalarray['nbfield']++;
785 }
786 }
787 $key = 'nb_products';
788 if (!empty($arrayfields[$key]['checked'])) {
789 print '<td class="center">';
790 print $obj->$key;
791 print '</td>';
792 if (!$i) {
793 $totalarray['nbfield']++;
794 }
795 }
796 // Action column
797 if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
798 print '<td class="nowrap center">';
799 if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
800 $selected = 0;
801 if (in_array($object->id, $arrayofselected)) {
802 $selected = 1;
803 }
804 print '<input id="cb'.$object->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.'"'.($selected ? ' checked="checked"' : '').'>';
805 }
806 print '</td>';
807 if (!$i) {
808 $totalarray['nbfield']++;
809 }
810 }
811 // Move
812 print '<td class="center linecolmove tdlineupdown">';
813 if ($i > 0) {
814 print '<a class="lineupdown" href="' . $_SERVER['PHP_SELF'] . '?action=up&amp;rowid=' . $obj->rowid . '">' . img_up('default', 0, 'imgupforline') . '</a>';
815 }
816 if ($i < $num - 1) {
817 print '<a class="lineupdown" href="' . $_SERVER['PHP_SELF'] . '?action=down&amp;rowid=' . $obj->rowid . '">' . img_down('default', 0, 'imgdownforline') . '</a>';
818 }
819 print '</td>';
820 if (!$i) {
821 $totalarray['nbfield']++;
822 }
823
824 print '</tr>' . "\n";
825 }
826
827 $i++;
828}
829
830// Show total line
831include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php';
832
833// If no record found
834if ($num == 0) {
835 $colspan = 1;
836 foreach ($arrayfields as $key => $val) {
837 if (!empty($val['checked'])) {
838 $colspan++;
839 }
840 }
841 $colspan++; // For the move column
842 print '<tr><td colspan="'.$colspan.'"><span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span></td></tr>';
843}
844
845$db->free($resql);
846
847$parameters = array('arrayfields' => $arrayfields, 'sql' => $sql);
848$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
849print $hookmanager->resPrint;
850
851print '</table>'."\n";
852print '</div>'."\n";
853
854print '</form>'."\n";
855
856$forcereloadpage = !getDolGlobalString('MAIN_FORCE_RELOAD_PAGE') ? 0 : 1;
857$tagidfortablednd = (empty($tagidfortablednd) ? 'tableattributes' : $tagidfortablednd);
858?>
859 <script>
860 $(document).ready(function(){
861 $(".imgupforline, .imgdownforline").hide();
862 $(".lineupdown").removeAttr('href');
863 $(".tdlineupdown")
864 .css("background-image", 'url(<?php echo DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/grip.png'; ?>)')
865 .css("background-repeat", "no-repeat")
866 .css("background-position", "center center")
867 .hover(
868 function () {
869 $(this).addClass('showDragHandle');
870 }, function () {
871 $(this).removeClass('showDragHandle');
872 }
873 );
874
875 $("#<?php echo $tagidfortablednd; ?>").tableDnD({
876 onDrop: function(table, row) {
877 console.log('drop');
878 $('#<?php echo $tagidfortablednd; ?> tr[data-element=extrafield]').attr('id', ''); // Set extrafields id to empty value in order to ignore them in tableDnDSerialize function
879 $('#<?php echo $tagidfortablednd; ?> tr[data-ignoreidfordnd=1]').attr('id', ''); // Set id to empty value in order to ignore them in tableDnDSerialize function
880 var reloadpage = "<?php echo $forcereloadpage; ?>";
881 var roworder = cleanSerialize(decodeURI($("#<?php echo $tagidfortablednd; ?>").tableDnDSerialize()));
882 $.post("<?php echo DOL_URL_ROOT; ?>/variants/ajax/orderAttribute.php",
883 {
884 roworder: roworder,
885 token: "<?php echo currentToken(); ?>"
886 },
887 function() {
888 if (reloadpage == 1) {
889 location.href = '<?php echo dol_escape_htmltag($_SERVER['PHP_SELF']).'?'.dol_escape_htmltag($_SERVER['QUERY_STRING']); ?>';
890 }
891 });
892 },
893 onDragClass: "dragClass",
894 dragHandle: "td.tdlineupdown"
895 });
896 });
897 </script>
898<?php
899
900if (in_array('builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords === '' || $nbtotalofrecords)) {
901 $hidegeneratedfilelistifempty = 1;
902 if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) {
903 $hidegeneratedfilelistifempty = 0;
904 }
905
906 require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
907 $formfile = new FormFile($db);
908
909 // Show list of available documents
910 $urlsource = $_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder;
911 $urlsource .= str_replace('&amp;', '&', $param);
912
913 $filedir = $diroutputmassaction;
914 $genallowed = $permissiontoread;
915 $delallowed = $permissiontoadd;
916
917 print $formfile->showdocuments('massfilesarea_productattribute', '', $filedir, $urlsource, 0, $delallowed, '', 1, 1, 0, 48, 1, $param, $title, '', '', '', null, $hidegeneratedfilelistifempty);
918}
919
920// End of page
921llxFooter();
922$db->close();
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
Definition card.php:58
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
Empty header.
Definition wrapper.php:55
llxFooter()
Empty footer.
Definition wrapper.php:69
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.
Class ProductAttribute Used to represent a Product attribute Examples:
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...
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
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.
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)
Generate natural SQL search string for a criteria (this criteria can be tested on one or several fiel...
img_down($titlealt='default', $selected=0, $moreclass='')
Show down arrow logo.
dol_now($mode='auto')
Return date for now.
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.
dolGetButtonTitleSeparator($moreClass="")
Add space between dolGetButtonTitle.
print_barre_liste($title, $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.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
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...
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
img_up($titlealt='default', $selected=0, $moreclass='')
Show top arrow logo.
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...
treeview li table
No Email.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.