dolibarr 24.0.0-beta
myobject_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-2026 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
32$res = 0;
33// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined)
34if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) {
35 $res = @include str_replace("..", "", $_SERVER["CONTEXT_DOCUMENT_ROOT"])."/main.inc.php";
36}
37// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
38$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME'];
39$tmp2 = realpath(__FILE__);
40$i = strlen($tmp) - 1;
41$j = strlen($tmp2) - 1;
42while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) {
43 $i--;
44 $j--;
45}
46if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) {
47 $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php";
48}
49if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) {
50 $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php";
51}
52// Try main.inc.php using relative path
53if (!$res && file_exists("../main.inc.php")) {
54 $res = @include "../main.inc.php";
55}
56if (!$res && file_exists("../../main.inc.php")) {
57 $res = @include "../../main.inc.php";
58}
59if (!$res && file_exists("../../../main.inc.php")) {
60 $res = @include "../../../main.inc.php";
61}
62if (!$res) {
63 die("Include of main fails");
64}
72require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
73require_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
74dol_include_once('/mymodule/class/myobject.class.php');
75dol_include_once('/mymodule/class/myobjectstats.class.php');
76dol_include_once('/mymodule/lib/mymodule_myobject.lib.php');
77
80
81$mode = GETPOSTISSET("mode") ? GETPOST("mode", 'aZ09') : 'statistics';
82
83$userid = GETPOSTINT('userid');
84$categ_id = GETPOSTINT('categ_id');
85
86$hookmanager->initHooks(array('mymodulestats', 'myobjectstats', 'globalcard'));
87
88$objecttype = 'myobject';
89$object = new MyObject($db);
90
91// List of object we want to manage statistics
92$usercanreadstatistic = 1;
93$enablepermissioncheck = getDolGlobalInt('MYMODULE_ENABLE_PERMISSION_CHECK');
94if ($enablepermissioncheck) {
95 $usercanreadstatistic = $user->hasRight($objecttype, 'read');
96 if (getDolGlobalInt('MAIN_NEED_EXPORT_PERMISSION_TO_READ_STATISTICS')) {
97 $usercanreadstatistic = $user->hasRight($objecttype, 'export');
98 }
99}
100
101if (!$usercanreadstatistic) {
103}
104
105// Security check
106$socid = 0;
107if ($user->socid > 0) {
108 $action = '';
109 $socid = $user->socid;
110}
111
112$parameters = array();
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
118$nowyear = (int) dol_print_date(dol_now('gmt'), "%Y", 'gmt');
119$year = GETPOSTINT('year') > 0 ? GETPOSTINT('year') : $nowyear;
120$startyear = $year - (!getDolGlobalInt('MAIN_STATS_GRAPHS_SHOW_N_YEARS') ? 2 : max(1, min(10, getDolGlobalInt('MAIN_STATS_GRAPHS_SHOW_N_YEARS'))));
121$endyear = $year;
122
123// Load translation files required by the page
124$langs->loadLangs(array('companies', 'other', 'mymodule@mymodule'));
125
126
127/*
128 * View
129 */
130
131$form = new Form($db);
132
133$title = $langs->trans("Statistics");
134$dir = getMultidirTemp($object);
135
136llxHeader('', $title, '', '', 0, 0, '', '', '', 'mod-order page-stats');
137
138$permissiontoadd = 1;
139$param = '';
140$newcardbutton = '';
141$newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', dol_buildpath('/mymodule/myobject_list.php', 1).'?mode=common'.preg_replace('/(&|\?)*(mode|groupby)=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss' => 'reposition'));
142$newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', dol_buildpath('/mymodule/myobject_list.php', 1).'?mode=kanban'.preg_replace('/(&|\?)*(mode|groupby)=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss' => 'reposition'));
143//$newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanbanGroupBy'), '', 'fa fa-grip-vertical imgforviewmode', dol_buildpath('/mymodule/aaa_index.php', 1).'?mode=kanbangroupby&groupby=p.fk_opp_status'.preg_replace('/(&|\?)*(mode|groupby)=[^&]+/', '', $param), '', ($mode == 'kanbangroupby' ? 2 : 1), array('morecss' => 'reposition'));
144//$newcardbutton .= dolGetButtonTitle($langs->trans('HierarchicView'), '', 'fa fa-stream paddingleft imgforviewmode', dol_buildpath('/mymodule/aaa_index.php', 1).'?mode=hierarchy'.preg_replace('/(&|\?)*(mode|groupby)=[^&]+/', '', $param), '', (($mode == 'hierarchy') ? 2 : 1), array('morecss' => 'reposition'));
145$newcardbutton .= dolGetButtonTitle($langs->trans('Statistics'), '', 'fa fa-chart-bar imgforviewmode', dol_buildpath('/mymodule/stats/mymodule_index.php', 1).'?mode=statistics&objecttype=myobject@mymodule'.preg_replace('/(&|\?)*(mode|groupby)=[^&]+/', '', $param), '', ($mode == 'statistics' ? 2 : 1), array('morecss' => 'reposition'));
146$newcardbutton .= dolGetButtonTitleSeparator();
147$newcardbutton .= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', dol_buildpath('/mymodule/myobject_card.php', 1).'?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $permissiontoadd);
148
149$param = '';
150$page = 0;
151$sortfield = '';
152$sortorder = '';
153$massactionbutton = '';
154$num = 0;
155$nbtotalofrecords = 0;
156$limit = 0;
157
158print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, $object->picto, 0, $newcardbutton, '', $limit, 0, 0, 1);
159
160
161//print load_fiche_titre($title, '', $picto);
162
163dol_mkdir($dir);
164
165$stats = new MyObjectStats($db, $socid, $mode, ($userid > 0 ? $userid : 0), ($categ_id > 0 ? $categ_id : 0));
166
167
168// Build graphic number of object
169$data = $stats->getNbByMonthWithPrevYear($endyear, $startyear);
170
171
172$filenamenb = $dir.'/myobjectnbinyear-'.$user->id.'-'.$year.'.png';
173$fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=ordersnbinyear-'.$user->id.'-'.$year.'.png';
174
175
176$px1 = new DolGraph();
177$displaypx1 = false;
178$mesg = $px1->isGraphKo();
179if (!$mesg) {
180 $displaypx1 = true;
181 $px1->SetData($data);
182 $i = $startyear;
183 $legend = array();
184 while ($i <= $endyear) {
185 $legend[] = $i;
186 $i++;
187 }
188 $px1->SetLegend($legend);
189 $px1->SetMaxValue($px1->GetCeilMaxValue());
190 $px1->SetMinValue(min(0, $px1->GetFloorMinValue()));
191 $px1->SetWidth($WIDTH);
192 $px1->SetHeight($HEIGHT);
193 $px1->SetYLabel($langs->trans("Nb"));
194 $px1->SetShading(3);
195 $px1->SetHorizTickIncrement(1);
196 $px1->mode = 'depth';
197 $px1->SetTitle($langs->trans("ByMonth"));
198
199 $px1->draw($filenamenb, $fileurlnb);
200}
201
202
203/*
204
205// Build graphic amount of object
206$data = $stats->getAmountByMonthWithPrevYear($endyear, $startyear);
207//var_dump($data);
208// $data = array(array('Lib',val1,val2,val3),...)
209
210$fileurlamount = '';
211if (!$user->hasRight('societe', 'client', 'voir')) {
212 $filenameamount = $dir.'/ordersamountinyear-'.$user->id.'-'.$year.'.png';
213 if ($mode == 'customer') {
214 $fileurlamount = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=ordersamountinyear-'.$user->id.'-'.$year.'.png';
215 }
216 if ($mode == 'supplier') {
217 $fileurlamount = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&file=ordersamountinyear-'.$user->id.'-'.$year.'.png';
218 }
219} else {
220 $filenameamount = $dir.'/ordersamountinyear-'.$year.'.png';
221 if ($mode == 'customer') {
222 $fileurlamount = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=ordersamountinyear-'.$year.'.png';
223 }
224 if ($mode == 'supplier') {
225 $fileurlamount = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&file=ordersamountinyear-'.$year.'.png';
226 }
227}
228
229$px2 = new DolGraph();
230$displaypx2 = false;
231$mesg = $px2->isGraphKo();
232if (!$mesg) {
233 $displaypx2 = true;
234 $px2->SetData($data);
235 $i = $startyear;
236 $legend = array();
237 while ($i <= $endyear) {
238 $legend[] = $i;
239 $i++;
240 }
241 $px2->SetLegend($legend);
242 $px2->SetMaxValue($px2->GetCeilMaxValue());
243 $px2->SetMinValue(min(0, $px2->GetFloorMinValue()));
244 $px2->SetWidth($WIDTH);
245 $px2->SetHeight($HEIGHT);
246 $px2->SetYLabel($langs->trans("AmountOfOrders"));
247 $px2->SetShading(3);
248 $px2->SetHorizTickIncrement(1);
249 $px2->mode = 'depth';
250 $px2->SetTitle($langs->trans("AmountOfOrdersByMonthHT"));
251
252 $px2->draw($filenameamount, $fileurlamount);
253}
254
255
256
257$data = $stats->getAverageByMonthWithPrevYear($endyear, $startyear);
258
259
260$fileurl_avg = '';
261if (!$user->hasRight('societe', 'client', 'voir')) {
262 $filename_avg = $dir.'/ordersaverage-'.$user->id.'-'.$year.'.png';
263 if ($mode == 'customer') {
264 $fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=ordersaverage-'.$user->id.'-'.$year.'.png';
265 }
266 if ($mode == 'supplier') {
267 $fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&file=ordersaverage-'.$user->id.'-'.$year.'.png';
268 }
269} else {
270 $filename_avg = $dir.'/ordersaverage-'.$year.'.png';
271 if ($mode == 'customer') {
272 $fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=ordersaverage-'.$year.'.png';
273 }
274 if ($mode == 'supplier') {
275 $fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&file=ordersaverage-'.$year.'.png';
276 }
277}
278
279$px3 = new DolGraph();
280$displaypx3 = false;
281$mesg = $px3->isGraphKo();
282if (!$mesg) {
283 $displaypx3 = true;
284 $px3->SetData($data);
285 $i = $startyear;
286 $legend = array();
287 while ($i <= $endyear) {
288 $legend[] = $i;
289 $i++;
290 }
291 $px3->SetLegend($legend);
292 $px3->SetYLabel($langs->trans("AmountAverage"));
293 $px3->SetMaxValue($px3->GetCeilMaxValue());
294 $px3->SetMinValue((int) $px3->GetFloorMinValue());
295 $px3->SetWidth($WIDTH);
296 $px3->SetHeight($HEIGHT);
297 $px3->SetShading(3);
298 $px3->SetHorizTickIncrement(1);
299 $px3->mode = 'depth';
300 $px3->SetTitle($langs->trans("AmountAverage"));
301
302 $px3->draw($filename_avg, $fileurl_avg);
303}
304
305*/
306
307
308// Show array
309$data = $stats->getAllByYear();
310$arrayyears = array();
311foreach ($data as $val) {
312 if (!empty($val['year'])) {
313 $arrayyears[$val['year']] = $val['year'];
314 }
315}
316if (!count($arrayyears)) {
317 $arrayyears[$nowyear] = $nowyear;
318}
319
320
321
322$h = 0;
323$head = array();
324$head[$h][0] = $_SERVER["PHP_SELF"].'?mode='.$mode;
325$head[$h][1] = $langs->trans("ByMonthYear");
326$head[$h][2] = 'byyear';
327$h++;
328
329$type = 'myobject_stats';
330
331complete_head_from_modules($conf, $langs, null, $head, $h, $type);
332
333print dol_get_fiche_head($head, 'byyear', '', -1);
334
335print '<div class="fichecenter"><div class="fichethirdleft">';
336
337
338// Show filter box
339print '<form name="stats" method="POST" action="'.dolBuildUrl($_SERVER["PHP_SELF"]).'">';
340print '<input type="hidden" name="token" value="'.newToken().'">';
341print '<input type="hidden" name="mode" value="'.$mode.'">';
342
343print '<table class="noborder centpercent">';
344print '<tr class="liste_titre"><td class="liste_titre" colspan="2">'.$langs->trans("Filter").'</td></tr>';
345// Company
346/*
347print '<tr><td class="left">'.$langs->trans("ThirdParty").'</td><td class="left">';
348$filter = '';
349if ($mode == 'customer') {
350 $filter = '(s.client:IN:1,2,3)';
351}
352if ($mode == 'supplier') {
353 $filter = '(s.fournisseur:=:1)';
354}
355print img_picto('', 'company', 'class="pictofixedwidth"');
356print $form->select_company($socid, 'socid', $filter, 1, 0, 0, array(), 0, 'widthcentpercentminusx maxwidth300');
357print '</td></tr>';
358*/
359// User
360if (array_key_exists('fk_user_creat', $object->fields)) {
361 print '<tr><td>'.$langs->trans("CreatedBy").'</td><td>';
362 print img_picto('', 'user', 'class="pictofixedwidth"');
363 print $form->select_dolusers($userid, 'userid', 1, null, 0, '', '', '0', 0, 0, '', 0, '', 'widthcentpercentminusx maxwidth300');
364}
365// Status
366if (array_key_exists('status', $object->fields)) {
367 print '<tr><td>'.$langs->trans("Status").'</td><td>';
368 $liststatus = $object->fields['status']['arrayofkeyvalue'];
369 print $form->selectarray('object_status', $liststatus, GETPOST('object_status', 'intcomma'), -4);
370 print '</td></tr>';
371}
372// Year
373print '<tr><td class="left">'.$langs->trans("Year").'</td><td class="left">';
374if (!in_array($year, $arrayyears)) {
375 $arrayyears[$year] = $year;
376}
377if (!in_array($nowyear, $arrayyears)) {
378 $arrayyears[$nowyear] = $nowyear;
379}
380arsort($arrayyears);
381print img_picto('', 'calendar', 'class="pictofixedwidth"');
382print $form->selectarray('year', $arrayyears, $year, 0, 0, 0, '', 0, 0, 0, '', 'width75');
383print '</td></tr>';
384print '<tr><td align="center" colspan="2"><input type="submit" class="button small" name="submit" value="'.$langs->trans("Refresh").'"></td></tr>';
385print '</table>';
386print '</form>';
387print '<br><br>';
388
389
390print '<div class="div-table-responsive-no-min">';
391print '<table class="noborder centpercent">';
392print '<tr class="liste_titre" height="24">';
393print '<td class="center">'.$langs->trans("Year").'</td>';
394print '<td class="right">'.$langs->trans("NbOfOrders").'</td>';
395print '<td class="right">%</td>';
396print '<td class="right">'.$langs->trans("AmountTotal").'</td>';
397print '<td class="right">%</td>';
398print '<td class="right">'.$langs->trans("AmountAverage").'</td>';
399print '<td class="right">%</td>';
400print '</tr>';
401
402$oldyear = 0;
403foreach ($data as $val) {
404 $year = $val['year'];
405 while (!empty($year) && $oldyear > (int) $year + 1) { // If we have empty year
406 $oldyear--;
407
408 print '<tr class="oddeven" height="24">';
409 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>';
410 print '<td class="right">0</td>';
411 print '<td class="right"></td>';
412 print '<td class="right">0</td>';
413 print '<td class="right"></td>';
414 print '<td class="right">0</td>';
415 print '<td class="right"></td>';
416 print '</tr>';
417 }
418
419
420 print '<tr class="oddeven" height="24">';
421 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>';
422 print '<td class="right">'.$val['nb'].'</td>';
423 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>';
424 print '<td class="right">'.price(price2num($val['total'], 'MT'), 1).'</td>';
425 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>';
426 print '<td class="right">'.price(price2num($val['avg'], 'MT'), 1).'</td>';
427 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>';
428 print '</tr>';
429 $oldyear = $year;
430}
431
432print '</table>';
433print '</div>';
434
435
436print '</div><div class="fichetwothirdright">';
437
438
439// Show graphs
440print '<table class="border centpercent"><tr class="pair nohover"><td align="center">';
441if ($mesg) {
442 print $mesg;
443} else {
444 if ($displaypx1) {
445 print $px1->show();
446 print "<br>\n";
447 }
448 /*
449 if ($displaypx2) {
450 print $px2->show();
451 print "<br>\n";
452 }
453 if ($displaypx3) {
454 print $px3->show();
455 print "<br>\n";
456 }
457 */
458}
459print '</td></tr></table>';
460
461
462print '</div></div>';
463print '<div class="clearboth"></div>';
464
465
466print dol_get_fiche_end();
467
468// End of page
469llxFooter();
470$db->close();
if(! $sortfield) if(! $sortorder) $object
Definition account.php:100
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
Class to build graphs.
static getDefaultGraphSizeForStats($direction, $defaultsize='')
getDefaultGraphSizeForStats
Class to manage generation of HTML components Only common components must be here.
Class for MyObject.
Class to manage order statistics (customer and supplier)
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $conf
The main.inc.php has been included so the following variable are now defined:
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $db
API class for accounts.
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.
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, $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 '.
getMultidirTemp($object, $module='', $forobject=0)
Return the full path of the directory where a module (or an object of a module) stores its temporary ...
dol_get_fiche_end($notab=0)
Return tab footer of a card.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
if(!function_exists( 'dol_getprefix')) dol_include_once($relpath, $classname='')
Make an include_once using default root and alternate root if it fails.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
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).
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).
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.