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