dolibarr 23.0.3
index.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3 * Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
4 * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
5 * Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
6 * Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
7 * Copyright (C) 2020 Maxime DEMAREST <maxime@indelog.fr>
8 * Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
9 * Copyright (C) 2024-2025 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
31// Load Dolibarr environment
32require '../../main.inc.php';
33require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
34require_once DOL_DOCUMENT_ROOT.'/commande/class/commandestats.class.php';
35require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
36require_once DOL_DOCUMENT_ROOT.'/core/class/html.formorder.class.php';
37require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
38require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
39require_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
40
51
52$mode = GETPOSTISSET("mode") ? GETPOST("mode", 'aZ09') : 'customer';
53
54$hookmanager->initHooks(array('orderstats', 'globalcard'));
55
56$usercanreadcustumerstatistic = $user->hasRight('commande', 'lire');
57$usercanreadsupplierstatistic = $user->hasRight('fournisseur', 'commande', 'lire');
58if (getDolGlobalInt('MAIN_NEED_EXPORT_PERMISSION_TO_READ_STATISTICS')) {
59 $usercanreadcustumerstatistic = $user->hasRight('commande', 'commande', 'export');
60 $usercanreadsupplierstatistic = $user->hasRight('fournisseur', 'commande', 'export');
61}
62if ($mode == 'customer' && !$usercanreadcustumerstatistic) {
64}
65if ($mode == 'supplier' && !$usercanreadsupplierstatistic) {
67}
68
69if ($mode == 'supplier') {
70 $object_status = GETPOST('object_status', 'array:int');
71 $object_status = implode(',', $object_status);
72} else {
73 $object_status = GETPOST('object_status', 'intcomma');
74}
75
76
77$typent_id = GETPOSTINT('typent_id');
78$categ_id = GETPOSTINT('categ_id');
79$select_categ_comande_id=GETPOST('select_categ_comande_id', 'array');
80$userid = GETPOSTINT('userid');
81$socid = GETPOSTINT('socid');
82// Security check
83if ($user->socid > 0) {
84 $action = '';
85 $socid = $user->socid;
86}
87
88$parameters = array();
89$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
90if ($reshook < 0) {
91 setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
92}
93
94$nowyear = (int) dol_print_date(dol_now('gmt'), "%Y", 'gmt');
95$year = GETPOSTINT('year') > 0 ? GETPOSTINT('year') : $nowyear;
96$startyear = $year - (!getDolGlobalInt('MAIN_STATS_GRAPHS_SHOW_N_YEARS') ? 2 : max(1, min(10, getDolGlobalInt('MAIN_STATS_GRAPHS_SHOW_N_YEARS'))));
97$endyear = $year;
98
99// Load translation files required by the page
100$langs->loadLangs(array('orders', 'companies', 'other', 'suppliers'));
101
102
103/*
104 * View
105 */
106
107$form = new Form($db);
108$formorder = new FormOrder($db);
109$formcompany = new FormCompany($db);
110$formother = new FormOther($db);
111
112$picto = 'order';
113$title = $langs->trans("OrdersStatistics");
114$dir = $conf->commande->dir_temp;
115
116if ($mode == 'supplier') {
117 $picto = 'supplier_order';
118 $title = $langs->trans("OrdersStatisticsSuppliers");
119 $dir = $conf->fournisseur->commande->dir_temp;
120}
121
122llxHeader('', $title, '', '', 0, 0, '', '', '', 'mod-order page-stats');
123
124print load_fiche_titre($title, '', $picto);
125
126dol_mkdir($dir);
127
128$stats = new CommandeStats($db, $socid, $mode, ($userid > 0 ? $userid : 0), ($typent_id > 0 ? $typent_id : 0), ($categ_id > 0 ? $categ_id : 0));
129if ($mode == 'customer') {
130 if ($object_status != '' && $object_status >= -1) {
131 $stats->where .= ' AND c.fk_statut IN ('.$db->sanitize($object_status).')';
132 }
133 if (is_array($select_categ_comande_id) && !empty($select_categ_comande_id)) {
134 $stats->from .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_order as cat ON (c.rowid = cat.fk_order)';
135 $stats->where .= ' AND cat.fk_categorie IN ('.$db->sanitize(implode(',', $select_categ_comande_id)).')';
136 }
137}
138if ($mode == 'supplier') {
139 if ($object_status != '' && $object_status >= 0) {
140 $stats->where .= ' AND c.fk_statut IN ('.$db->sanitize($object_status).')';
141 }
142 if (is_array($select_categ_comande_id) && !empty($select_categ_comande_id)) {
143 $stats->from .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_supplier_order as cat ON (c.rowid = cat.fk_supplier_order)';
144 $stats->where .= ' AND cat.fk_categorie IN ('.$db->sanitize(implode(',', $select_categ_comande_id)).')';
145 }
146}
147
148
149// Build graphic number of object
150$data = $stats->getNbByMonthWithPrevYear($endyear, $startyear);
151
152//var_dump($data);
153// $data = array(array('Lib',val1,val2,val3),...)
154
155
156$fileurlnb = '';
157if (!$user->hasRight('societe', 'client', 'voir')) {
158 $filenamenb = $dir.'/ordersnbinyear-'.$user->id.'-'.$year.'.png';
159 if ($mode == 'customer') {
160 $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=ordersnbinyear-'.$user->id.'-'.$year.'.png';
161 }
162 if ($mode == 'supplier') {
163 $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&file=ordersnbinyear-'.$user->id.'-'.$year.'.png';
164 }
165} else {
166 $filenamenb = $dir.'/ordersnbinyear-'.$year.'.png';
167 if ($mode == 'customer') {
168 $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=ordersnbinyear-'.$year.'.png';
169 }
170 if ($mode == 'supplier') {
171 $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&file=ordersnbinyear-'.$year.'.png';
172 }
173}
174
175$px1 = new DolGraph();
176$mesg = $px1->isGraphKo();
177if (!$mesg) {
178 $px1->SetData($data);
179 $i = $startyear;
180 $legend = array();
181 while ($i <= $endyear) {
182 $legend[] = $i;
183 $i++;
184 }
185 $px1->SetLegend($legend);
186 $px1->SetMaxValue($px1->GetCeilMaxValue());
187 $px1->SetMinValue(min(0, $px1->GetFloorMinValue()));
188 $px1->SetWidth($WIDTH);
189 $px1->SetHeight($HEIGHT);
190 $px1->SetYLabel($langs->trans("NbOfOrder"));
191 $px1->SetShading(3);
192 $px1->SetHorizTickIncrement(1);
193 $px1->mode = 'depth';
194 $px1->SetTitle($langs->trans("NumberOfOrdersByMonth"));
195
196 $px1->draw($filenamenb, $fileurlnb);
197}
198
199// Build graphic amount of object
200$data = $stats->getAmountByMonthWithPrevYear($endyear, $startyear);
201//var_dump($data);
202// $data = array(array('Lib',val1,val2,val3),...)
203
204$fileurlamount = '';
205if (!$user->hasRight('societe', 'client', 'voir')) {
206 $filenameamount = $dir.'/ordersamountinyear-'.$user->id.'-'.$year.'.png';
207 if ($mode == 'customer') {
208 $fileurlamount = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=ordersamountinyear-'.$user->id.'-'.$year.'.png';
209 }
210 if ($mode == 'supplier') {
211 $fileurlamount = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&file=ordersamountinyear-'.$user->id.'-'.$year.'.png';
212 }
213} else {
214 $filenameamount = $dir.'/ordersamountinyear-'.$year.'.png';
215 if ($mode == 'customer') {
216 $fileurlamount = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=ordersamountinyear-'.$year.'.png';
217 }
218 if ($mode == 'supplier') {
219 $fileurlamount = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&file=ordersamountinyear-'.$year.'.png';
220 }
221}
222
223$px2 = new DolGraph();
224$mesg = $px2->isGraphKo();
225if (!$mesg) {
226 $px2->SetData($data);
227 $i = $startyear;
228 $legend = array();
229 while ($i <= $endyear) {
230 $legend[] = $i;
231 $i++;
232 }
233 $px2->SetLegend($legend);
234 $px2->SetMaxValue($px2->GetCeilMaxValue());
235 $px2->SetMinValue(min(0, $px2->GetFloorMinValue()));
236 $px2->SetWidth($WIDTH);
237 $px2->SetHeight($HEIGHT);
238 $px2->SetYLabel($langs->trans("AmountOfOrders"));
239 $px2->SetShading(3);
240 $px2->SetHorizTickIncrement(1);
241 $px2->mode = 'depth';
242 $px2->SetTitle($langs->trans("AmountOfOrdersByMonthHT"));
243
244 $px2->draw($filenameamount, $fileurlamount);
245}
246
247
248$data = $stats->getAverageByMonthWithPrevYear($endyear, $startyear);
249
250
251$fileurl_avg = '';
252if (!$user->hasRight('societe', 'client', 'voir')) {
253 $filename_avg = $dir.'/ordersaverage-'.$user->id.'-'.$year.'.png';
254 if ($mode == 'customer') {
255 $fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=ordersaverage-'.$user->id.'-'.$year.'.png';
256 }
257 if ($mode == 'supplier') {
258 $fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&file=ordersaverage-'.$user->id.'-'.$year.'.png';
259 }
260} else {
261 $filename_avg = $dir.'/ordersaverage-'.$year.'.png';
262 if ($mode == 'customer') {
263 $fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=ordersaverage-'.$year.'.png';
264 }
265 if ($mode == 'supplier') {
266 $fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&file=ordersaverage-'.$year.'.png';
267 }
268}
269
270$px3 = new DolGraph();
271$mesg = $px3->isGraphKo();
272if (!$mesg) {
273 $px3->SetData($data);
274 $i = $startyear;
275 $legend = array();
276 while ($i <= $endyear) {
277 $legend[] = $i;
278 $i++;
279 }
280 $px3->SetLegend($legend);
281 $px3->SetYLabel($langs->trans("AmountAverage"));
282 $px3->SetMaxValue($px3->GetCeilMaxValue());
283 $px3->SetMinValue((int) $px3->GetFloorMinValue());
284 $px3->SetWidth($WIDTH);
285 $px3->SetHeight($HEIGHT);
286 $px3->SetShading(3);
287 $px3->SetHorizTickIncrement(1);
288 $px3->mode = 'depth';
289 $px3->SetTitle($langs->trans("AmountAverage"));
290
291 $px3->draw($filename_avg, $fileurl_avg);
292}
293
294
295
296// Show array
297$data = $stats->getAllByYear();
298$arrayyears = array();
299foreach ($data as $val) {
300 if (!empty($val['year'])) {
301 $arrayyears[$val['year']] = $val['year'];
302 }
303}
304if (!count($arrayyears)) {
305 $arrayyears[$nowyear] = $nowyear;
306}
307
308$h = 0;
309$head = array();
310$head[$h][0] = DOL_URL_ROOT.'/commande/stats/index.php?mode='.$mode;
311$head[$h][1] = $langs->trans("ByMonthYear");
312$head[$h][2] = 'byyear';
313$h++;
314
315$type = 'order_stats';
316
317if ($mode == 'supplier') {
318 $type = 'supplier_order_stats';
319}
320
321complete_head_from_modules($conf, $langs, null, $head, $h, $type);
322
323print dol_get_fiche_head($head, 'byyear', '', -1);
324
325
326print '<div class="fichecenter"><div class="fichethirdleft">';
327
328
329// Show filter box
330print '<form name="stats" method="POST" action="'.dolBuildUrl($_SERVER["PHP_SELF"]).'">';
331print '<input type="hidden" name="token" value="'.newToken().'">';
332print '<input type="hidden" name="mode" value="'.$mode.'">';
333
334print '<table class="noborder centpercent">';
335print '<tr class="liste_titre"><td class="liste_titre" colspan="2">'.$langs->trans("Filter").'</td></tr>';
336// Company
337print '<tr><td class="left">'.$langs->trans("ThirdParty").'</td><td class="left">';
338$filter = '';
339if ($mode == 'customer') {
340 $filter = '(s.client:IN:1,2,3)';
341}
342if ($mode == 'supplier') {
343 $filter = '(s.fournisseur:=:1)';
344}
345print img_picto('', 'company', 'class="pictofixedwidth"');
346print $form->select_company($socid, 'socid', $filter, 1, 0, 0, array(), 0, 'widthcentpercentminusx maxwidth300');
347print '</td></tr>';
348// ThirdParty Type
349print '<tr><td>'.$langs->trans("ThirdPartyType").'</td><td>';
350$sortparam_typent = (!getDolGlobalString('SOCIETE_SORT_ON_TYPEENT') ? 'ASC' : $conf->global->SOCIETE_SORT_ON_TYPEENT); // NONE means we keep sort of original array, so we sort on position. ASC, means next function will sort on label.
351print $form->selectarray("typent_id", $formcompany->typent_array(0), $typent_id, 1, 0, 0, '', 0, 0, 0, $sortparam_typent, '', 1);
352if ($user->admin) {
353 print ' '.info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
354}
355print '</td></tr>';
356// Category societe
357$cat_type = 0;
358$cat_label = '';
359if ($mode == 'customer') {
360 $cat_type = Categorie::TYPE_CUSTOMER;
361 $cat_label = $langs->trans("Category").' '.lcfirst($langs->trans("Customer"));
362}
363if ($mode == 'supplier') {
364 $cat_type = Categorie::TYPE_SUPPLIER;
365 $cat_label = $langs->trans("Category").' '.lcfirst($langs->trans("Supplier"));
366}
367print '<tr><td>'.$cat_label.'</td><td>';
368print img_picto('', 'category', 'class="pictofixedwidth"');
369print $formother->select_categories($cat_type, $categ_id, 'categ_id', 0, 1, 'widthcentpercentminusx maxwidth300');
370print '</td></tr>';
371// Category commande
372if (isModEnabled('category')) {
373 $cat_type = '';
374 $cat_label = '';
375 if ($mode == 'customer') {
376 $cat_type = Categorie::TYPE_ORDER;
377 $cat_label = $langs->trans("Category").' '.lcfirst($langs->trans("CustomersOrders"));
378 }
379 if ($mode == 'supplier') {
380 $cat_type = Categorie::TYPE_SUPPLIER_ORDER;
381 $cat_label = $langs->trans("Category").' '.lcfirst($langs->trans("SuppliersOrders"));
382 }
383 print '<tr><td>'.$cat_label.'</td><td>';
384 $cate_arbo = $form->select_all_categories($cat_type, '', 'parent', 0, 0, 1);
385 print img_picto('', 'category', 'class="pictofixedwidth"');
386 print $form->multiselectarray('select_categ_comande_id', $cate_arbo, GETPOST('select_categ_comande_id', 'array'), 0, 0, 'widthcentpercentminusx maxwidth300');
387 //print $formother->select_categories($cat_type, $categ_id, 'categ_id', true);
388 print '</td></tr>';
389}
390// User
391print '<tr><td>'.$langs->trans("CreatedBy").'</td><td>';
392print img_picto('', 'user', 'class="pictofixedwidth"');
393print $form->select_dolusers($userid, 'userid', 1, null, 0, '', '', '0', 0, 0, '', 0, '', 'widthcentpercentminusx maxwidth300');
394// Status
395print '<tr><td>'.$langs->trans("Status").'</td><td>';
396if ($mode == 'customer') {
397 $liststatus = array(
398 Commande::STATUS_DRAFT => $langs->trans("StatusOrderDraft"),
399 Commande::STATUS_VALIDATED => $langs->trans("StatusOrderValidated"),
400 Commande::STATUS_SHIPMENTONPROCESS => $langs->trans("StatusOrderSent"),
401 Commande::STATUS_CLOSED => $langs->trans("StatusOrderDelivered"),
402 Commande::STATUS_CANCELED => $langs->trans("StatusOrderCanceled")
403 );
404 print $form->selectarray('object_status', $liststatus, GETPOST('object_status', 'intcomma'), -4);
405}
406if ($mode == 'supplier') {
407 $formorder->selectSupplierOrderStatus((strstr($object_status, ',') ? -1 : $object_status), 0, 'object_status');
408}
409print '</td></tr>';
410// Year
411print '<tr><td class="left">'.$langs->trans("Year").'</td><td class="left">';
412if (!in_array($year, $arrayyears)) {
413 $arrayyears[$year] = $year;
414}
415if (!in_array($nowyear, $arrayyears)) {
416 $arrayyears[$nowyear] = $nowyear;
417}
418arsort($arrayyears);
419print img_picto('', 'calendar', 'class="pictofixedwidth"');
420print $form->selectarray('year', $arrayyears, $year, 0, 0, 0, '', 0, 0, 0, '', 'width75');
421print '</td></tr>';
422print '<tr><td align="center" colspan="2"><input type="submit" class="button small" name="submit" value="'.$langs->trans("Refresh").'"></td></tr>';
423print '</table>';
424print '</form>';
425print '<br><br>';
426
427
428print '<div class="div-table-responsive-no-min">';
429print '<table class="noborder centpercent">';
430print '<tr class="liste_titre" height="24">';
431print '<td class="center">'.$langs->trans("Year").'</td>';
432print '<td class="right">'.$langs->trans("NbOfOrders").'</td>';
433print '<td class="right">%</td>';
434print '<td class="right">'.$langs->trans("AmountTotal").'</td>';
435print '<td class="right">%</td>';
436print '<td class="right">'.$langs->trans("AmountAverage").'</td>';
437print '<td class="right">%</td>';
438print '</tr>';
439
440$oldyear = 0;
441foreach ($data as $val) {
442 $year = $val['year'];
443 while (!empty($year) && $oldyear > (int) $year + 1) { // If we have empty year
444 $oldyear--;
445
446 print '<tr class="oddeven" height="24">';
447 print '<td align="center"><a href="'.$_SERVER["PHP_SELF"].'?year='.$oldyear.'&amp;mode='.$mode.($socid > 0 ? '&socid='.$socid : '').($userid > 0 ? '&userid='.$userid : '').'">'.$oldyear.'</a></td>';
448 print '<td class="right">0</td>';
449 print '<td class="right"></td>';
450 print '<td class="right">0</td>';
451 print '<td class="right"></td>';
452 print '<td class="right">0</td>';
453 print '<td class="right"></td>';
454 print '</tr>';
455 }
456
457
458 print '<tr class="oddeven" height="24">';
459 print '<td align="center"><a href="'.$_SERVER["PHP_SELF"].'?year='.$year.'&amp;mode='.$mode.($socid > 0 ? '&socid='.$socid : '').($userid > 0 ? '&userid='.$userid : '').'">'.$year.'</a></td>';
460 print '<td class="right">'.$val['nb'].'</td>';
461 print '<td class="right opacitylow" style="'.((!isset($val['nb_diff']) || $val['nb_diff'] >= 0) ? 'color: green;' : 'color: red;').'">'.(isset($val['nb_diff']) ? round($val['nb_diff']) : "0").'%</td>';
462 print '<td class="right">'.price(price2num($val['total'], 'MT'), 1).'</td>';
463 print '<td class="right opacitylow" style="'.((!isset($val['total_diff']) || $val['total_diff'] >= 0) ? 'color: green;' : 'color: red;').'">'.(isset($val['total_diff']) ? round($val['total_diff']) : "0").'%</td>';
464 print '<td class="right">'.price(price2num($val['avg'], 'MT'), 1).'</td>';
465 print '<td class="right opacitylow" style="'.((!isset($val['avg_diff']) || $val['avg_diff'] >= 0) ? 'color: green;' : 'color: red;').'">'.(isset($val['avg_diff']) ? round($val['avg_diff']) : "0").'%</td>';
466 print '</tr>';
467 $oldyear = $year;
468}
469
470print '</table>';
471print '</div>';
472
473
474print '</div><div class="fichetwothirdright">';
475
476
477// Show graphs
478print '<table class="border centpercent"><tr class="pair nohover"><td align="center">';
479if ($mesg) {
480 print $mesg;
481} else {
482 print $px1->show();
483 print "<br>\n";
484 print $px2->show();
485 print "<br>\n";
486 print $px3->show();
487}
488print '</td></tr></table>';
489
490
491print '</div></div>';
492print '<div class="clearboth"></div>';
493
494print dol_get_fiche_end();
495
496// End of page
497llxFooter();
498$db->close();
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
Definition wrapper.php:91
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:73
const STATUS_SHIPMENTONPROCESS
Shipment on process.
const STATUS_CLOSED
Closed (Sent, billed or not)
const STATUS_CANCELED
Canceled status.
const STATUS_DRAFT
Draft status.
const STATUS_VALIDATED
Validated status.
Class to manage order statistics (customer and supplier)
Class to build graphs.
static getDefaultGraphSizeForStats($direction, $defaultsize='')
getDefaultGraphSizeForStats
Class to build HTML component for third parties management Only common components are here.
Class to manage generation of HTML components Only common components must be here.
Class to manage HTML output components for orders Before adding component here, check they are not in...
Class permettant la generation de composants html autre Only common components are here.
dol_now($mode='gmt')
Return date for now.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2, $allowothertags=array())
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.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0, $morecssdiv='')
Show tabs of a record.
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false, $decorate=0)
Output date in a string format according to outputlangs (or langs if not defined).
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='', $morecssonpicto='widthpictotitle')
Load a title with picto.
complete_head_from_modules($conf, $langs, $object, &$head, &$h, $type, $mode='add', $filterorigmodule='')
Complete or removed entries into a head array (used to build tabs).
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
dol_mkdir($dir, $dataroot='', $newmask='')
Creation of a directory (this can create recursive subdir)
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.