dolibarr 24.0.0-beta
product_lot.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2021 Christophe Battarel <christophe.battarel@altairis.fr>
3 * Copyright (C) 2024-2026 MDW <mdeweerd@users.noreply.github.com>
4 * Copyright (C) 2024-2025 Frédéric France <frederic.france@free.fr>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <https://www.gnu.org/licenses/>.
18 */
19
26// Load Dolibarr environment
27require '../../main.inc.php';
36require_once DOL_DOCUMENT_ROOT.'/product/stock/class/productlot.class.php';
37require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
38require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php';
39
40// Load translation files required by the page
41$langs->loadLangs(array("admin", "products", "productbatch"));
42
43// Security check
44if (!$user->admin || (!isModEnabled('productbatch'))) {
46}
47
48$action = GETPOST('action', 'alpha');
49$value = GETPOST('value', 'alpha');
50$label = GETPOST('label', 'alpha');
51$scandir = GETPOST('scan_dir', 'alpha');
52$type = 'product_batch';
53
54$error = 0;
55
56
57/*
58 * Actions
59 */
60
61include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
62
63if ($action == 'updateMaskLot') {
64 $maskconstbatch = GETPOST('maskconstLot', 'aZ09');
65 $maskbatch = GETPOST('maskLot', 'alpha');
66
67 if ($maskconstbatch && preg_match('/_MASK$/', $maskconstbatch)) {
68 $res = dolibarr_set_const($db, $maskconstbatch, $maskbatch, 'chaine', 0, '', $conf->entity);
69 if ($res <= 0) {
70 $error++;
71 }
72 }
73
74 if (!$error) {
75 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
76 } else {
77 setEventMessages($langs->trans("Error"), null, 'errors');
78 }
79} elseif ($action == 'updateMaskSN') {
80 $maskconstbatch = GETPOST('maskconstSN', 'aZ09');
81 $maskbatch = GETPOST('maskSN', 'alpha');
82
83 if ($maskconstbatch && preg_match('/_MASK$/', $maskconstbatch)) {
84 $res = dolibarr_set_const($db, $maskconstbatch, $maskbatch, 'chaine', 0, '', $conf->entity);
85 if ($res <= 0) {
86 $error++;
87 }
88 }
89
90 if (!$error) {
91 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
92 } else {
93 setEventMessages($langs->trans("Error"), null, 'errors');
94 }
95} elseif ($action == 'setmodlot') {
96 dolibarr_set_const($db, "PRODUCTBATCH_LOT_ADDON", $value, 'chaine', 0, '', $conf->entity);
97} elseif ($action == 'setmodsn') {
98 dolibarr_set_const($db, "PRODUCTBATCH_SN_ADDON", $value, 'chaine', 0, '', $conf->entity);
99} elseif ($action == 'setmaskslot') {
100 dolibarr_set_const($db, "PRODUCTBATCH_LOT_USE_PRODUCT_MASKS", $value, 'bool', 0, '', $conf->entity);
101 if ($value == '1' && getDolGlobalString('PRODUCTBATCH_LOT_ADDONS') !== 'mod_lot_advanced') {
102 dolibarr_set_const($db, "PRODUCTBATCH_LOT_ADDON", 'mod_lot_advanced', 'chaine', 0, '', $conf->entity);
103 }
104} elseif ($action == 'setmaskssn') {
105 dolibarr_set_const($db, "PRODUCTBATCH_SN_USE_PRODUCT_MASKS", $value, 'bool', 0, '', $conf->entity);
106 if ($value == '1' && getDolGlobalString('PRODUCTBATCH_SN_ADDONS') !== 'mod_sn_advanced') {
107 dolibarr_set_const($db, "PRODUCTBATCH_SN_ADDON", 'mod_sn_advanced', 'chaine', 0, '', $conf->entity);
108 }
109} elseif ($action == 'set') {
110 // Activate a model
111 $ret = addDocumentModel($value, $type, $label, $scandir);
112} elseif ($action == 'del') {
113 $ret = delDocumentModel($value, $type);
114 if ($ret > 0) {
115 if (getDolGlobalString('FACTURE_ADDON_PDF') == "$value") {
116 dolibarr_del_const($db, 'FACTURE_ADDON_PDF', $conf->entity);
117 }
118 }
119} elseif ($action == 'specimen') {
120 $modele = GETPOST('module', 'alpha');
121
122 $product_batch = new Productlot($db);
123 $product_batch->initAsSpecimen();
124
125 // Search template files
126 $file = '';
127 $classname = '';
128 $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
129 foreach ($dirmodels as $reldir) {
130 $file = dol_buildpath($reldir . "core/modules/product_batch/doc/pdf_" . $modele . ".modules.php", 0);
131 if (file_exists($file)) {
132 $classname = "pdf_" . $modele;
133 break;
134 }
135 }
136
137 if ($classname !== '') {
138 require_once $file;
139
140 $module = new $classname($db);
141
142 '@phan-var-force ModelePDFProductBatch $module';
143
144 if ($module->write_file($product_batch, $langs) > 0) {
145 header("Location: " . DOL_URL_ROOT . "/document.php?modulepart=product_batch&file=SPECIMEN.pdf");
146 return;
147 } else {
148 setEventMessages($module->error, $module->errors, 'errors');
149 dol_syslog($module->error, LOG_ERR);
150 }
151 } else {
152 setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
153 dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
154 }
155} elseif ($action == 'setdoc') {
156 // Set default model
157 if (dolibarr_set_const($db, "PRODUCT_BATCH_ADDON_PDF", $value, 'chaine', 0, '', $conf->entity)) {
158 // La constante qui a ete lue en avant du nouveau set
159 // on passe donc par une variable pour avoir un affichage coherent
160 $conf->global->PRODUCT_BATCH_ADDON_PDF = $value;
161 }
162
163 // On active le modele
164 $ret = delDocumentModel($value, $type);
165 if ($ret > 0) {
166 $ret = addDocumentModel($value, $type, $label, $scandir);
167 }
168}
169
170/*
171 * View
172 */
173
174$form = new Form($db);
175
176$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
177
178llxHeader("", $langs->trans("ProductLotSetup"), '', '', 0, 0, '', '', '', 'mod-product page-admin_product_lot');
179
180$linkback = '<a href="'.dolBuildUrl(DOL_URL_ROOT.'/admin/modules.php', ['restore_lastsearch_values' => 1]).'">'.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').'<span class="hideonsmartphone">'.$langs->trans("BackToModuleList").'</span></a>';
181print load_fiche_titre($langs->trans("ProductLotSetup"), $linkback, 'title_setup');
182
184
185print dol_get_fiche_head($head, 'settings', $langs->trans("Batch"), -1, 'lot');
186
187
188if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) {
189 /*
190 * Lot Numbering models
191 */
192
193 print load_fiche_titre($langs->trans("BatchLotNumberingModules"), '', '');
194
195 print '<table class="noborder centpercent">';
196 print '<tr class="liste_titre">';
197 print '<td>'.$langs->trans("Name").'</td>';
198 print '<td>'.$langs->trans("Description").'</td>';
199 print '<td class="nowrap">'.$langs->trans("Example").'</td>';
200 print '<td class="center" width="60">'.$langs->trans("Status").'</td>';
201 print '<td class="center" width="16">'.$langs->trans("ShortInfo").'</td>';
202 print '</tr>'."\n";
203
204 clearstatcache();
205
206 foreach ($dirmodels as $reldir) {
207 $dir = dol_buildpath($reldir."core/modules/product_batch/");
208
209 if (is_dir($dir)) {
210 $handle = opendir($dir);
211 if (is_resource($handle)) {
212 while (($file = readdir($handle)) !== false) {
213 if (substr($file, 0, 8) == 'mod_lot_' && substr($file, dol_strlen($file) - 3, 3) == 'php') {
214 $file = substr($file, 0, dol_strlen($file) - 4);
215
216 require_once $dir.$file.'.php';
217
218 $module = new $file($db);
219 '@phan-var-force ModeleNumRefBatch $module';
220
221 // Show modules according to features level
222 if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
223 continue;
224 }
225 if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
226 continue;
227 }
228
229 if ($module->isEnabled()) {
230 print '<tr class="oddeven"><td>'.$module->name."</td><td>\n";
231 print $module->info($langs);
232 print '</td>';
233
234 // Show example of numbering model
235 print '<td class="nowrap">';
236 $tmp = $module->getExample();
237 if (preg_match('/^Error/', $tmp)) {
238 print '<div class="error">'.$langs->trans($tmp).'</div>';
239 } elseif ($tmp == 'NotConfigured') {
240 print $langs->trans($tmp);
241 } else {
242 print $tmp;
243 }
244 print '</td>'."\n";
245
246 print '<td class="center">';
247 if (getDolGlobalString('PRODUCTBATCH_LOT_ADDON') == $file) {
248 print img_picto($langs->trans("Activated"), 'switch_on');
249 } else {
250 print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setmodlot&token='.newToken().'&value='.urlencode($file).'">';
251 print img_picto($langs->trans("Disabled"), 'switch_off');
252 print '</a>';
253 }
254 print '</td>';
255
256 $batch = new Productlot($db);
257 $batch->initAsSpecimen();
258
259 // Info
260 $htmltooltip = '';
261 $htmltooltip .= ''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>';
262 $nextval = $module->getNextValue($mysoc, $batch);
263 if ((string) $nextval != $langs->trans("NotAvailable")) { // Keep " on nextval
264 $htmltooltip .= ''.$langs->trans("NextValue").': ';
265 if ($nextval) {
266 if (preg_match('/^Error/', $nextval) || $nextval == 'NotConfigured') {
267 $nextval = $langs->trans($nextval);
268 }
269 $htmltooltip .= $nextval.'<br>';
270 } else {
271 $htmltooltip .= $langs->trans($module->error).'<br>';
272 }
273 }
274
275 print '<td class="center">';
276 print $form->textwithpicto('', $htmltooltip, 1, 'info');
277 print '</td>';
278
279 print "</tr>\n";
280 }
281 }
282 }
283 closedir($handle);
284 }
285 }
286 }
287
288 print "</table><br>\n";
289
290
291 /*
292 * Serials Numbering models
293 */
294
295 print load_fiche_titre($langs->trans("BatchSerialNumberingModules"), '', '');
296
297 print '<table class="noborder centpercent">';
298 print '<tr class="liste_titre">';
299 print '<td>'.$langs->trans("Name").'</td>';
300 print '<td>'.$langs->trans("Description").'</td>';
301 print '<td class="nowrap">'.$langs->trans("Example").'</td>';
302 print '<td class="center" width="60">'.$langs->trans("Status").'</td>';
303 print '<td class="center" width="16">'.$langs->trans("ShortInfo").'</td>';
304 print '</tr>'."\n";
305
306 clearstatcache();
307
308 foreach ($dirmodels as $reldir) {
309 $dir = dol_buildpath($reldir."core/modules/product_batch/");
310
311 if (is_dir($dir)) {
312 $handle = opendir($dir);
313 if (is_resource($handle)) {
314 while (($file = readdir($handle)) !== false) {
315 if (substr($file, 0, 7) == 'mod_sn_' && substr($file, dol_strlen($file) - 3, 3) == 'php') {
316 $file = substr($file, 0, dol_strlen($file) - 4);
317
318 require_once $dir.$file.'.php';
319
320 $module = new $file($db);
321 '@phan-var-force ModeleNumRefBatch $module';
322
323 // Show modules according to features level
324 if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
325 continue;
326 }
327 if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
328 continue;
329 }
330
331 if ($module->isEnabled()) {
332 print '<tr class="oddeven"><td>'.$module->name."</td><td>\n";
333 print $module->info($langs);
334 print '</td>';
335
336 // Show example of numbering model
337 print '<td class="nowrap">';
338 $tmp = $module->getExample();
339 if (preg_match('/^Error/', $tmp)) {
340 print '<div class="error">'.$langs->trans($tmp).'</div>';
341 } elseif ($tmp == 'NotConfigured') {
342 print $langs->trans($tmp);
343 } else {
344 print $tmp;
345 }
346 print '</td>'."\n";
347
348 print '<td class="center">';
349 if (getDolGlobalString('PRODUCTBATCH_SN_ADDON') == $file) {
350 print img_picto($langs->trans("Activated"), 'switch_on');
351 } else {
352 print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setmodsn&token='.newToken().'&value='.urlencode($file).'">';
353 print img_picto($langs->trans("Disabled"), 'switch_off');
354 print '</a>';
355 }
356 print '</td>';
357
358 $batch = new Productlot($db);
359 $batch->initAsSpecimen();
360
361 // Info
362 $htmltooltip = '';
363 $htmltooltip .= ''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>';
364 $nextval = $module->getNextValue($mysoc, $batch);
365 if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval
366 $htmltooltip .= ''.$langs->trans("NextValue").': ';
367 if ($nextval) {
368 if (preg_match('/^Error/', $nextval) || $nextval == 'NotConfigured') {
369 $nextval = $langs->trans($nextval);
370 }
371 $htmltooltip .= $nextval.'<br>';
372 } else {
373 $htmltooltip .= $langs->trans($module->error).'<br>';
374 }
375 }
376
377 print '<td class="center">';
378 print $form->textwithpicto('', $htmltooltip, 1, 'info');
379 print '</td>';
380
381 print "</tr>\n";
382 }
383 }
384 }
385 closedir($handle);
386 }
387 }
388 }
389
390 print "</table><br>\n";
391}
392
393// Module to build doc
394$def = array();
395// TODO Replace with $def = getListOfModels($db, $type);
396$sql = "SELECT nom";
397$sql .= " FROM " . MAIN_DB_PREFIX . "document_model";
398$sql .= " WHERE type = '" . $db->escape($type) . "'";
399$sql .= " AND entity = " . ((int) $conf->entity);
400$resql = $db->query($sql);
401if ($resql) {
402 $i = 0;
403 $num_rows = $db->num_rows($resql);
404 while ($i < $num_rows) {
405 $array = $db->fetch_array($resql);
406 if (is_array($array)) {
407 array_push($def, $array[0]);
408 }
409 $i++;
410 }
411} else {
413}
414
415
416if (!empty($def)) {
417 print '<br>';
418
419 print load_fiche_titre($langs->trans("ProductBatchDocumentTemplates"), '', '');
420
421 print '<div class="div-table-responsive-no-min">';
422 print '<table class="noborder centpercent">';
423 print '<tr class="liste_titre">';
424 print '<td>' . $langs->trans("Name") . '</td>';
425 print '<td>' . $langs->trans("Description") . '</td>';
426 print '<td class="center" width="60">' . $langs->trans("Status") . "</td>\n";
427 print '<td class="center" width="60">' . $langs->trans("Default") . "</td>\n";
428 print '<td class="center"></td>';
429 print '<td class="center" width="80">' . $langs->trans("Preview") . '</td>';
430 print "</tr>\n";
431
432 clearstatcache();
433
434 $filelist = array();
435 foreach ($dirmodels as $reldir) {
436 foreach (array('', '/doc') as $valdir) {
437 $dir = dol_buildpath($reldir . "core/modules/product_batch" . $valdir);
438 if (is_dir($dir)) {
439 $handle = opendir($dir);
440 if (is_resource($handle)) {
441 while (($file = readdir($handle)) !== false) {
442 $filelist[] = $file;
443 }
444 closedir($handle);
445 arsort($filelist);
446
447 foreach ($filelist as $file) {
448 if (preg_match('/\.modules\.php$/i', $file) && preg_match('/^(pdf_|doc_)/', $file)) {
449 if (file_exists($dir . '/' . $file)) {
450 $name = substr($file, 4, dol_strlen($file) - 16);
451 $classname = substr($file, 0, dol_strlen($file) - 12);
452
453 require_once $dir . '/' . $file;
454 $module = new $classname($db);
455 '@phan-var-force ModelePDFProductBatch $module';
456
457 $modulequalified = 1;
458 if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
459 $modulequalified = 0;
460 }
461 if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
462 $modulequalified = 0;
463 }
464
465 if ($modulequalified) {
466 print '<tr class="oddeven"><td width="100">';
467 print(empty($module->name) ? $name : $module->name);
468 print "</td><td>\n";
469 if (method_exists($module, 'info')) {
470 print $module->info($langs); // @phan-suppress-current-line PhanUndeclaredMethod
471 } else {
472 print $module->description;
473 }
474 print '</td>';
475
476 // Active
477 if (in_array($name, $def)) {
478 print '<td class="center">' . "\n";
479 print '<a href="' . $_SERVER["PHP_SELF"] . '?action=del&token=' . newToken() . '&value=' . urlencode($name) . '">';
480 print img_picto($langs->trans("Enabled"), 'switch_on');
481 print '</a>';
482 print '</td>';
483 } else {
484 print '<td class="center">' . "\n";
485 print '<a href="' . $_SERVER["PHP_SELF"] . '?action=set&token=' . newToken() . '&value=' . urlencode($name) . '&scan_dir=' . urlencode($module->scandir) . '&label=' . urlencode($module->name) . '">' . img_picto($langs->trans("Disabled"), 'switch_off') . '</a>';
486 print "</td>";
487 }
488
489 // Default
490 print '<td class="center">';
491 if (getDolGlobalString('PRODUCT_BATCH_ADDON_PDF') == $name) {
492 print img_picto($langs->trans("Default"), 'on');
493 } else {
494 print '<a href="' . $_SERVER["PHP_SELF"] . '?action=setdoc&token=' . newToken() . '&value=' . urlencode($name) . '&scan_dir=' . urlencode($module->scandir) . '&label=' . urlencode($module->name) . '" alt="' . $langs->trans("Default") . '">' . img_picto($langs->trans("Disabled"), 'off') . '</a>';
495 }
496 print '</td>';
497
498 // Info
499 $htmltooltip = '' . $langs->trans("Name") . ': ' . $module->name;
500 $htmltooltip .= '<br>' . $langs->trans("Type") . ': ' . ($module->type ? $module->type : $langs->trans("Unknown"));
501 if ($module->type == 'pdf') {
502 $htmltooltip .= '<br>' . $langs->trans("Width") . '/' . $langs->trans("Height") . ': ' . $module->page_largeur . '/' . $module->page_hauteur;
503 }
504 $htmltooltip .= '<br><br><u>' . $langs->trans("FeaturesSupported") . ':</u>';
505 $htmltooltip .= '<br>' . $langs->trans("Logo") . ': ' . yn($module->option_logo, 1, 1);
506 $htmltooltip .= '<br>' . $langs->trans("MultiLanguage") . ': ' . yn($module->option_multilang, 1, 1);
507
508
509 print '<td class="center">';
510 print $form->textwithpicto('', $htmltooltip, 1, 'info');
511 print '</td>';
512
513 // Preview
514 print '<td class="center">';
515 if ($module->type == 'pdf') {
516 print '<a href="' . $_SERVER["PHP_SELF"] . '?action=specimen&module=' . $name . '">' . img_object($langs->trans("Preview"), 'contract') . '</a>';
517 } else {
518 print img_object($langs->transnoentitiesnoconv("PreviewNotAvailable"), 'generic');
519 }
520 print '</td>';
521
522 print "</tr>\n";
523 }
524 }
525 }
526 }
527 }
528 }
529 }
530 }
531
532 print '</table>';
533 print '</div>';
534}
535
536
537if (empty($def) && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
538 // The feature to define the numbering module of lot or serial is no enabled because it is not used anywhere in Dolibarr code: You can set it
539 // but the numbering module is not used.
540 // TODO Use it on lot creation page, when you create a lot and when the lot number is kept empty to define the lot according
541 // to the selected product.
542 print $langs->trans("NothingToSetup");
543}
544
545
546// End of page
547llxFooter();
548$db->close();
addDocumentModel($name, $type, $label='', $description='')
Add document model used by doc generator.
dolibarr_set_const($db, $name, $value, $type='chaine', $visible=0, $note='', $entity=1)
Insert a parameter (key,value) into database (delete old key then insert it again).
dolibarr_del_const($db, $name, $entity=1)
Delete a constant.
delDocumentModel($name, $type)
Delete document model used by doc generator.
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 manage generation of HTML components Only common components must be here.
Class with list of lots and properties.
global $mysoc
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.
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)
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.
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $allowothertags=array())
Show a picto called object_picto (generic function)
dol_strlen($string, $stringencoding='UTF-8')
Make a strlen call.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
yn($yesno, $format=1, $color=0)
Return yes or no in current language.
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_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='', $morecssonpicto='widthpictotitle')
Load a title with picto.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
product_lot_admin_prepare_head()
Return array head with list of tabs to view object information.
$conf db name
Only used if Module[ID]Name translation string is not found.
Definition repair.php:133
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.