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