dolibarr 19.0.3
index.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2001-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3 * Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
4 * Copyright (C) 2005-2014 Regis Houssin <regis.houssin@inodbox.com>
5 * Copyright (C) 2014-2016 Charlie BENKE <charlie@patas-monkey.com>
6 * Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
7 * Copyright (C) 2019 Pierre Ardoin <mapiolca@me.com>
8 * Copyright (C) 2019-2021 Frédéric France <frederic.france@netlogic.fr>
9 * Copyright (C) 2019 Nicolas ZABOURI <info@inovea-conseil.com>
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.'/core/lib/date.lib.php';
36require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
37
38$type = GETPOST("type", 'int');
39if ($type == '' && !$user->hasRight('produit', 'lire') && $user->hasRight('service', 'lire')) {
40 $type = '1'; // Force global page on service page only
41}
42if ($type == '' && !$user->hasRight('service', 'lire') && $user->hasRight('produit', 'lire')) {
43 $type = '0'; // Force global page on product page only
44}
45
46// Load translation files required by the page
47$langs->loadLangs(array('products', 'stocks'));
48
49// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array of hooks
50$hookmanager->initHooks(array('productindex'));
51
52// Initialize objects
53$product_static = new Product($db);
54
55// Security check
56if ($type == '0') {
57 $result = restrictedArea($user, 'produit');
58} elseif ($type == '1') {
59 $result = restrictedArea($user, 'service');
60} else {
61 $result = restrictedArea($user, 'produit|service|expedition|reception');
62}
63
64
65/*
66 * View
67 */
68
69$transAreaType = $langs->trans("ProductsAndServicesArea");
70
71$helpurl = '';
72if (!isset($_GET["type"])) {
73 $transAreaType = $langs->trans("ProductsAndServicesArea");
74 $helpurl = 'EN:Module_Products|FR:Module_Produits|ES:M&oacute;dulo_Productos';
75}
76if ((isset($_GET["type"]) && $_GET["type"] == 0) || !isModEnabled("service")) {
77 $transAreaType = $langs->trans("ProductsArea");
78 $helpurl = 'EN:Module_Products|FR:Module_Produits|ES:M&oacute;dulo_Productos';
79}
80if ((isset($_GET["type"]) && $_GET["type"] == 1) || !isModEnabled("product")) {
81 $transAreaType = $langs->trans("ServicesArea");
82 $helpurl = 'EN:Module_Services_En|FR:Module_Services|ES:M&oacute;dulo_Servicios';
83}
84
85llxHeader("", $langs->trans("ProductsAndServices"), $helpurl);
86
87$linkback = "";
88print load_fiche_titre($transAreaType, $linkback, 'product');
89
90
91print '<div class="fichecenter"><div class="fichethirdleft">';
92
93
94if (getDolGlobalString('MAIN_SEARCH_FORM_ON_HOME_AREAS')) { // This may be useless due to the global search combo
95 // Search contract
96 if ((isModEnabled("product") || isModEnabled("service")) && ($user->hasRight('produit', 'lire') || $user->hasRight('service', 'lire'))) {
97 $listofsearchfields['search_product'] = array('text'=>'ProductOrService');
98 }
99
100 if (count($listofsearchfields)) {
101 print '<form method="post" action="'.DOL_URL_ROOT.'/core/search.php">';
102 print '<input type="hidden" name="token" value="'.newToken().'">';
103 print '<div class="div-table-responsive-no-min">';
104 print '<table class="noborder nohover centpercent">';
105 $i = 0;
106 foreach ($listofsearchfields as $key => $value) {
107 if ($i == 0) {
108 print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("Search").'</td></tr>';
109 }
110 print '<tr class="oddeven">';
111 print '<td class="nowrap"><label for="'.$key.'">'.$langs->trans($value["text"]).'</label></td>';
112 print '<td><input type="text" class="flat inputsearch" name="'.$key.'" id="'.$key.'" size="18"></td>';
113 if ($i == 0) {
114 print '<td rowspan="'.count($listofsearchfields).'"><input type="submit" value="'.$langs->trans("Search").'" class="button"></td>';
115 }
116 print '</tr>';
117 $i++;
118 }
119 print '</table>';
120 print '</div>';
121 print '</form>';
122 print '<br>';
123 }
124}
125
126/*
127 * Number of products and/or services
128 */
129if ((isModEnabled("product") || isModEnabled("service")) && ($user->hasRight("produit", "lire") || $user->hasRight("service", "lire"))) {
130 $prodser = array();
131 $prodser[0][0] = $prodser[0][1] = $prodser[0][2] = $prodser[0][3] = 0;
132 $prodser[0]['sell'] = 0;
133 $prodser[0]['buy'] = 0;
134 $prodser[0]['none'] = 0;
135 $prodser[1][0] = $prodser[1][1] = $prodser[1][2] = $prodser[1][3] = 0;
136 $prodser[1]['sell'] = 0;
137 $prodser[1]['buy'] = 0;
138 $prodser[1]['none'] = 0;
139
140 $sql = "SELECT COUNT(p.rowid) as total, p.fk_product_type, p.tosell, p.tobuy";
141 $sql .= " FROM ".MAIN_DB_PREFIX."product as p";
142 $sql .= ' WHERE p.entity IN ('.getEntity($product_static->element, 1).')';
143 // Add where from hooks
144 $parameters = array();
145 $reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $product_static); // Note that $action and $object may have been modified by hook
146 $sql .= $hookmanager->resPrint;
147 $sql .= " GROUP BY p.fk_product_type, p.tosell, p.tobuy";
148 $result = $db->query($sql);
149 while ($objp = $db->fetch_object($result)) {
150 $status = 3; // On sale + On purchase
151 if (!$objp->tosell && !$objp->tobuy) {
152 $status = 0; // Not on sale, not on purchase
153 }
154 if ($objp->tosell && !$objp->tobuy) {
155 $status = 1; // On sale only
156 }
157 if (!$objp->tosell && $objp->tobuy) {
158 $status = 2; // On purchase only
159 }
160 $prodser[$objp->fk_product_type][$status] = $objp->total;
161 if ($objp->tosell) {
162 $prodser[$objp->fk_product_type]['sell'] += $objp->total;
163 }
164 if ($objp->tobuy) {
165 $prodser[$objp->fk_product_type]['buy'] += $objp->total;
166 }
167 if (!$objp->tosell && !$objp->tobuy) {
168 $prodser[$objp->fk_product_type]['none'] += $objp->total;
169 }
170 }
171
172 if ($conf->use_javascript_ajax) {
173 print '<div class="div-table-responsive-no-min">';
174 print '<table class="noborder centpercent">';
175 print '<tr class="liste_titre"><th>'.$langs->trans("Statistics").'</th></tr>';
176 print '<tr><td class="center nopaddingleftimp nopaddingrightimp">';
177
178 $SommeA = $prodser[0]['sell'];
179 $SommeB = $prodser[0]['buy'];
180 $SommeC = $prodser[0]['none'];
181 $SommeD = $prodser[1]['sell'];
182 $SommeE = $prodser[1]['buy'];
183 $SommeF = $prodser[1]['none'];
184 $total = 0;
185 $dataval = array();
186 $datalabels = array();
187 $i = 0;
188
189 $total = $SommeA + $SommeB + $SommeC + $SommeD + $SommeE + $SommeF;
190 $dataseries = array();
191 if (isModEnabled("product")) {
192 $dataseries[] = array($langs->transnoentitiesnoconv("ProductsOnSale"), round($SommeA));
193 $dataseries[] = array($langs->transnoentitiesnoconv("ProductsOnPurchase"), round($SommeB));
194 $dataseries[] = array($langs->transnoentitiesnoconv("ProductsNotOnSell"), round($SommeC));
195 }
196 if (isModEnabled("service")) {
197 $dataseries[] = array($langs->transnoentitiesnoconv("ServicesOnSale"), round($SommeD));
198 $dataseries[] = array($langs->transnoentitiesnoconv("ServicesOnPurchase"), round($SommeE));
199 $dataseries[] = array($langs->transnoentitiesnoconv("ServicesNotOnSell"), round($SommeF));
200 }
201 include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
202 $dolgraph = new DolGraph();
203 $dolgraph->SetData($dataseries);
204 $dolgraph->setShowLegend(2);
205 $dolgraph->setShowPercent(0);
206 $dolgraph->SetType(array('pie'));
207 $dolgraph->setHeight('200');
208 $dolgraph->draw('idgraphstatus');
209 print $dolgraph->show($total ? 0 : 1);
210
211 print '</td></tr>';
212 print '</table>';
213 print '</div>';
214 }
215}
216
217
218if (isModEnabled('categorie') && getDolGlobalString('CATEGORY_GRAPHSTATS_ON_PRODUCTS')) {
219 require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
220 print '<br>';
221 print '<div class="div-table-responsive-no-min">';
222 print '<table class="noborder centpercent">';
223 print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("Categories").'</th></tr>';
224 print '<tr><td class="center" colspan="2">';
225 $sql = "SELECT c.label, count(*) as nb";
226 $sql .= " FROM ".MAIN_DB_PREFIX."categorie_product as cs";
227 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."categorie as c ON cs.fk_categorie = c.rowid";
228 $sql .= " WHERE c.type = 0";
229 $sql .= " AND c.entity IN (".getEntity('category').")";
230 $sql .= " GROUP BY c.label";
231 $sql .= " ORDER BY nb desc";
232 $total = 0;
233 $result = $db->query($sql);
234 if ($result) {
235 $num = $db->num_rows($result);
236 $i = 0;
237 if (!empty($conf->use_javascript_ajax)) {
238 $dataseries = array();
239 $rest = 0;
240 $nbmax = 10;
241 while ($i < $num) {
242 $obj = $db->fetch_object($result);
243 if ($i < $nbmax) {
244 $dataseries[] = array($obj->label, round($obj->nb));
245 } else {
246 $rest += $obj->nb;
247 }
248 $total += $obj->nb;
249 $i++;
250 }
251 if ($i > $nbmax) {
252 $dataseries[] = array($langs->transnoentitiesnoconv("Other"), round($rest));
253 }
254
255 include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
256 $dolgraph = new DolGraph();
257 $dolgraph->SetData($dataseries);
258 $dolgraph->setShowLegend(2);
259 $dolgraph->setShowPercent(1);
260 $dolgraph->SetType(array('pie'));
261 $dolgraph->setHeight('200');
262 $dolgraph->draw('idstatscategproduct');
263 print $dolgraph->show($total ? 0 : 1);
264 } else {
265 while ($i < $num) {
266 $obj = $db->fetch_object($result);
267
268 print '<tr><td>'.$obj->label.'</td><td>'.$obj->nb.'</td></tr>';
269 $total += $obj->nb;
270 $i++;
271 }
272 }
273 }
274 print '</td></tr>';
275 print '<tr class="liste_total"><td>'.$langs->trans("Total").'</td><td class="right">';
276 print $total;
277 print '</td></tr>';
278 print '</table>';
279 print '</div>';
280}
281print '</div><div class="fichetwothirdright">';
282
283
284/*
285 * Latest modified products
286 */
287if ((isModEnabled("product") || isModEnabled("service")) && ($user->hasRight("produit", "lire") || $user->hasRight("service", "lire"))) {
288 $max = 15;
289 $sql = "SELECT p.rowid, p.label, p.price, p.ref, p.fk_product_type, p.tosell, p.tobuy, p.tobatch, p.fk_price_expression,";
290 $sql .= " p.entity,";
291 $sql .= " p.tms as datem";
292 $sql .= " FROM ".MAIN_DB_PREFIX."product as p";
293 $sql .= " WHERE p.entity IN (".getEntity($product_static->element, 1).")";
294 if ($type != '') {
295 $sql .= " AND p.fk_product_type = ".((int) $type);
296 }
297 // Add where from hooks
298 $parameters = array();
299 $reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $product_static); // Note that $action and $object may have been modified by hook
300 $sql .= $hookmanager->resPrint;
301 $sql .= $db->order("p.tms", "DESC");
302 $sql .= $db->plimit($max, 0);
303
304 //print $sql;
305 $result = $db->query($sql);
306 if ($result) {
307 $num = $db->num_rows($result);
308
309 $i = 0;
310
311 if ($num > 0) {
312 $transRecordedType = $langs->trans("LastModifiedProductsAndServices", $max);
313 if (isset($_GET["type"]) && $_GET["type"] == 0) {
314 $transRecordedType = $langs->trans("LastRecordedProducts", $max);
315 }
316 if (isset($_GET["type"]) && $_GET["type"] == 1) {
317 $transRecordedType = $langs->trans("LastRecordedServices", $max);
318 }
319
320 print '<div class="div-table-responsive-no-min">';
321 print '<table class="noborder centpercent">';
322
323 $colnb = 2;
324 if (!getDolGlobalString('PRODUIT_MULTIPRICES')) {
325 $colnb++;
326 }
327
328 print '<tr class="liste_titre"><th colspan="'.$colnb.'">'.$transRecordedType.'</th>';
329 print '<th class="right" colspan="3"><a href="'.DOL_URL_ROOT.'/product/list.php?sortfield=p.tms&sortorder=DESC">'.$langs->trans("FullList").'</td>';
330 print '</tr>';
331
332 while ($i < $num) {
333 $objp = $db->fetch_object($result);
334
335 $product_static->id = $objp->rowid;
336 $product_static->ref = $objp->ref;
337 $product_static->label = $objp->label;
338 $product_static->type = $objp->fk_product_type;
339 $product_static->entity = $objp->entity;
340 $product_static->status = $objp->tosell;
341 $product_static->status_buy = $objp->tobuy;
342 $product_static->status_batch = $objp->tobatch;
343
344 $usercancreadprice = getDolGlobalString('MAIN_USE_ADVANCED_PERMS') ? $user->hasRight('product', 'product_advance', 'read_prices') : $user->hasRight('product', 'read');
345 if ($product_static->isService()) {
346 $usercancreadprice = getDolGlobalString('MAIN_USE_ADVANCED_PERMS') ? $user->hasRight('service', 'service_advance', 'read_prices') : $user->hasRight('service', 'read');
347 }
348
349 // Multilangs
350 if (getDolGlobalInt('MAIN_MULTILANGS')) {
351 $sql = "SELECT label";
352 $sql .= " FROM ".MAIN_DB_PREFIX."product_lang";
353 $sql .= " WHERE fk_product = ".((int) $objp->rowid);
354 $sql .= " AND lang = '".$db->escape($langs->getDefaultLang())."'";
355
356 $resultd = $db->query($sql);
357 if ($resultd) {
358 $objtp = $db->fetch_object($resultd);
359 if ($objtp && $objtp->label != '') {
360 $objp->label = $objtp->label;
361 }
362 }
363 }
364
365
366 print '<tr class="oddeven">';
367 print '<td class="nowraponall tdoverflowmax100">';
368 print $product_static->getNomUrl(1, '', 16);
369 print "</td>\n";
370 print '<td class="tdoverflowmax200" title="'.dol_escape_htmltag($objp->label).'">'.dol_escape_htmltag($objp->label).'</td>';
371 print '<td title="'.dol_escape_htmltag($langs->trans("DateModification").': '.dol_print_date($db->jdate($objp->datem), 'dayhour', 'tzuserrel')).'">';
372 print dol_print_date($db->jdate($objp->datem), 'day', 'tzuserrel');
373 print "</td>";
374 // Sell price
375 if (!getDolGlobalString('PRODUIT_MULTIPRICES')) {
376 if (isModEnabled('dynamicprices') && !empty($objp->fk_price_expression)) {
377 $product = new Product($db);
378 $product->fetch($objp->rowid);
379
380 require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
381 $priceparser = new PriceParser($db);
382 $price_result = $priceparser->parseProduct($product);
383 if ($price_result >= 0) {
384 $objp->price = $price_result;
385 }
386 }
387 print '<td class="nowraponall amount right">';
388 if ($usercancreadprice) {
389 if (isset($objp->price_base_type) && $objp->price_base_type == 'TTC') {
390 print price($objp->price_ttc).' '.$langs->trans("TTC");
391 } else {
392 print price($objp->price).' '.$langs->trans("HT");
393 }
394 }
395 print '</td>';
396 }
397 print '<td class="right nowrap width25"><span class="statusrefsell">';
398 print $product_static->LibStatut($objp->tosell, 3, 0);
399 print "</span></td>";
400 print '<td class="right nowrap width25"><span class="statusrefbuy">';
401 print $product_static->LibStatut($objp->tobuy, 3, 1);
402 print "</span></td>";
403 print "</tr>\n";
404 $i++;
405 }
406
407 $db->free($result);
408
409 print "</table>";
410 print '</div>';
411 print '<br>';
412 }
413 } else {
414 dol_print_error($db);
415 }
416}
417
418
419// TODO Move this into a page that should be available into menu "accountancy - report - turnover - per quarter"
420// Also method used for counting must provide the 2 possible methods like done by all other reports into menu "accountancy - report - turnover":
421// "commitment engagment" method and "cash accounting" method
422if (isModEnabled("invoice") && $user->hasRight('facture', 'lire') && getDolGlobalString('MAIN_SHOW_PRODUCT_ACTIVITY_TRIM')) {
423 if (isModEnabled("product")) {
424 activitytrim(0);
425 }
426 if (isModEnabled("service")) {
427 activitytrim(1);
428 }
429}
430
431
432print '</div></div>';
433
434$parameters = array('type' => $type, 'user' => $user);
435$reshook = $hookmanager->executeHooks('dashboardProductsServices', $parameters, $product_static); // Note that $action and $object may have been modified by hook
436
437// End of page
438llxFooter();
439$db->close();
440
441
448function activitytrim($product_type)
449{
450 global $conf, $langs, $db;
451
452 // We display the last 3 years
453 $yearofbegindate = date('Y', dol_time_plus_duree(time(), -3, "y"));
454
455 // breakdown by quarter
456 $sql = "SELECT DATE_FORMAT(p.datep,'%Y') as annee, DATE_FORMAT(p.datep,'%m') as mois, SUM(fd.total_ht) as Mnttot";
457 $sql .= " FROM ".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."facturedet as fd";
458 $sql .= " , ".MAIN_DB_PREFIX."paiement as p,".MAIN_DB_PREFIX."paiement_facture as pf";
459 $sql .= " WHERE f.entity IN (".getEntity('invoice').")";
460 $sql .= " AND f.rowid = fd.fk_facture";
461 $sql .= " AND pf.fk_facture = f.rowid";
462 $sql .= " AND pf.fk_paiement = p.rowid";
463 $sql .= " AND fd.product_type = ".((int) $product_type);
464 $sql .= " AND p.datep >= '".$db->idate(dol_get_first_day($yearofbegindate), 1)."'";
465 $sql .= " GROUP BY annee, mois ";
466 $sql .= " ORDER BY annee, mois ";
467
468 $result = $db->query($sql);
469 if ($result) {
470 $tmpyear = 0;
471 $trim1 = 0;
472 $trim2 = 0;
473 $trim3 = 0;
474 $trim4 = 0;
475 $lgn = 0;
476 $num = $db->num_rows($result);
477
478 if ($num > 0) {
479 print '<div class="div-table-responsive-no-min">';
480 print '<table class="noborder" width="75%">';
481
482 if ($product_type == 0) {
483 print '<tr class="liste_titre"><td class=left>'.$langs->trans("ProductSellByQuarterHT").'</td>';
484 } else {
485 print '<tr class="liste_titre"><td class=left>'.$langs->trans("ServiceSellByQuarterHT").'</td>';
486 }
487 print '<td class=right>'.$langs->trans("Quarter1").'</td>';
488 print '<td class=right>'.$langs->trans("Quarter2").'</td>';
489 print '<td class=right>'.$langs->trans("Quarter3").'</td>';
490 print '<td class=right>'.$langs->trans("Quarter4").'</td>';
491 print '<td class=right>'.$langs->trans("Total").'</td>';
492 print '</tr>';
493 }
494 $i = 0;
495
496 while ($i < $num) {
497 $objp = $db->fetch_object($result);
498 if ($tmpyear != $objp->annee) {
499 if ($trim1 + $trim2 + $trim3 + $trim4 > 0) {
500 print '<tr class="oddeven"><td class=left>'.$tmpyear.'</td>';
501 print '<td class="nowrap right">'.price($trim1).'</td>';
502 print '<td class="nowrap right">'.price($trim2).'</td>';
503 print '<td class="nowrap right">'.price($trim3).'</td>';
504 print '<td class="nowrap right">'.price($trim4).'</td>';
505 print '<td class="nowrap right">'.price($trim1 + $trim2 + $trim3 + $trim4).'</td>';
506 print '</tr>';
507 $lgn++;
508 }
509 // We go to the following year
510 $tmpyear = $objp->annee;
511 $trim1 = 0;
512 $trim2 = 0;
513 $trim3 = 0;
514 $trim4 = 0;
515 }
516
517 if ($objp->mois == "01" || $objp->mois == "02" || $objp->mois == "03") {
518 $trim1 += $objp->Mnttot;
519 }
520
521 if ($objp->mois == "04" || $objp->mois == "05" || $objp->mois == "06") {
522 $trim2 += $objp->Mnttot;
523 }
524
525 if ($objp->mois == "07" || $objp->mois == "08" || $objp->mois == "09") {
526 $trim3 += $objp->Mnttot;
527 }
528
529 if ($objp->mois == "10" || $objp->mois == "11" || $objp->mois == "12") {
530 $trim4 += $objp->Mnttot;
531 }
532
533 $i++;
534 }
535 if ($trim1 + $trim2 + $trim3 + $trim4 > 0) {
536 print '<tr class="oddeven"><td class=left>'.$tmpyear.'</td>';
537 print '<td class="nowrap right">'.price($trim1).'</td>';
538 print '<td class="nowrap right">'.price($trim2).'</td>';
539 print '<td class="nowrap right">'.price($trim3).'</td>';
540 print '<td class="nowrap right">'.price($trim4).'</td>';
541 print '<td class="nowrap right">'.price($trim1 + $trim2 + $trim3 + $trim4).'</td>';
542 print '</tr>';
543 }
544 if ($num > 0) {
545 print '</table></div>';
546 }
547 }
548}
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 build graphs.
Class to parse product price expressions.
Class to manage products or services.
dol_get_first_day($year, $month=1, $gm=false)
Return GMT time for first day of a month or year.
Definition date.lib.php:593
dol_time_plus_duree($time, $duration_value, $duration_unit, $ruleforendofmonth=0)
Add a delay to a date.
Definition date.lib.php:124
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
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.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs='', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
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.
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
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...
activitytrim($product_type)
Print html activity for product type.
Definition index.php:448
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $mode=0)
Check permissions of a user to show a page and an object.