dolibarr 24.0.0-beta
bom.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2019 Laurent Destailleur <eldy@users.sourceforge.net>
3 * Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
4 * Copyright (C) 2024-2025 Frédéric France <frederic.france@free.fr>
5 * Copyright (C) 2026 Alexandre Spangaro <alexandre@inovea-conseil.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <https://www.gnu.org/licenses/>.
19 */
20
27// Load Dolibarr environment
28require '../main.inc.php';
29require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
30require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
31require_once DOL_DOCUMENT_ROOT.'/bom/class/bom.class.php';
32require_once DOL_DOCUMENT_ROOT.'/bom/lib/bom.lib.php';
33require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
34
44// Load translation files required by the page
45$langs->loadLangs(array('admin', 'errors', 'mrp', 'other'));
46
47if (!$user->admin) {
49}
50
51$action = GETPOST('action', 'aZ09');
52$value = GETPOST('value', 'alpha');
53$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php
54
55$label = GETPOST('label', 'alpha');
56$scandir = GETPOST('scan_dir', 'alpha');
57$type = 'bom';
58
59
60/*
61 * Actions
62 */
63$error = 0;
64
65include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
66
67if ($action == 'updateMask') {
68 $maskconstbom = GETPOST('maskconstBom', 'aZ09');
69 $maskbom = GETPOST('maskBom', 'alpha');
70
71 $res = 0;
72
73 if ($maskconstbom && preg_match('/_MASK$/', $maskconstbom)) {
74 $res = dolibarr_set_const($db, $maskconstbom, $maskbom, 'chaine', 0, '', $conf->entity);
75 }
76
77 if (!($res > 0)) {
78 $error++;
79 }
80
81 if (!$error) {
82 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
83 } else {
84 setEventMessages($langs->trans("Error"), null, 'errors');
85 }
86} elseif ($action == 'specimen') {
87 $modele = GETPOST('module', 'alpha');
88
89 $bom = new BOM($db);
90 $bom->initAsSpecimen();
91
92 // Search template files
93 $file = '';
94 $classname = '';
95 $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
96 foreach ($dirmodels as $reldir) {
97 $file = dol_buildpath($reldir."core/modules/bom/doc/pdf_".$modele.".modules.php", 0);
98 if (file_exists($file)) {
99 $classname = "pdf_".$modele;
100 break;
101 }
102 }
103
104 if ($classname !== '') {
105 require_once $file;
106
107 $module = new $classname($db);
108 '@phan-var-force ModelePDFBom $module';
109
110 if ($module->write_file($bom, $langs) > 0) {
111 header("Location: ".DOL_URL_ROOT."/document.php?modulepart=bom&file=SPECIMEN.pdf");
112 return;
113 } else {
114 setEventMessages($module->error, $module->errors, 'errors');
115 dol_syslog($module->error, LOG_ERR);
116 }
117 } else {
118 setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
119 dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
120 }
121} elseif ($action == 'set') {
122 // Activate a model
123 $ret = addDocumentModel($value, $type, $label, $scandir);
124} elseif ($action == 'del') {
125 $ret = delDocumentModel($value, $type);
126 if ($ret > 0) {
127 if (getDolGlobalString('BOM_ADDON_PDF') == "$value") {
128 dolibarr_del_const($db, 'BOM_ADDON_PDF', $conf->entity);
129 }
130 }
131} elseif ($action == 'setdoc') {
132 // Set default model
133 if (dolibarr_set_const($db, "BOM_ADDON_PDF", $value, 'chaine', 0, '', $conf->entity)) {
134 // The constant that was read before the new set
135 // We therefore requires a variable to have a coherent view
136 $conf->global->BOM_ADDON_PDF = $value;
137 }
138
139 // On active le modele
140 $ret = delDocumentModel($value, $type);
141 if ($ret > 0) {
142 $ret = addDocumentModel($value, $type, $label, $scandir);
143 }
144} elseif ($action == 'setmod') {
145 // TODO Check if numbering module chosen can be activated
146 // by calling method canBeActivated
147
148 dolibarr_set_const($db, "BOM_ADDON", $value, 'chaine', 0, '', $conf->entity);
149} elseif ($action == 'updateother') {
150 $draft = GETPOST("BOM_DRAFT_WATERMARK");
151 $res = dolibarr_set_const($db, "BOM_DRAFT_WATERMARK", trim($draft), 'chaine', 0, '', $conf->entity);
152 if (!($res > 0)) {
153 $error++;
154 }
155
156 $bomsearch = GETPOST('activate_BOM_USE_SEARCH_TO_SELECT', 'alpha');
157 $res = dolibarr_set_const($db, "BOM_USE_SEARCH_TO_SELECT", $bomsearch, 'chaine', 0, '', $conf->entity);
158 if (!($res > 0)) {
159 $error++;
160 }
161
162 $freetext = GETPOST("BOM_FREE_TEXT", 'restricthtml'); // No alpha here, we want exact string
163 $res = dolibarr_set_const($db, "BOM_FREE_TEXT", $freetext, 'chaine', 0, '', $conf->entity);
164 if (!($res > 0)) {
165 $error++;
166 }
167
168
169
170 if (!$error) {
171 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
172 } else {
173 setEventMessages($langs->trans("Error"), null, 'errors');
174 }
175}
176
177/*
178 * View
179 */
180
181$form = new Form($db);
182
183$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
184
185llxHeader("", $langs->trans("BOMsSetup"), '', '', 0, 0, '', '', '', 'mod-admin page-bom');
186
187$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>';
188
189print load_fiche_titre($langs->trans("BOMsSetup"), $linkback, 'title_setup');
190
191$head = bomAdminPrepareHead();
192
193print dol_get_fiche_head($head, 'settings', $langs->trans("BOMs"), -1, 'bom');
194
195/*
196 * Numbering module
197 */
198
199print load_fiche_titre($langs->trans("BOMsNumberingModules"), '', '');
200
201print '<div class="div-table-responsive-no-min">';
202print '<table class="noborder centpercent">';
203print '<tr class="liste_titre">';
204print '<td>'.$langs->trans("Name").'</td>';
205print '<td>'.$langs->trans("Description").'</td>';
206print '<td class="nowrap">'.$langs->trans("Example").'</td>';
207print '<td class="center" width="60">'.$langs->trans("Status").'</td>';
208print '<td class="center" width="16">'.$langs->trans("ShortInfo").'</td>';
209print '</tr>'."\n";
210
211clearstatcache();
212
213foreach ($dirmodels as $reldir) {
214 $dir = dol_buildpath($reldir."core/modules/bom/");
215
216 if (is_dir($dir)) {
217 $handle = opendir($dir);
218 if (is_resource($handle)) {
219 while (($file = readdir($handle)) !== false) {
220 if (substr($file, 0, 8) == 'mod_bom_' && substr($file, dol_strlen($file) - 3, 3) == 'php') {
221 $file = substr($file, 0, dol_strlen($file) - 4);
222 $classname = $file;
223
224 require_once $dir.$file.'.php';
225
226 $module = new $classname($db);
227
228 '@phan-var-force ModeleNumRefBoms $module';
231 // Show modules according to features level
232 if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
233 continue;
234 }
235 if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
236 continue;
237 }
238
239 if ($module->isEnabled()) {
240 print '<tr class="oddeven"><td>'.$module->name."</td><td>\n";
241 print $module->info($langs);
242 print '</td>';
243
244 // Show example of numbering module
245 print '<td class="nowrap">';
246 $tmp = $module->getExample();
247 if (preg_match('/^Error/', $tmp)) {
248 $langs->load("errors");
249 print '<div class="error">'.$langs->trans($tmp).'</div>';
250 } elseif ($tmp == 'NotConfigured') {
251 print '<span class="opacitymedium">'.$langs->trans($tmp).'</span>';
252 } else {
253 print $tmp;
254 }
255 print '</td>'."\n";
256
257 print '<td class="center">';
258 if (getDolGlobalString('BOM_ADDON') == $file) {
259 print img_picto($langs->trans("Activated"), 'switch_on');
260 } else {
261 print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setmod&token='.newToken().'&value='.urlencode($file).'">';
262 print img_picto($langs->trans("Disabled"), 'switch_off');
263 print '</a>';
264 }
265 print '</td>';
266
267 $bom = new BOM($db);
268 $bom->initAsSpecimen();
269
270 $tmpprod = new Product($db);
271 $tmpprod->initAsSpecimen();
272
273 // Info
274 $htmltooltip = '';
275 $htmltooltip .= ''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>';
276 $bom->type = 0;
277 $nextval = $module->getNextValue($tmpprod, $bom);
278 if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval
279 $htmltooltip .= ''.$langs->trans("NextValue").': ';
280 if ($nextval) {
281 if (preg_match('/^Error/', $nextval) || $nextval == 'NotConfigured') {
282 $nextval = $langs->trans($nextval);
283 }
284 $htmltooltip .= $nextval.'<br>';
285 } else {
286 $htmltooltip .= $langs->trans($module->error).'<br>';
287 }
288 }
289
290 print '<td class="center">';
291 print $form->textwithpicto('', $htmltooltip, 1, 'info');
292 print '</td>';
293
294 print "</tr>\n";
295 }
296 }
297 }
298 closedir($handle);
299 }
300 }
301}
302print "</table>";
303print "</div>";
304
305
306/*
307 * Document templates generators
308 */
309
310print "<br>\n";
311print load_fiche_titre($langs->trans("BOMsModelModule"), '', '');
312
313// Load array def with activated templates
314$def = array();
315$sql = "SELECT nom";
316$sql .= " FROM ".MAIN_DB_PREFIX."document_model";
317$sql .= " WHERE type = '".$db->escape($type)."'";
318$sql .= " AND entity = ".((int) $conf->entity);
319$resql = $db->query($sql);
320if ($resql) {
321 $i = 0;
322 $num_rows = $db->num_rows($resql);
323 while ($i < $num_rows) {
324 $array = $db->fetch_array($resql);
325 if (is_array($array)) {
326 array_push($def, $array[0]);
327 }
328 $i++;
329 }
330} else {
332}
333
334
335print '<div class="div-table-responsive-no-min">';
336print '<table class="noborder centpercent">';
337print '<tr class="liste_titre">';
338print '<td>'.$langs->trans("Name").'</td>';
339print '<td>'.$langs->trans("Description").'</td>';
340print '<td class="center" width="60">'.$langs->trans("Status")."</td>\n";
341print '<td class="center" width="60">'.$langs->trans("Default")."</td>\n";
342print '<td class="center" width="38">'.$langs->trans("ShortInfo").'</td>';
343print '<td class="center" width="38">'.$langs->trans("Preview").'</td>';
344print "</tr>\n";
345
346clearstatcache();
347
348foreach ($dirmodels as $reldir) {
349 foreach (array('', '/doc') as $valdir) {
350 $realpath = $reldir."core/modules/bom".$valdir;
351 $dir = dol_buildpath($realpath);
352
353 if (is_dir($dir)) {
354 $handle = opendir($dir);
355 if (is_resource($handle)) {
356 $filelist = array();
357 while (($file = readdir($handle)) !== false) {
358 $filelist[] = $file;
359 }
360 closedir($handle);
361 arsort($filelist);
362
363 foreach ($filelist as $file) {
364 if (preg_match('/\.modules\.php$/i', $file) && preg_match('/^(pdf_|doc_)/', $file)) {
365 if (file_exists($dir.'/'.$file)) {
366 $name = substr($file, 4, dol_strlen($file) - 16);
367 $classname = substr($file, 0, dol_strlen($file) - 12);
368
369 require_once $dir.'/'.$file;
370 $module = new $classname($db);
371 '@phan-var-force ModelePDFBom $module';
374 $modulequalified = 1;
375 if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
376 $modulequalified = 0;
377 }
378 if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
379 $modulequalified = 0;
380 }
381
382 if ($modulequalified) {
383 print '<tr class="oddeven"><td width="100">';
384 print(empty($module->name) ? $name : $module->name);
385 print "</td><td>\n";
386 if (method_exists($module, 'info')) {
387 print $module->info($langs); // @phan-suppress-current-line PhanUndeclaredMethod
388 } else {
389 print $module->description;
390 }
391 print '</td>';
392
393 // Active
394 if (in_array($name, $def)) {
395 print '<td class="center">'."\n";
396 print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=del&token='.newToken().'&value='.urlencode($name).'">';
397 print img_picto($langs->trans("Enabled"), 'switch_on');
398 print '</a>';
399 print '</td>';
400 } else {
401 print '<td class="center">'."\n";
402 print '<a class="reposition" 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>';
403 print "</td>";
404 }
405
406 // Default
407 print '<td class="center">';
408 if (getDolGlobalString('BOM_ADDON_PDF') == $name) {
409 print img_picto($langs->trans("Default"), 'on');
410 } else {
411 print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setdoc&token='.newToken().'&value='.urlencode($name).'&scan_dir='.urlencode($module->scandir).'&amp;label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
412 }
413 print '</td>';
414
415 // Info
416 $htmltooltip = ''.$langs->trans("Name").': '.$module->name;
417 $htmltooltip .= '<br>'.$langs->trans("Type").': '.($module->type ? $module->type : $langs->trans("Unknown"));
418 if ($module->type == 'pdf') {
419 $htmltooltip .= '<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
420 }
421 $htmltooltip .= '<br>'.$langs->trans("Path").': '.preg_replace('/^\//', '', $realpath).'/'.$file;
422
423 $htmltooltip .= '<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
424 $htmltooltip .= '<br>'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1);
425 $htmltooltip .= '<br>'.$langs->trans("WatermarkOnDraftBOMs").': '.yn($module->option_draft_watermark, 1, 1);
426
427
428 print '<td class="center">';
429 print $form->textwithpicto('', $htmltooltip, 1, 'info');
430 print '</td>';
431
432 // Preview
433 print '<td class="center">';
434 if ($module->type == 'pdf') {
435 print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
436 } else {
437 print img_object($langs->transnoentitiesnoconv("PreviewNotAvailable"), 'generic');
438 }
439 print '</td>';
440
441 print "</tr>\n";
442 }
443 }
444 }
445 }
446 }
447 }
448 }
449}
450
451print '</table>';
452print '</div>';
453
454/*
455 * Other options
456 */
457
458print "<br>";
459print load_fiche_titre($langs->trans("OtherOptions"), '', '');
460
461print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
462print '<input type="hidden" name="token" value="'.newToken().'">';
463print '<input type="hidden" name="action" value="updateother">';
464
465print '<div class="div-table-responsive-no-min">';
466print '<table class="noborder centpercent">';
467print '<tr class="liste_titre">';
468print '<td>'.$langs->trans("Parameter").'</td>';
469print '<td class="center"></td>';
470print "</tr>\n";
471
472if (getDolGlobalString('MAIN_FEATURES_LEVEL') >= 1) {
473 print '<tr class="oddeven"><td>';
474 print $langs->trans("BOM_SUB_BOM");
475 print '</td><td>';
476 if ($conf->use_javascript_ajax) {
477 print ajax_constantonoff('BOM_SUB_BOM');
478 } else {
479 if (!getDolGlobalString('BOM_SUB_BOM')) {
480 print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_BOM_SUB_BOM&token='.newToken().'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
481 } else {
482 print '<a href="'.$_SERVER['PHP_SELF'].'?action=del_BOM_SUB_BOM&token='.newToken().'">'.img_picto($langs->trans("Enabled"), 'on').'</a>';
483 }
484 }
485
486 print "</td></tr>\n";
487}
488
489
490print '<tr class="oddeven">';
491print '<td>'.$langs->trans("UseSearchToSelectBom").'</td>';
492if (!$conf->use_javascript_ajax) {
493 print '<td></td>';
494 print '<td class="nowrap right">';
495 print $langs->trans("NotAvailableWhenAjaxDisabled");
496 print "</td>";
497} else {
498 print '<td>';
499 $arrval = array('0' => $langs->trans("No"),
500 '1' => $langs->trans("Yes").' ('.$langs->trans("NumberOfKeyToSearch", 1).')',
501 '2' => $langs->trans("Yes").' ('.$langs->trans("NumberOfKeyToSearch", 2).')',
502 '3' => $langs->trans("Yes").' ('.$langs->trans("NumberOfKeyToSearch", 3).')',
503 );
504 print $form->selectarray("activate_BOM_USE_SEARCH_TO_SELECT", $arrval, getDolGlobalString("BOM_USE_SEARCH_TO_SELECT")).'</td>';
505}
506print '</form>';
507print '</tr>';
508
509$substitutionarray = pdf_getSubstitutionArray($langs, null, null, 2);
510$substitutionarray['__(AnyTranslationKey)__'] = $langs->trans("Translation");
511$htmltext = '<i>'.$langs->trans("AvailableVariables").':<br>';
512foreach ($substitutionarray as $key => $val) {
513 $htmltext .= $key.'<br>';
514}
515$htmltext .= '</i>';
516
517print '<tr class="oddeven"><td colspan="2">';
518print $form->textwithpicto($langs->trans("FreeLegalTextOnBOMs"), $langs->trans("AddCRIfTooLong").'<br><br>'.$htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').'<br>';
519$variablename = 'BOM_FREE_TEXT';
520if (!getDolGlobalString('PDF_ALLOW_HTML_FOR_FREE_TEXT')) {
521 print '<textarea name="'.$variablename.'" class="flat" cols="120">'.getDolGlobalString($variablename).'</textarea>';
522} else {
523 include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
524 $doleditor = new DolEditor($variablename, getDolGlobalString($variablename), '', 80, 'dolibarr_notes');
525 print $doleditor->Create();
526}
527print "</td></tr>\n";
528
529// Use draft Watermark
530
531print '<tr class="oddeven"><td>';
532print $form->textwithpicto($langs->trans("WatermarkOnDraftBOMs"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').'<br>';
533print '</td><td>';
534print '<input class="flat minwidth200" type="text" name="BOM_DRAFT_WATERMARK" value="'.dol_escape_htmltag(getDolGlobalString('BOM_DRAFT_WATERMARK')).'">';
535print "</td></tr>\n";
536
537print '</table>';
538print '</div>';
539
540print $form->buttonsSaveCancel("Save", '');
541
542print '</form>';
543
544print dol_get_fiche_end();
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
bomAdminPrepareHead()
Prepare admin pages header.
Definition bom.lib.php:31
Class for BOM.
Definition bom.class.php:42
Class to manage a WYSIWYG editor.
Class to manage generation of HTML components Only common components must be here.
Class to manage products or services.
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.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
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.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
pdf_getSubstitutionArray($outputlangs, $exclude=null, $object=null, $onlykey=0, $include=null)
Return array of possible substitutions for PDF content (without external module substitutions).
Definition pdf.lib.php:1135
$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.