dolibarr 20.0.0
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 $parameters = array();
514 $reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
515 print $hookmanager->resPrint;
516 print '</div>';
517}
518
519$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
520$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup
521$selectedfields = ($mode != 'kanban' ? $htmlofselectarray : '');
522$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
523
524print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table
525print '<table id="tableattributes" class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
526
527
528// Fields title search
529// --------------------------------------------------------------------
530print '<tr class="liste_titre_filter">';
531// Action column
532if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
533 print '<td class="liste_titre center maxwidthsearch">';
534 $searchpicto = $form->showFilterButtons('left');
535 print $searchpicto;
536 print '</td>';
537}
538foreach ($object->fields as $key => $val) {
539 //$searchkey = empty($search[$key]) ? '' : $search[$key];
540 $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']);
541 if ($key == 'status') {
542 $cssforfield .= ($cssforfield ? ' ' : '').'center';
543 } elseif (in_array($val['type'], array('date', 'datetime', 'timestamp'))) {
544 $cssforfield .= ($cssforfield ? ' ' : '').'center';
545 } elseif (in_array($val['type'], array('timestamp'))) {
546 $cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
547 } 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'])) {
548 $cssforfield .= ($cssforfield ? ' ' : '').'right';
549 }
550 if (!empty($arrayfields['t.'.$key]['checked'])) {
551 print '<td class="liste_titre'.($cssforfield ? ' '.$cssforfield : '').($key == 'status' ? ' parentonrightofpage' : '').'">';
552 if (!empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) {
553 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);
554 } elseif ((strpos($val['type'], 'integer:') === 0) || (strpos($val['type'], 'sellist:') === 0)) {
555 print $object->showInputField($val, $key, (isset($search[$key]) ? $search[$key] : ''), '', '', 'search_', $cssforfield.' maxwidth250', 1);
556 } elseif (preg_match('/^(date|timestamp|datetime)/', $val['type'])) {
557 print '<div class="nowrap">';
558 print $form->selectDate($search[$key.'_dtstart'] ? $search[$key.'_dtstart'] : '', "search_".$key."_dtstart", 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From'));
559 print '</div>';
560 print '<div class="nowrap">';
561 print $form->selectDate($search[$key.'_dtend'] ? $search[$key.'_dtend'] : '', "search_".$key."_dtend", 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to'));
562 print '</div>';
563 } elseif ($key == 'lang') {
564 require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
565 $formadmin = new FormAdmin($db);
566 print $formadmin->select_language((isset($search[$key]) ? $search[$key] : ''), 'search_lang', 0, null, 1, 0, 0, 'minwidth100imp maxwidth125', 2);
567 } else {
568 print '<input type="text" class="flat maxwidth75" name="search_'.$key.'" value="'.dol_escape_htmltag(isset($search[$key]) ? $search[$key] : '').'">';
569 }
570 print '</td>';
571 }
572}
573// Extra fields
574include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php';
575// Fields from hook
576$parameters = array('arrayfields' => $arrayfields);
577$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
578print $hookmanager->resPrint;
579
580$key = 'nb_of_values';
581if (!empty($arrayfields[$key]['checked'])) {
582 print '<td class="liste_titre center">';
583 print '<input type="text" class="flat maxwidth75" name="search_'.$key.'" value="'.dol_escape_htmltag(isset($search[$key]) ? $search[$key] : '').'">';
584 print '</td>';
585}
586$key = 'nb_products';
587if (!empty($arrayfields[$key]['checked'])) {
588 print '<td class="liste_titre center">';
589 print '<input type="text" class="flat maxwidth75" name="search_'.$key.'" value="'.dol_escape_htmltag(isset($search[$key]) ? $search[$key] : '').'">';
590 print '</td>';
591}
592// Action column
593if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
594 print '<td class="liste_titre center maxwidthsearch">';
595 $searchpicto = $form->showFilterButtons();
596 print $searchpicto;
597 print '</td>';
598}
599// Move
600print '<td class="liste_titre linecolmove width25"></td>';
601print '</tr>'."\n";
602
603$totalarray = array();
604$totalarray['nbfield'] = 0;
605
606// Fields title label
607// --------------------------------------------------------------------
608print '<tr class="liste_titre">';
609// Action column
610if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
611 print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
612 $totalarray['nbfield']++;
613}
614foreach ($object->fields as $key => $val) {
615 $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']);
616 if ($key == 'status') {
617 $cssforfield .= ($cssforfield ? ' ' : '').'center';
618 } elseif (in_array($val['type'], array('date', 'datetime', 'timestamp'))) {
619 $cssforfield .= ($cssforfield ? ' ' : '').'center';
620 } elseif (in_array($val['type'], array('timestamp'))) {
621 $cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
622 } 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'])) {
623 $cssforfield .= ($cssforfield ? ' ' : '').'right';
624 }
625 $cssforfield = preg_replace('/small\s*/', '', $cssforfield); // the 'small' css must not be used for the title label
626 if (!empty($arrayfields['t.'.$key]['checked'])) {
627 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";
628 $totalarray['nbfield']++;
629 }
630}
631// Extra fields
632include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
633// Hook fields
634$parameters = array('arrayfields' => $arrayfields, 'param' => $param, 'sortfield' => $sortfield, 'sortorder' => $sortorder, 'totalarray' => &$totalarray);
635$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
636print $hookmanager->resPrint;
637
638$key = 'nb_of_values';
639if (!empty($arrayfields[$key]['checked'])) {
640 print getTitleFieldOfList($arrayfields[$key]['label'], 0, $_SERVER['PHP_SELF'], $key, '', $param, 'class="center"', $sortfield, $sortorder, 'center ')."\n";
641 $totalarray['nbfield']++;
642}
643$key = 'nb_products';
644if (!empty($arrayfields[$key]['checked'])) {
645 print getTitleFieldOfList($arrayfields[$key]['label'], 0, $_SERVER['PHP_SELF'], $key, '', $param, 'class="center"', $sortfield, $sortorder, 'center ')."\n";
646 $totalarray['nbfield']++;
647}
648// Action column
649if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
650 print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
651 $totalarray['nbfield']++;
652}
653// Move
654print getTitleFieldOfList('', 0, '', '', '', '', '', '', '', 'linecolmove ')."\n";
655$totalarray['nbfield']++;
656print '</tr>'."\n";
657
658
659// Detect if we need a fetch on each output line
660$needToFetchEachLine = 0;
661//if (isset($extrafields->attributes[$object->table_element]['computed']) && is_array($extrafields->attributes[$object->table_element]['computed']) && count($extrafields->attributes[$object->table_element]['computed']) > 0) {
662// foreach ($extrafields->attributes[$object->table_element]['computed'] as $key => $val) {
663// if (!is_null($val) && preg_match('/\$object/', $val)) {
664// $needToFetchEachLine++; // There is at least one compute field that use $object
665// }
666// }
667//}
668
669
670// Loop on record
671// --------------------------------------------------------------------
672$i = 0;
673$savnbfield = $totalarray['nbfield'];
674$totalarray = array();
675$totalarray['nbfield'] = 0;
676$imaxinloop = ($limit ? min($num, $limit) : $num);
677while ($i < $imaxinloop) {
678 $obj = $db->fetch_object($resql);
679 if (empty($obj)) {
680 break; // Should not happen
681 }
682
683 // Store properties in $object
684 $object->setVarsFromFetchObj($obj);
685
686 if ($mode == 'kanban') {
687 if ($i == 0) {
688 print '<tr class="trkanban"><td colspan="'.$savnbfield.'">';
689 print '<div class="box-flex-container kanban">';
690 }
691 // Output Kanban
692 $selected = -1;
693 if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
694 $selected = 0;
695 if (in_array($object->id, $arrayofselected)) {
696 $selected = 1;
697 }
698 }
699 print $object->getKanbanView('', array('selected' => $selected));
700 if ($i == ($imaxinloop - 1)) {
701 print '</div>';
702 print '</td></tr>';
703 }
704 } else {
705 // Show line of result
706 $j = 0;
707 print '<tr data-rowid="'.$object->id.'" class="oddeven">';
708 // Action column
709 if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
710 print '<td class="nowrap center">';
711 if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
712 $selected = 0;
713 if (in_array($object->id, $arrayofselected)) {
714 $selected = 1;
715 }
716 print '<input id="cb'.$object->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.'"'.($selected ? ' checked="checked"' : '').'>';
717 }
718 print '</td>';
719 if (!$i) {
720 $totalarray['nbfield']++;
721 }
722 }
723 // Fields
724 foreach ($object->fields as $key => $val) {
725 $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']);
726 if (in_array($val['type'], array('date', 'datetime', 'timestamp'))) {
727 $cssforfield .= ($cssforfield ? ' ' : '') . 'center';
728 } elseif ($key == 'status') {
729 $cssforfield .= ($cssforfield ? ' ' : '') . 'center';
730 }
731
732 if (in_array($val['type'], array('timestamp'))) {
733 $cssforfield .= ($cssforfield ? ' ' : '') . 'nowraponall';
734 } elseif ($key == 'ref') {
735 $cssforfield .= ($cssforfield ? ' ' : '') . 'nowraponall';
736 }
737
738 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'])) {
739 $cssforfield .= ($cssforfield ? ' ' : '') . 'right';
740 }
741 //if (in_array($key, array('fk_soc', 'fk_user', 'fk_warehouse'))) $cssforfield = 'tdoverflowmax100';
742
743 if (!empty($arrayfields['t.' . $key]['checked'])) {
744 print '<td'.($cssforfield ? ' class="'.$cssforfield.((preg_match('/tdoverflow/', $cssforfield) && !in_array($val['type'], array('ip', 'url')) && !is_numeric($object->$key)) ? ' classfortooltip' : '').'"' : '');
745 if (preg_match('/tdoverflow/', $cssforfield) && !in_array($val['type'], array('ip', 'url')) && !is_numeric($object->$key)) {
746 print ' title="'.dol_escape_htmltag($object->$key).'"';
747 }
748 print '>';
749 if ($key == 'status') {
750 print $object->getLibStatut(5);
751 } elseif ($key == 'rowid') {
752 print $object->showOutputField($val, $key, $object->id, '');
753 } else {
754 print $object->showOutputField($val, $key, $object->$key, '');
755 }
756 print '</td>';
757 if (!$i) {
758 $totalarray['nbfield']++;
759 }
760 if (!empty($val['isameasure']) && $val['isameasure'] == 1) {
761 if (!$i) {
762 $totalarray['pos'][$totalarray['nbfield']] = 't.' . $key;
763 }
764 if (!isset($totalarray['val'])) {
765 $totalarray['val'] = array();
766 }
767 if (!isset($totalarray['val']['t.' . $key])) {
768 $totalarray['val']['t.' . $key] = 0;
769 }
770 $totalarray['val']['t.' . $key] += $object->$key;
771 }
772 }
773 }
774 // Extra fields
775 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
776 // Fields from hook
777 $parameters = array('arrayfields' => $arrayfields, 'object' => $object, 'obj' => $obj, 'i' => $i, 'totalarray' => &$totalarray);
778 $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
779 print $hookmanager->resPrint;
780 // Other
781 $key = 'nb_of_values';
782 if (!empty($arrayfields[$key]['checked'])) {
783 print '<td class="center">';
784 print $obj->$key;
785 print '</td>';
786 if (!$i) {
787 $totalarray['nbfield']++;
788 }
789 }
790 $key = 'nb_products';
791 if (!empty($arrayfields[$key]['checked'])) {
792 print '<td class="center">';
793 print $obj->$key;
794 print '</td>';
795 if (!$i) {
796 $totalarray['nbfield']++;
797 }
798 }
799 // Action column
800 if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
801 print '<td class="nowrap center">';
802 if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
803 $selected = 0;
804 if (in_array($object->id, $arrayofselected)) {
805 $selected = 1;
806 }
807 print '<input id="cb'.$object->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.'"'.($selected ? ' checked="checked"' : '').'>';
808 }
809 print '</td>';
810 if (!$i) {
811 $totalarray['nbfield']++;
812 }
813 }
814 // Move
815 print '<td class="center linecolmove tdlineupdown">';
816 if ($i > 0) {
817 print '<a class="lineupdown" href="' . $_SERVER['PHP_SELF'] . '?action=up&amp;rowid=' . $obj->rowid . '">' . img_up('default', 0, 'imgupforline') . '</a>';
818 }
819 if ($i < $num - 1) {
820 print '<a class="lineupdown" href="' . $_SERVER['PHP_SELF'] . '?action=down&amp;rowid=' . $obj->rowid . '">' . img_down('default', 0, 'imgdownforline') . '</a>';
821 }
822 print '</td>';
823 if (!$i) {
824 $totalarray['nbfield']++;
825 }
826
827 print '</tr>' . "\n";
828 }
829
830 $i++;
831}
832
833// Show total line
834include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php';
835
836// If no record found
837if ($num == 0) {
838 $colspan = 1;
839 foreach ($arrayfields as $key => $val) {
840 if (!empty($val['checked'])) {
841 $colspan++;
842 }
843 }
844 $colspan++; // For the move column
845 print '<tr><td colspan="'.$colspan.'"><span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span></td></tr>';
846}
847
848$db->free($resql);
849
850$parameters = array('arrayfields' => $arrayfields, 'sql' => $sql);
851$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
852print $hookmanager->resPrint;
853
854print '</table>'."\n";
855print '</div>'."\n";
856
857print '</form>'."\n";
858
859$forcereloadpage = !getDolGlobalString('MAIN_FORCE_RELOAD_PAGE') ? 0 : 1;
860$tagidfortablednd = (empty($tagidfortablednd) ? 'tableattributes' : $tagidfortablednd);
861?>
862 <script>
863 $(document).ready(function(){
864 $(".imgupforline, .imgdownforline").hide();
865 $(".lineupdown").removeAttr('href');
866 $(".tdlineupdown")
867 .css("background-image", 'url(<?php echo DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/grip.png'; ?>)')
868 .css("background-repeat", "no-repeat")
869 .css("background-position", "center center")
870 .hover(
871 function () {
872 $(this).addClass('showDragHandle');
873 }, function () {
874 $(this).removeClass('showDragHandle');
875 }
876 );
877
878 $("#<?php echo $tagidfortablednd; ?>").tableDnD({
879 onDrop: function(table, row) {
880 console.log('drop');
881 $('#<?php echo $tagidfortablednd; ?> tr[data-element=extrafield]').attr('id', ''); // Set extrafields id to empty value in order to ignore them in tableDnDSerialize function
882 $('#<?php echo $tagidfortablednd; ?> tr[data-ignoreidfordnd=1]').attr('id', ''); // Set id to empty value in order to ignore them in tableDnDSerialize function
883 var reloadpage = "<?php echo $forcereloadpage; ?>";
884 var roworder = cleanSerialize(decodeURI($("#<?php echo $tagidfortablednd; ?>").tableDnDSerialize()));
885 $.post("<?php echo DOL_URL_ROOT; ?>/variants/ajax/orderAttribute.php",
886 {
887 roworder: roworder,
888 token: "<?php echo currentToken(); ?>"
889 },
890 function() {
891 if (reloadpage == 1) {
892 location.href = '<?php echo dol_escape_htmltag($_SERVER['PHP_SELF']).'?'.dol_escape_htmltag($_SERVER['QUERY_STRING']); ?>';
893 }
894 });
895 },
896 onDragClass: "dragClass",
897 dragHandle: "td.tdlineupdown"
898 });
899 });
900 </script>
901<?php
902
903if (in_array('builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords === '' || $nbtotalofrecords)) {
904 $hidegeneratedfilelistifempty = 1;
905 if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) {
906 $hidegeneratedfilelistifempty = 0;
907 }
908
909 require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
910 $formfile = new FormFile($db);
911
912 // Show list of available documents
913 $urlsource = $_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder;
914 $urlsource .= str_replace('&amp;', '&', $param);
915
916 $filedir = $diroutputmassaction;
917 $genallowed = $permissiontoread;
918 $delallowed = $permissiontoadd;
919
920 print $formfile->showdocuments('massfilesarea_productattribute', '', $filedir, $urlsource, 0, $delallowed, '', 1, 1, 0, 48, 1, $param, $title, '', '', '', null, $hidegeneratedfilelistifempty);
921}
922
923// End of page
924llxFooter();
925$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.