dolibarr 22.0.5
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 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';
28require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
29require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
30require_once DOL_DOCUMENT_ROOT.'/bom/class/bom.class.php';
31require_once DOL_DOCUMENT_ROOT.'/bom/lib/bom.lib.php';
32
42// Load translation files required by the page
43$langs->loadLangs(array('admin', 'errors', 'mrp', 'other'));
44
45if (!$user->admin) {
47}
48
49$action = GETPOST('action', 'aZ09');
50$value = GETPOST('value', 'alpha');
51$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php
52
53$label = GETPOST('label', 'alpha');
54$scandir = GETPOST('scan_dir', 'alpha');
55$type = 'bom';
56
57
58/*
59 * Actions
60 */
61$error = 0;
62
63include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
64
65if ($action == 'updateMask') {
66 $maskconstbom = GETPOST('maskconstBom', 'aZ09');
67 $maskbom = GETPOST('maskBom', 'alpha');
68
69 $res = 0;
70
71 if ($maskconstbom && preg_match('/_MASK$/', $maskconstbom)) {
72 $res = dolibarr_set_const($db, $maskconstbom, $maskbom, 'chaine', 0, '', $conf->entity);
73 }
74
75 if (!($res > 0)) {
76 $error++;
77 }
78
79 if (!$error) {
80 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
81 } else {
82 setEventMessages($langs->trans("Error"), null, 'errors');
83 }
84} elseif ($action == 'specimen') {
85 $modele = GETPOST('module', 'alpha');
86
87 $bom = new BOM($db);
88 $bom->initAsSpecimen();
89
90 // Search template files
91 $file = '';
92 $classname = '';
93 $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
94 foreach ($dirmodels as $reldir) {
95 $file = dol_buildpath($reldir."core/modules/bom/doc/pdf_".$modele.".modules.php", 0);
96 if (file_exists($file)) {
97 $classname = "pdf_".$modele;
98 break;
99 }
100 }
101
102 if ($classname !== '') {
103 require_once $file;
104
105 $module = new $classname($db);
106 '@phan-var-force ModelePDFBom $module';
107
108 if ($module->write_file($bom, $langs) > 0) {
109 header("Location: ".DOL_URL_ROOT."/document.php?modulepart=bom&file=SPECIMEN.pdf");
110 return;
111 } else {
112 setEventMessages($module->error, $module->errors, 'errors');
113 dol_syslog($module->error, LOG_ERR);
114 }
115 } else {
116 setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
117 dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
118 }
119} elseif ($action == 'set') {
120 // Activate a model
121 $ret = addDocumentModel($value, $type, $label, $scandir);
122} elseif ($action == 'del') {
123 $ret = delDocumentModel($value, $type);
124 if ($ret > 0) {
125 if ($conf->global->BOM_ADDON_PDF == "$value") {
126 dolibarr_del_const($db, 'BOM_ADDON_PDF', $conf->entity);
127 }
128 }
129} elseif ($action == 'setdoc') {
130 // Set default model
131 if (dolibarr_set_const($db, "BOM_ADDON_PDF", $value, 'chaine', 0, '', $conf->entity)) {
132 // The constant that was read before the new set
133 // We therefore requires a variable to have a coherent view
134 $conf->global->BOM_ADDON_PDF = $value;
135 }
136
137 // On active le modele
138 $ret = delDocumentModel($value, $type);
139 if ($ret > 0) {
140 $ret = addDocumentModel($value, $type, $label, $scandir);
141 }
142} elseif ($action == 'setmod') {
143 // TODO Check if numbering module chosen can be activated
144 // by calling method canBeActivated
145
146 dolibarr_set_const($db, "BOM_ADDON", $value, 'chaine', 0, '', $conf->entity);
147} elseif ($action == 'set_BOM_DRAFT_WATERMARK') {
148 $draft = GETPOST("BOM_DRAFT_WATERMARK");
149 $res = dolibarr_set_const($db, "BOM_DRAFT_WATERMARK", trim($draft), 'chaine', 0, '', $conf->entity);
150
151 if (!($res > 0)) {
152 $error++;
153 }
154
155 if (!$error) {
156 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
157 } else {
158 setEventMessages($langs->trans("Error"), null, 'errors');
159 }
160} elseif ($action == 'set_BOM_FREE_TEXT') {
161 $freetext = GETPOST("BOM_FREE_TEXT", 'restricthtml'); // No alpha here, we want exact string
162
163 $res = dolibarr_set_const($db, "BOM_FREE_TEXT", $freetext, 'chaine', 0, '', $conf->entity);
164
165 if (!($res > 0)) {
166 $error++;
167 }
168
169 if (!$error) {
170 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
171 } else {
172 setEventMessages($langs->trans("Error"), null, 'errors');
173 }
174} elseif ($action == 'updateoptions') {
175 if (GETPOST('BOM_USE_SEARCH_TO_SELECT')) {
176 $bomsearch = GETPOST('activate_BOM_USE_SEARCH_TO_SELECT', 'alpha');
177 if (dolibarr_set_const($db, "BOM_USE_SEARCH_TO_SELECT", $bomsearch, 'chaine', 0, '', $conf->entity)) {
178 $conf->global->BOM_USE_SEARCH_TO_SELECT = $bomsearch;
179 }
180 }
181}
182
183
184/*
185 * View
186 */
187
188$form = new Form($db);
189
190$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
191
192llxHeader("", $langs->trans("BOMsSetup"), '', '', 0, 0, '', '', '', 'mod-admin page-bom');
193
194$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
195print load_fiche_titre($langs->trans("BOMsSetup"), $linkback, 'title_setup');
196
197$head = bomAdminPrepareHead();
198
199print dol_get_fiche_head($head, 'settings', $langs->trans("BOMs"), -1, 'bom');
200
201/*
202 * Numbering module
203 */
204
205print load_fiche_titre($langs->trans("BOMsNumberingModules"), '', '');
206
207print '<div class="div-table-responsive-no-min">';
208print '<table class="noborder centpercent">';
209print '<tr class="liste_titre">';
210print '<td>'.$langs->trans("Name").'</td>';
211print '<td>'.$langs->trans("Description").'</td>';
212print '<td class="nowrap">'.$langs->trans("Example").'</td>';
213print '<td class="center" width="60">'.$langs->trans("Status").'</td>';
214print '<td class="center" width="16">'.$langs->trans("ShortInfo").'</td>';
215print '</tr>'."\n";
216
217clearstatcache();
218
219foreach ($dirmodels as $reldir) {
220 $dir = dol_buildpath($reldir."core/modules/bom/");
221
222 if (is_dir($dir)) {
223 $handle = opendir($dir);
224 if (is_resource($handle)) {
225 while (($file = readdir($handle)) !== false) {
226 if (substr($file, 0, 8) == 'mod_bom_' && substr($file, dol_strlen($file) - 3, 3) == 'php') {
227 $file = substr($file, 0, dol_strlen($file) - 4);
228 $classname = $file;
229
230 require_once $dir.$file.'.php';
231
232 $module = new $classname($db);
233
234 '@phan-var-force ModeleNumRefBoms $module';
235
236 // Show modules according to features level
237 if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
238 continue;
239 }
240 if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
241 continue;
242 }
243
244 if ($module->isEnabled()) {
245 print '<tr class="oddeven"><td>'.$module->name."</td><td>\n";
246 print $module->info($langs);
247 print '</td>';
248
249 // Show example of numbering module
250 print '<td class="nowrap">';
251 $tmp = $module->getExample();
252 if (preg_match('/^Error/', $tmp)) {
253 $langs->load("errors");
254 print '<div class="error">'.$langs->trans($tmp).'</div>';
255 } elseif ($tmp == 'NotConfigured') {
256 print '<span class="opacitymedium">'.$langs->trans($tmp).'</span>';
257 } else {
258 print $tmp;
259 }
260 print '</td>'."\n";
261
262 print '<td class="center">';
263 if (getDolGlobalString('BOM_ADDON') == $file) {
264 print img_picto($langs->trans("Activated"), 'switch_on');
265 } else {
266 print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setmod&token='.newToken().'&value='.urlencode($file).'">';
267 print img_picto($langs->trans("Disabled"), 'switch_off');
268 print '</a>';
269 }
270 print '</td>';
271
272 $bom = new BOM($db);
273 $bom->initAsSpecimen();
274
275 $tmpprod = new Product($db);
276 $tmpprod->initAsSpecimen();
277
278 // Info
279 $htmltooltip = '';
280 $htmltooltip .= ''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>';
281 $bom->type = 0;
282 $nextval = $module->getNextValue($tmpprod, $bom);
283 if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval
284 $htmltooltip .= ''.$langs->trans("NextValue").': ';
285 if ($nextval) {
286 if (preg_match('/^Error/', $nextval) || $nextval == 'NotConfigured') {
287 $nextval = $langs->trans($nextval);
288 }
289 $htmltooltip .= $nextval.'<br>';
290 } else {
291 $htmltooltip .= $langs->trans($module->error).'<br>';
292 }
293 }
294
295 print '<td class="center">';
296 print $form->textwithpicto('', $htmltooltip, 1, 'info');
297 print '</td>';
298
299 print "</tr>\n";
300 }
301 }
302 }
303 closedir($handle);
304 }
305 }
306}
307print "</table>";
308print "</div>";
309
310
311/*
312 * Document templates generators
313 */
314
315print "<br>\n";
316print load_fiche_titre($langs->trans("BOMsModelModule"), '', '');
317
318// Load array def with activated templates
319$def = array();
320$sql = "SELECT nom";
321$sql .= " FROM ".MAIN_DB_PREFIX."document_model";
322$sql .= " WHERE type = '".$db->escape($type)."'";
323$sql .= " AND entity = ".$conf->entity;
324$resql = $db->query($sql);
325if ($resql) {
326 $i = 0;
327 $num_rows = $db->num_rows($resql);
328 while ($i < $num_rows) {
329 $array = $db->fetch_array($resql);
330 if (is_array($array)) {
331 array_push($def, $array[0]);
332 }
333 $i++;
334 }
335} else {
336 dol_print_error($db);
337}
338
339
340print '<div class="div-table-responsive-no-min">';
341print '<table class="noborder centpercent">';
342print '<tr class="liste_titre">';
343print '<td>'.$langs->trans("Name").'</td>';
344print '<td>'.$langs->trans("Description").'</td>';
345print '<td class="center" width="60">'.$langs->trans("Status")."</td>\n";
346print '<td class="center" width="60">'.$langs->trans("Default")."</td>\n";
347print '<td class="center" width="38">'.$langs->trans("ShortInfo").'</td>';
348print '<td class="center" width="38">'.$langs->trans("Preview").'</td>';
349print "</tr>\n";
350
351clearstatcache();
352
353foreach ($dirmodels as $reldir) {
354 foreach (array('', '/doc') as $valdir) {
355 $realpath = $reldir."core/modules/bom".$valdir;
356 $dir = dol_buildpath($realpath);
357
358 if (is_dir($dir)) {
359 $handle = opendir($dir);
360 if (is_resource($handle)) {
361 $filelist = array();
362 while (($file = readdir($handle)) !== false) {
363 $filelist[] = $file;
364 }
365 closedir($handle);
366 arsort($filelist);
367
368 foreach ($filelist as $file) {
369 if (preg_match('/\.modules\.php$/i', $file) && preg_match('/^(pdf_|doc_)/', $file)) {
370 if (file_exists($dir.'/'.$file)) {
371 $name = substr($file, 4, dol_strlen($file) - 16);
372 $classname = substr($file, 0, dol_strlen($file) - 12);
373
374 require_once $dir.'/'.$file;
375 $module = new $classname($db);
376 '@phan-var-force ModelePDFBom $module';
377
378 $modulequalified = 1;
379 if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
380 $modulequalified = 0;
381 }
382 if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
383 $modulequalified = 0;
384 }
385
386 if ($modulequalified) {
387 print '<tr class="oddeven"><td width="100">';
388 print(empty($module->name) ? $name : $module->name);
389 print "</td><td>\n";
390 if (method_exists($module, 'info')) {
391 print $module->info($langs); // @phan-suppress-current-line PhanUndeclaredMethod
392 } else {
393 print $module->description;
394 }
395 print '</td>';
396
397 // Active
398 if (in_array($name, $def)) {
399 print '<td class="center">'."\n";
400 print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=del&token='.newToken().'&value='.urlencode($name).'">';
401 print img_picto($langs->trans("Enabled"), 'switch_on');
402 print '</a>';
403 print '</td>';
404 } else {
405 print '<td class="center">'."\n";
406 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>';
407 print "</td>";
408 }
409
410 // Default
411 print '<td class="center">';
412 if ($conf->global->BOM_ADDON_PDF == $name) {
413 print img_picto($langs->trans("Default"), 'on');
414 } else {
415 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>';
416 }
417 print '</td>';
418
419 // Info
420 $htmltooltip = ''.$langs->trans("Name").': '.$module->name;
421 $htmltooltip .= '<br>'.$langs->trans("Type").': '.($module->type ? $module->type : $langs->trans("Unknown"));
422 if ($module->type == 'pdf') {
423 $htmltooltip .= '<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
424 }
425 $htmltooltip .= '<br>'.$langs->trans("Path").': '.preg_replace('/^\//', '', $realpath).'/'.$file;
426
427 $htmltooltip .= '<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
428 $htmltooltip .= '<br>'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1);
429 $htmltooltip .= '<br>'.$langs->trans("WatermarkOnDraftBOMs").': '.yn($module->option_draft_watermark, 1, 1);
430
431
432 print '<td class="center">';
433 print $form->textwithpicto('', $htmltooltip, 1, 'info');
434 print '</td>';
435
436 // Preview
437 print '<td class="center">';
438 if ($module->type == 'pdf') {
439 print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
440 } else {
441 print img_object($langs->transnoentitiesnoconv("PreviewNotAvailable"), 'generic');
442 }
443 print '</td>';
444
445 print "</tr>\n";
446 }
447 }
448 }
449 }
450 }
451 }
452 }
453}
454
455print '</table>';
456print '</div>';
457
458/*
459 * Other options
460 */
461
462print "<br>";
463print load_fiche_titre($langs->trans("OtherOptions"), '', '');
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" width="60"></td>';
470print "<td>&nbsp;</td>\n";
471print "</tr>\n";
472
473
474print '<tr class="oddeven">';
475print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'">';
476print '<input type="hidden" name="token" value="'.newToken().'">';
477print '<input type="hidden" name="action" value="updateoptions">';
478print '<td>'.$langs->trans("UseSearchToSelectBom").'</td>';
479if (!$conf->use_javascript_ajax) {
480 print '<td></td>';
481 print '<td class="nowrap right">';
482 print $langs->trans("NotAvailableWhenAjaxDisabled");
483 print "</td>";
484} else {
485 print '<td class="right">';
486 $arrval = array('0' => $langs->trans("No"),
487 '1' => $langs->trans("Yes").' ('.$langs->trans("NumberOfKeyToSearch", 1).')',
488 '2' => $langs->trans("Yes").' ('.$langs->trans("NumberOfKeyToSearch", 2).')',
489 '3' => $langs->trans("Yes").' ('.$langs->trans("NumberOfKeyToSearch", 3).')',
490 );
491 print $form->selectarray("activate_BOM_USE_SEARCH_TO_SELECT", $arrval, getDolGlobalString("BOM_USE_SEARCH_TO_SELECT")).'</td>';
492 print '<td class="right"><input type="submit" class="button small reposition" name="BOM_USE_SEARCH_TO_SELECT" value="'.$langs->trans("Modify").'">';
493 print "</td>";
494}
495print '</form>';
496print '</tr>';
497
498$substitutionarray = pdf_getSubstitutionArray($langs, null, null, 2);
499$substitutionarray['__(AnyTranslationKey)__'] = $langs->trans("Translation");
500$htmltext = '<i>'.$langs->trans("AvailableVariables").':<br>';
501foreach ($substitutionarray as $key => $val) {
502 $htmltext .= $key.'<br>';
503}
504$htmltext .= '</i>';
505
506print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
507print '<input type="hidden" name="token" value="'.newToken().'">';
508print '<input type="hidden" name="action" value="set_BOM_FREE_TEXT">';
509print '<tr class="oddeven"><td colspan="2">';
510print $form->textwithpicto($langs->trans("FreeLegalTextOnBOMs"), $langs->trans("AddCRIfTooLong").'<br><br>'.$htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').'<br>';
511$variablename = 'BOM_FREE_TEXT';
512if (!getDolGlobalString('PDF_ALLOW_HTML_FOR_FREE_TEXT')) {
513 print '<textarea name="'.$variablename.'" class="flat" cols="120">'.getDolGlobalString($variablename).'</textarea>';
514} else {
515 include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
516 $doleditor = new DolEditor($variablename, getDolGlobalString($variablename), '', 80, 'dolibarr_notes');
517 print $doleditor->Create();
518}
519print '</td><td class="right">';
520print '<input type="submit" class="button button-edit small" value="'.$langs->trans("Modify").'">';
521print "</td></tr>\n";
522print '</form>';
523
524//Use draft Watermark
525
526print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
527print '<input type="hidden" name="token" value="'.newToken().'">';
528print '<input type="hidden" name="action" value="set_BOM_DRAFT_WATERMARK">';
529print '<tr class="oddeven"><td>';
530print $form->textwithpicto($langs->trans("WatermarkOnDraftBOMs"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').'<br>';
531print '</td><td>';
532print '<input class="flat minwidth200" type="text" name="BOM_DRAFT_WATERMARK" value="'.dol_escape_htmltag(getDolGlobalString('BOM_DRAFT_WATERMARK')).'">';
533print '</td><td class="right">';
534print '<input type="submit" class="button button-edit small" value="'.$langs->trans("Modify").'">';
535print "</td></tr>\n";
536print '</form>';
537
538print '</table>';
539print '</div>';
540print '<br>';
541
542
543
544
545// End of page
546llxFooter();
547$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.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
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.
newToken()
Return the value of token currently saved into session with name 'newtoken'.
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...
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.
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
Definition member.php:79
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:778
$conf db name
Only used if Module[ID]Name translation string is not found.
Definition repair.php:161
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.