dolibarr 20.0.0
list.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3 * Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
4 * Copyright (C) 2005-2007 Regis Houssin <regis.houssin@inodbox.com>
5 * Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
6 * Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
7 * Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 3 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program. If not, see <https://www.gnu.org/licenses/>.
21 */
22
30// Load Dolibarr environment
31require '../../main.inc.php';
32require_once DOL_DOCUMENT_ROOT .'/product/class/product.class.php';
33require_once DOL_DOCUMENT_ROOT .'/societe/class/societe.class.php';
34require_once DOL_DOCUMENT_ROOT .'/fourn/class/fournisseur.class.php';
35
36
37// Load translation files required by the page
38$langs->loadLangs(array('products', 'suppliers'));
39
40// Get Parameters
41$action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'create'/'add', 'edit'/'update', 'view', ...
42$toselect = GETPOST('toselect', 'array:int'); // Array of ids of elements selected into a list
43$optioncss = GETPOST('optioncss', 'alpha');
44$mode = GETPOST('mode', 'aZ'); // The output mode ('list', 'kanban', 'hierarchy', 'calendar', ...)
45
46$sref = GETPOST('sref', 'alphanohtml');
47$sRefSupplier = GETPOST('srefsupplier');
48$snom = GETPOST('snom', 'alphanohtml');
49$type = GETPOST('type', 'alphanohtml');
50
51// Load variable for pagination
52$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit;
53$sortfield = GETPOST('sortfield', 'aZ09comma');
54$sortorder = GETPOST('sortorder', 'aZ09comma');
55$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT('page');
56if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) {
57 // If $page is not defined, or '' or -1 or if we click on clear filters
58 $page = 0;
59}
60$offset = $limit * $page;
61$pageprev = $page - 1;
62$pagenext = $page + 1;
63if (!$sortfield) {
64 $sortfield = "p.ref"; // Set here default search field
65}
66if (!$sortorder) {
67 $sortorder = "ASC";
68}
69
70$fourn_id = GETPOST('fourn_id', 'intcomma');
71if ($user->socid) {
72 $fourn_id = $user->socid;
73}
74
75$catid = GETPOST('catid', 'intcomma');
76
77// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array
78$hookmanager->initHooks(array('supplierpricelist'));
79$extrafields = new ExtraFields($db);
80
81if (!$user->hasRight("produit", "lire") && !$user->hasRight("service", "lire")) {
83}
84
85// Permissions
86$permissiontoadd = ($user->hasRight('product', 'read') || $user->hasRight('service', 'read'));
87
88
89/*
90 * Actions
91 */
92
93if (GETPOST('cancel', 'alpha')) {
94 $action = 'list';
95 $massaction = '';
96}
97if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') {
98 $massaction = '';
99}
100
101$parameters = array();
102
103$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
104if ($reshook < 0) {
105 setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
106}
107
108if (empty($reshook)) {
109 // Selection of new fields
110 include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
111
112 // Purge search criteria
113 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
114 $sref = '';
115 $sRefSupplier = '';
116 $snom = '';
117 $search_field1 = '';
118 $search_field2 = '';
119 $search_date_creation = '';
120 $search_date_modification = '';
121 $toselect = array();
122 $search_array_options = array();
123 }
124}
125
126
127/*
128 * View
129 */
130
131$form = new Form($db);
132$productstatic = new Product($db);
133$companystatic = new Societe($db);
134
135$title = $langs->trans('Supplier')." - ".$langs->trans('ProductsAndServices');
136
137if ($fourn_id) {
138 $supplier = new Fournisseur($db);
139 $supplier->fetch($fourn_id);
140}
141
142
143// Build and execute select
144// --------------------------------------------------------------------
145$sql = "SELECT p.rowid, p.label, p.ref, p.fk_product_type, p.entity, p.tosell, p.tobuy, p.barcode, p.fk_barcode_type,";
146$sql .= " ppf.fk_soc, ppf.ref_fourn, ppf.price as price, ppf.quantity as qty, ppf.unitprice,";
147$sql .= " s.rowid as socid, s.nom as name";
148// Add fields to SELECT from hooks
149$parameters = array();
150$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object, $action);
151if ($reshook < 0) {
152 setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
153}
154$sql .= $hookmanager->resPrint;
155
156$sqlfields = $sql; // $sql fields to remove for count total
157
158$sql .= " FROM ".MAIN_DB_PREFIX."product as p";
159if ($catid) {
160 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."categorie_product as cp ON cp.fk_product = p.rowid";
161}
162$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as ppf ON p.rowid = ppf.fk_product AND p.entity = ppf.entity";
163$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON ppf.fk_soc = s.rowid AND s.entity IN (".getEntity('societe').")";
164$sql .= " WHERE p.entity IN (".getEntity('product').")";
165if ($sRefSupplier) {
166 $sql .= natural_search('ppf.ref_fourn', $sRefSupplier);
167}
168if (GETPOST('type')) {
169 $sql .= " AND p.fk_product_type = ".GETPOSTINT('type');
170}
171if ($sref) {
172 $sql .= natural_search('p.ref', $sref);
173}
174if ($snom) {
175 $sql .= natural_search('p.label', $snom);
176}
177if ($catid) {
178 $sql .= " AND cp.fk_categorie = ".((int) $catid);
179}
180if ($fourn_id > 0) {
181 $sql .= " AND ppf.fk_soc = ".((int) $fourn_id);
182}
183
184// Add WHERE filters from hooks
185$parameters = array();
186$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters);
187if ($reshook < 0) {
188 setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
189}
190$sql .= $hookmanager->resPrint;
191
192// Count total nb of records
193$nbtotalofrecords = '';
194if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
195 /* The fast and low memory method to get and count full list converts the sql into a sql count */
196 $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql);
197 $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount);
198 $resql = $db->query($sqlforcount);
199 if ($resql) {
200 $objforcount = $db->fetch_object($resql);
201 $nbtotalofrecords = $objforcount->nbtotalofrecords;
202 } else {
203 dol_print_error($db);
204 }
205
206 if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller than the paging size (filtering), goto and load page 0
207 $page = 0;
208 $offset = 0;
209 }
210 $db->free($resql);
211}
212
213// Complete request and execute it with limit
214$sql .= $db->order($sortfield, $sortorder);
215if ($limit) {
216 $sql .= $db->plimit($limit + 1, $offset);
217}
218
219dol_syslog("fourn/product/list.php:", LOG_DEBUG);
220$resql = $db->query($sql);
221if (!$resql) {
222 dol_print_error($db);
223 exit;
224}
225
226$num = $db->num_rows($resql);
227
228$i = 0;
229
230if ($num == 1 && (GETPOST("mode") == 'search')) {
231 $objp = $db->fetch_object($resql);
232 header("Location: ".DOL_URL_ROOT."/product/card.php?id=".$objp->rowid);
233 exit;
234}
235
236if (!empty($supplier->id)) {
237 $title = $langs->trans("ListOfSupplierProductForSupplier", $supplier->name);
238} else {
239 $title = $langs->trans("List");
240}
241
242
243// Output page
244// --------------------------------------------------------------------
245
246llxHeader("", $title, $help_url, '', 0, 0, '', '', '', 'bodyforlist');
247
248$arrayofselected = is_array($toselect) ? $toselect : array();
249
250$param = '';
251if (!empty($mode)) {
252 $param .= '&mode='.urlencode($mode);
253}
254if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
255 $param .= '&contextpage='.urlencode($contextpage);
256}
257if ($limit > 0 && $limit != $conf->liste_limit) {
258 $param .= '&limit='.((int) $limit);
259}
260if ($optioncss != '') {
261 $param .= '&optioncss='.urlencode($optioncss);
262}
263$param = "&sref=".$sref."&snom=".$snom."&fourn_id=".$fourn_id.(isset($type) ? "&amp;type=".$type : "").(empty($sRefSupplier) ? "" : "&amp;srefsupplier=".$sRefSupplier);
264
265$newcardbutton = '';
266$newcardbutton .= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/product/list.php?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $permissiontoadd);
267
268print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'generic', 0, $newcardbutton);
269
270if (!empty($catid)) {
271 print "<div id='ways'>";
272 $c = new Categorie($db);
273 $ways = $c->print_all_ways(' &gt; ', 'fourn/product/list.php');
274 print " &gt; ".$ways[0]."<br>\n";
275 print "</div><br>";
276}
277
278$arrayofmassactions = array(
279 //'generate_doc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"),
280 //'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
281 //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"),
282);
283if (!empty($permissiontodelete)) {
284 $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
285}
286if (GETPOSTINT('nomassaction') || in_array($massaction, array('presend', 'predelete'))) {
287 $arrayofmassactions = array();
288}
289$massactionbutton = $form->selectMassAction('', $arrayofmassactions);
290
291print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n";
292if ($optioncss != '') {
293 print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
294}
295print '<input type="hidden" name="token" value="'.newToken().'">';
296if ($fourn_id > 0) {
297 print '<input type="hidden" name="fourn_id" value="'.$fourn_id.'">';
298}
299print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
300print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
301print '<input type="hidden" name="page" value="'.$page.'">';
302print '<input type="hidden" name="type" value="'.$type.'">';
303
304$topicmail = "Information";
305$modelmail = "product";
306$objecttmp = new Product($db);
307$trackid = 'prod'.$object->id;
308include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
309
310$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
311$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup
312$selectedfields = ($mode != 'kanban' ? $htmlofselectarray : '');
313$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
314
315print '<div class="div-table-responsive-no-min">';
316print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
317
318// Fields title search
319// --------------------------------------------------------------------
320print '<tr class="liste_titre_filter">';
321
322// Action column
323if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
324 print '<td class="liste_titre center maxwidthsearch">';
325 $searchpicto = $form->showFilterButtons('left');
326 print $searchpicto;
327 print '</td>';
328}
329print '<td class="liste_titre">';
330print '<input class="flat maxwidth100" type="text" name="sref" value="'.$sref.'">';
331print '</td>';
332print '<td class="liste_titre">';
333print '<input class="flat maxwidth100" type="text" name="srefsupplier" value="'.$sRefSupplier.'">';
334print '</td>';
335print '<td class="liste_titre">';
336print '<input class="flat maxwidth100" type="text" name="snom" value="'.$snom.'">';
337print '</td>';
338print '<td></td>';
339print '<td></td>';
340print '<td></td>';
341print '<td></td>';
342// add filters from hooks
343$parameters = array();
344$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action);
345if ($reshook < 0) {
346 setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
347}
348print $hookmanager->resPrint;
349// Action column
350if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
351 print '<td class="liste_titre center maxwidthsearch">';
352 $searchpicto = $form->showFilterButtons();
353 print $searchpicto;
354 print '</td>';
355}
356print '</tr>'."\n";
357
358// Fields title label
359// --------------------------------------------------------------------
360print '<tr class="liste_titre">';
361// Action column
362if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
363 print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
364 $totalarray['nbfield']++;
365}
366print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "p.ref", $param, "", "", $sortfield, $sortorder);
367print_liste_field_titre("RefSupplierShort", $_SERVER["PHP_SELF"], "ppf.ref_fourn", $param, "", "", $sortfield, $sortorder);
368print_liste_field_titre("Label", $_SERVER["PHP_SELF"], "p.label", $param, "", "", $sortfield, $sortorder);
369print_liste_field_titre("Supplier", $_SERVER["PHP_SELF"], "ppf.fk_soc", $param, "", "", $sortfield, $sortorder);
370print_liste_field_titre("BuyingPrice", $_SERVER["PHP_SELF"], "ppf.price", $param, "", '', $sortfield, $sortorder, 'right ');
371print_liste_field_titre("QtyMin", $_SERVER["PHP_SELF"], "ppf.quantity", $param, "", '', $sortfield, $sortorder, 'right ');
372print_liste_field_titre("UnitPrice", $_SERVER["PHP_SELF"], "ppf.unitprice", $param, "", '', $sortfield, $sortorder, 'right ');
373// add header cells from hooks
374$parameters = array();
375$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object, $action);
376if ($reshook < 0) {
377 setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
378}
379print $hookmanager->resPrint;
380// Action column
381if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
382 print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
383 $totalarray['nbfield']++;
384}
385print '</tr>'."\n";
386
387// Loop on record
388// --------------------------------------------------------------------
389$i = 0;
390$savnbfield = $totalarray['nbfield'];
391$totalarray = array();
392$totalarray['nbfield'] = 0;
393$imaxinloop = ($limit ? min($num, $limit) : $num);
394while ($i < $imaxinloop) {
395 $objp = $db->fetch_object($resql);
396 if (empty($objp)) {
397 break; // Should not happen
398 }
399
400 $productstatic->id = $objp->rowid;
401 $productstatic->ref = $objp->ref;
402 $productstatic->type = $objp->fk_product_type;
403 $productstatic->entity = $objp->entity;
404 $productstatic->status = $objp->tosell;
405 $productstatic->status_buy = $objp->tobuy;
406 $productstatic->barcode = $objp->barcode;
407 $productstatic->barcode_type = $objp->fk_barcode_type;
408
409 print '<tr data-rowid="'.$object->id.'" class="oddeven">';
410
411 // Action column
412 if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
413 print '<td class="nowrap center">';
414 if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
415 $selected = 0;
416 if (in_array($object->id, $arrayofselected)) {
417 $selected = 1;
418 }
419 print '<input id="cb'.$object->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.'"'.($selected ? ' checked="checked"' : '').'>';
420 }
421 print '</td>';
422 if (!$i) {
423 $totalarray['nbfield']++;
424 }
425 }
426
427 print '<td>';
428 print $productstatic->getNomUrl(1, 'supplier');
429 print '</td>';
430
431 print '<td>'.$objp->ref_fourn.'</td>';
432
433 print '<td>'.$objp->label.'</td>'."\n";
434
435 $companystatic->name = $objp->name;
436 $companystatic->id = $objp->socid;
437 print '<td>';
438 if ($companystatic->id > 0) {
439 print $companystatic->getNomUrl(1, 'supplier');
440 }
441 print '</td>';
442
443 print '<td class="right">'.(isset($objp->price) ? price($objp->price) : '').'</td>';
444
445 print '<td class="right">'.$objp->qty.'</td>';
446
447 print '<td class="right">'.(isset($objp->unitprice) ? price($objp->unitprice) : '').'</td>';
448
449 // add additional columns from hooks
450 $parameters = array();
451 $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $objp, $action);
452 if ($reshook < 0) {
453 setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
454 }
455 print $hookmanager->resPrint;
456
457 // Action column
458 if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
459 print '<td class="nowrap center">';
460 if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
461 $selected = 0;
462 if (in_array($object->id, $arrayofselected)) {
463 $selected = 1;
464 }
465 print '<input id="cb'.$object->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.'"'.($selected ? ' checked="checked"' : '').'>';
466 }
467 print '</td>';
468 if (!$i) {
469 $totalarray['nbfield']++;
470 }
471 }
472
473 print '</tr>'."\n";
474 $i++;
475}
476
477// Show total line
478include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php';
479
480// If no record found
481if ($num == 0) {
482 $colspan = 8;
483 /*foreach ($arrayfields as $key => $val) {
484 if (!empty($val['checked'])) {
485 $colspan++;
486 }
487 }*/
488 print '<tr><td colspan="'.$colspan.'"><span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span></td></tr>';
489}
490
491$db->free($resql);
492
493$parameters = array('arrayfields' => $arrayfields, 'sql' => $sql);
494$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
495print $hookmanager->resPrint;
496
497print '</table>'."\n";
498print '</div>'."\n";
499
500print '</form>'."\n";
501
502
503// End of page
504llxFooter();
505$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 manage categories.
Class to manage standard extra fields.
Class to manage generation of HTML components Only common components must be here.
Class to manage suppliers.
Class to manage products or services.
Class to manage third parties objects (customers, suppliers, prospects...)
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.
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...
price($amount, $form=0, $outlangs='', $trunc=1, $rounding=-1, $forcerounding=-1, $currency_code='')
Function to format a value into an amount for visual output Function used into PDF and HTML pages.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $disablesortlink=0, $tooltip='', $forcenowrapcolumntitle=0)
Get title line of an array.
print_barre_liste($title, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='generic', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $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_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.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
getEntity($element, $shared=1, $currentobject=null)
Get list of entity id to use.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.