dolibarr 21.0.0-alpha
supplier_invoice.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3 * Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
4 * Copyright (C) 2005-2011 Regis Houssin <regis.houssin@inodbox.com>
5 * Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
6 * Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
7 * Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
8 * Copyright (C) 2011-2018 Philippe Grand <philippe.grand@atoo-net.com>
9 * Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
10 * Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 3 of the License, or
15 * (at your option) any later version.
16 *
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program. If not, see <https://www.gnu.org/licenses/>.
24 */
25
32// Load Dolibarr environment
33require '../main.inc.php';
34require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
35require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
36require_once DOL_DOCUMENT_ROOT.'/core/lib/fourn.lib.php';
37require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php';
38require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
39
40// Load translation files required by the page
41$langs->loadLangs(array("admin", "other", "orders"));
42
43$action = GETPOST('action', 'aZ09');
44
45$type = GETPOST('type', 'alpha');
46$value = GETPOST('value', 'alpha');
47$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php
48
49$label = GETPOST('label', 'alpha');
50$scandir = GETPOST('scan_dir', 'alpha');
51
52$specimenthirdparty = new Societe($db);
53$specimenthirdparty->initAsSpecimen();
54
55$error = 0;
56
57if (!$user->admin) {
59}
60
61
62/*
63 * Actions
64 */
65
66include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
67
68if ($action == 'updateMask') {
69 $maskconstinvoice = GETPOST('maskconstinvoice', 'aZ09');
70 $maskconstcredit = GETPOST('maskconstcredit', 'aZ09');
71 $maskconstdeposit = GETPOST('maskconstdeposit', 'aZ09');
72 $maskinvoice = GETPOST('maskinvoice', 'alpha');
73 $maskcredit = GETPOST('maskcredit', 'alpha');
74 $maskdeposit = GETPOST('maskdeposit', 'alpha');
75 $res = 0;
76
77 if ($maskconstinvoice && preg_match('/_MASK$/', $maskconstinvoice)) {
78 $res = dolibarr_set_const($db, $maskconstinvoice, $maskinvoice, 'chaine', 0, '', $conf->entity);
79 }
80 if ($maskconstcredit && preg_match('/_MASK$/', $maskconstcredit)) {
81 $res = dolibarr_set_const($db, $maskconstcredit, $maskcredit, 'chaine', 0, '', $conf->entity);
82 }
83 if ($maskconstdeposit && preg_match('/_MASK$/', $maskconstdeposit)) {
84 $res = dolibarr_set_const($db, $maskconstdeposit, $maskdeposit, 'chaine', 0, '', $conf->entity);
85 }
86
87 if (!($res > 0)) {
88 $error++;
89 }
90
91 if (!$error) {
92 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
93 } else {
94 setEventMessages($langs->trans("Error"), null, 'errors');
95 }
96}
97
98if ($action == 'specimen') { // For invoices
99 $modele = GETPOST('module', 'alpha');
100
101 $facture = new FactureFournisseur($db);
102 $facture->initAsSpecimen();
103 $facture->thirdparty = $specimenthirdparty; // Define who should has build the invoice (so the supplier)
104
105 // Search template files
106 $file = '';
107 $classname = '';
108 $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
109 foreach ($dirmodels as $reldir) {
110 $file = dol_buildpath($reldir."core/modules/supplier_invoice/doc/pdf_".$modele.".modules.php", 0);
111 if (file_exists($file)) {
112 $classname = "pdf_".$modele;
113 break;
114 }
115 }
116
117 if ($classname !== '') {
118 require_once $file;
119
120 $module = new $classname($db, $facture);
121 '@phan-var-force ModelePDFSuppliersInvoices $module';
122
123 if ($module->write_file($facture, $langs) > 0) {
124 header("Location: ".DOL_URL_ROOT."/document.php?modulepart=facture_fournisseur&file=SPECIMEN.pdf");
125 return;
126 } else {
127 setEventMessages($module->error, $module->errors, 'errors');
128 dol_syslog($module->error, LOG_ERR);
129 }
130 } else {
131 setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
132 dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
133 }
134} elseif ($action == 'set') {
135 // Activate a model
136 $ret = addDocumentModel($value, $type, $label, $scandir);
137} elseif ($action == 'del') {
138 $ret = delDocumentModel($value, $type);
139 if ($ret > 0) {
140 if ($conf->global->INVOICE_SUPPLIER_ADDON_PDF == "$value") {
141 dolibarr_del_const($db, 'INVOICE_SUPPLIER_ADDON_PDF', $conf->entity);
142 }
143 }
144} elseif ($action == 'setdoc') {
145 // Set default model
146 if (dolibarr_set_const($db, "INVOICE_SUPPLIER_ADDON_PDF", $value, 'chaine', 0, '', $conf->entity)) {
147 // La constante qui a ete lue en avant du nouveau set
148 // on passe donc par une variable pour avoir un affichage coherent
149 $conf->global->INVOICE_SUPPLIER_ADDON_PDF = $value;
150 }
151
152 // On active le modele
153 $ret = delDocumentModel($value, $type);
154 if ($ret > 0) {
155 $ret = addDocumentModel($value, $type, $label, $scandir);
156 }
157} elseif ($action == 'unsetdoc') {
158 dolibarr_del_const($db, "INVOICE_SUPPLIER_ADDON_PDF", $conf->entity);
159}
160
161if ($action == 'setmod') {
162 // TODO Verify if the chosen numbering module can be activated
163 // by calling method canBeActivated
164
165 dolibarr_set_const($db, "INVOICE_SUPPLIER_ADDON_NUMBER", $value, 'chaine', 0, '', $conf->entity);
166}
167
168if ($action == 'addcat') {
169 $fourn = new Fournisseur($db);
170 $fourn->CreateCategory($user, GETPOST('cat', 'alphanohtml'));
171}
172
173if ($action == 'set_SUPPLIER_INVOICE_FREE_TEXT') {
174 $freetext = GETPOST('SUPPLIER_INVOICE_FREE_TEXT', 'restricthtml'); // No alpha here, we want exact string
175
176 $res = dolibarr_set_const($db, "SUPPLIER_INVOICE_FREE_TEXT", $freetext, 'chaine', 0, '', $conf->entity);
177
178 if (!($res > 0)) {
179 $error++;
180 }
181
182 if (!$error) {
183 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
184 } else {
185 setEventMessages($langs->trans("Error"), null, 'errors');
186 }
187}
188
189
190/*
191 * View
192 */
193
194$form = new Form($db);
195
196$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
197
198llxHeader('', '', '', '', 0, 0, '', '', '', 'mod-admin page-supplier_invoice');
199
200$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
201print load_fiche_titre($langs->trans("SuppliersSetup"), $linkback, 'title_setup');
202
203print "<br>";
204
206
207print dol_get_fiche_head($head, 'invoice', $langs->trans("Suppliers"), -1, 'company');
208
209
210// Supplier invoice numbering module
211
212print load_fiche_titre($langs->trans("SuppliersInvoiceNumberingModel"), '', '');
213
214print '<div class="div-table-responsive-no-min">';
215print '<table class="noborder centpercent">';
216print '<tr class="liste_titre">';
217print '<td width="100">'.$langs->trans("Name").'</td>';
218print '<td>'.$langs->trans("Description").'</td>';
219print '<td>'.$langs->trans("Example").'</td>';
220print '<td align="center" width="60">'.$langs->trans("Status").'</td>';
221print '<td align="center" width="16">'.$langs->trans("ShortInfo").'</td>';
222print "</tr>\n";
223
224clearstatcache();
225
226foreach ($dirmodels as $reldir) {
227 $dir = dol_buildpath($reldir."core/modules/supplier_invoice");
228
229 if (is_dir($dir)) {
230 $handle = opendir($dir);
231 if (is_resource($handle)) {
232 while (($file = readdir($handle)) !== false) {
233 if (substr($file, 0, 24) == 'mod_facture_fournisseur_' && substr($file, dol_strlen($file) - 3, 3) == 'php') {
234 $file = substr($file, 0, dol_strlen($file) - 4);
235
236 require_once $dir.'/'.$file.'.php';
237
238 $module = new $file();
239
240 '@phan-var-force ModeleNumRefSuppliersInvoices $module';
241
242 if ($module->isEnabled()) {
243 // Show modules according to features level
244 if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
245 continue;
246 }
247 if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
248 continue;
249 }
250
251
252 print '<tr class="oddeven"><td>'.$module->getName($langs)."</td><td>\n";
253 print $module->info($langs);
254 print '</td>';
255
256 // Show example of numbering module
257 print '<td class="nowrap">';
258 $tmp = $module->getExample();
259 if (preg_match('/^Error/', $tmp)) {
260 $langs->load("errors");
261 print '<div class="error">'.$langs->trans($tmp).'</div>';
262 } elseif ($tmp == 'NotConfigured') {
263 print '<span class="opacitymedium">'.$langs->trans($tmp).'</span>';
264 } else {
265 print $tmp;
266 }
267 print '</td>'."\n";
268
269 print '<td class="center">';
270 if ($conf->global->INVOICE_SUPPLIER_ADDON_NUMBER == "$file") {
271 print img_picto($langs->trans("Activated"), 'switch_on');
272 } else {
273 print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setmod&token='.newToken().'&value='.urlencode($file).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
274 }
275 print '</td>';
276
277 $invoice = new FactureFournisseur($db);
278 $invoice->initAsSpecimen();
279
280 // Info
281 $htmltooltip = '';
282 $htmltooltip .= ''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>';
283 $nextval = $module->getNextValue($mysoc, $invoice);
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, 0);
298 print '</td>';
299
300 print '</tr>';
301 }
302 }
303 }
304 closedir($handle);
305 }
306 }
307}
308
309print '</table></div><br>';
310
311
312
313
314/*
315 * Documents models for supplier invoices
316 */
317
318print load_fiche_titre($langs->trans("BillsPDFModules"), '', '');
319
320// Defini tableau def de modele
321$def = array();
322
323$sql = "SELECT nom";
324$sql .= " FROM ".MAIN_DB_PREFIX."document_model";
325$sql .= " WHERE type = 'invoice_supplier'";
326$sql .= " AND entity = ".$conf->entity;
327
328$resql = $db->query($sql);
329if ($resql) {
330 $i = 0;
331 $num_rows = $db->num_rows($resql);
332 while ($i < $num_rows) {
333 $array = $db->fetch_array($resql);
334 if (is_array($array)) {
335 array_push($def, $array[0]);
336 }
337 $i++;
338 }
339} else {
340 dol_print_error($db);
341}
342
343print '<div class="div-table-responsive-no-min">';
344print '<table class="noborder centpercent">'."\n";
345print '<tr class="liste_titre">'."\n";
346print '<td width="100">'.$langs->trans("Name").'</td>'."\n";
347print '<td>'.$langs->trans("Description").'</td>'."\n";
348print '<td align="center" width="60">'.$langs->trans("Status").'</td>'."\n";
349print '<td align="center" width="60">'.$langs->trans("Default").'</td>'."\n";
350print '<td align="center" width="40">'.$langs->trans("ShortInfo").'</td>';
351print '<td align="center" width="40">'.$langs->trans("Preview").'</td>';
352print '</tr>'."\n";
353
354clearstatcache();
355
356foreach ($dirmodels as $reldir) {
357 $realpath = $reldir."core/modules/supplier_invoice/doc";
358 $dir = dol_buildpath($realpath);
359
360 if (is_dir($dir)) {
361 $handle = opendir($dir);
362
363
364 if (is_resource($handle)) {
365 while (($file = readdir($handle)) !== false) {
366 if (preg_match('/\.modules\.php$/i', $file) && preg_match('/^(pdf_|doc_)/', $file)) {
367 $name = substr($file, 4, dol_strlen($file) - 16);
368 $classname = substr($file, 0, dol_strlen($file) - 12);
369
370 require_once $dir.'/'.$file;
371 $module = new $classname($db, new FactureFournisseur($db));
372
373 '@phan-var-force ModelePDFSuppliersInvoices $module';
374
375
376 print "<tr class=\"oddeven\">\n";
377 print "<td>";
378 print(empty($module->name) ? $name : $module->name);
379 print "</td>\n";
380 print "<td>\n";
381 require_once $dir.'/'.$file;
382 $module = new $classname($db, $specimenthirdparty);
383 '@phan-var-force ModelePDFSuppliersInvoices $module';
384 if (method_exists($module, 'info')) {
385 print $module->info($langs); // @phan-suppress-current-line PhanUndeclaredMethod
386 } else {
387 print $module->description;
388 }
389
390 print "</td>\n";
391
392 // Active
393 if (in_array($name, $def)) {
394 print '<td class="center">'."\n";
395 //if ($conf->global->INVOICE_SUPPLIER_ADDON_PDF != "$name")
396 //{
397 // Even if choice is the default value, we allow to disable it: For supplier invoice, we accept to have no doc generation at all
398 print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=del&token='.newToken().'&value='.urlencode($name).'&scan_dir='.urlencode($module->scandir).'&label='.urlencode($module->name).'&amp;type=invoice_supplier">';
399 print img_picto($langs->trans("Enabled"), 'switch_on');
400 print '</a>';
401 /*}
402 else
403 {
404 print img_picto($langs->trans("Enabled"),'switch_on');
405 }*/
406 print "</td>";
407 } else {
408 print '<td class="center">'."\n";
409 print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=set&token='.newToken().'&value='.urlencode($name).'&scan_dir='.urlencode($module->scandir).'&label='.urlencode($module->name).'&amp;type=invoice_supplier">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
410 print "</td>";
411 }
412
413 // Default
414 print '<td class="center">';
415 if (getDolGlobalString("INVOICE_SUPPLIER_ADDON_PDF") == "$name") {
416 //print img_picto($langs->trans("Default"),'on');
417 // Even if choice is the default value, we allow to disable it: For supplier invoice, we accept to have no doc generation at all
418 print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=unsetdoc&token='.newToken().'&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'&type=invoice_supplier"" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"), 'on').'</a>';
419 } else {
420 print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setdoc&token='.newToken().'&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'&type=invoice_supplier"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
421 }
422 print '</td>';
423
424 // Info
425 $htmltooltip = ''.$langs->trans("Name").': '.$module->name;
426 $htmltooltip .= '<br>'.$langs->trans("Type").': '.($module->type ? $module->type : $langs->trans("Unknown"));
427 $htmltooltip .= '<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
428 $htmltooltip .= '<br>'.$langs->trans("Path").': '.preg_replace('/^\//', '', $realpath).'/'.$file;
429
430 $htmltooltip .= '<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
431 $htmltooltip .= '<br>'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1);
432 $htmltooltip .= '<br>'.$langs->trans("PaymentMode").': '.yn($module->option_modereg, 1, 1);
433 $htmltooltip .= '<br>'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg, 1, 1);
434 print '<td class="center">';
435 print $form->textwithpicto('', $htmltooltip, 1, 0);
436 print '</td>';
437 print '<td class="center">';
438 print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.urlencode($name).'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
439 print '</td>';
440
441 print "</tr>\n";
442 }
443 }
444
445 closedir($handle);
446 }
447 }
448}
449
450print '</table></div><br>';
451
452/*
453 * Other options
454 */
455
456print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
457print '<input type="hidden" name="token" value="'.newToken().'">';
458print '<input type="hidden" name="action" value="set_SUPPLIER_INVOICE_FREE_TEXT">';
459
460print load_fiche_titre($langs->trans("OtherOptions"), '', '');
461
462print '<div class="div-table-responsive-no-min">';
463print '<table class="noborder centpercent">';
464print '<tr class="liste_titre">';
465print '<td>'.$langs->trans("Parameter").'</td>';
466print '<td align="center" width="60">'.$langs->trans("Value").'</td>';
467print '<td width="80">&nbsp;</td>';
468print "</tr>\n";
469
470$substitutionarray = pdf_getSubstitutionArray($langs, null, null, 2);
471$substitutionarray['__(AnyTranslationKey)__'] = $langs->trans("Translation");
472$htmltext = '<i>'.$langs->trans("AvailableVariables").':<br>';
473foreach ($substitutionarray as $key => $val) {
474 $htmltext .= $key.'<br>';
475}
476$htmltext .= '</i>';
477
478print '<tr class="oddeven"><td colspan="2">';
479print $form->textwithpicto($langs->trans("FreeLegalTextOnInvoices"), $langs->trans("AddCRIfTooLong").'<br><br>'.$htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').'<br>';
480$variablename = 'SUPPLIER_INVOICE_FREE_TEXT';
481if (!getDolGlobalString('PDF_ALLOW_HTML_FOR_FREE_TEXT')) {
482 print '<textarea name="'.$variablename.'" class="flat" cols="120">'.getDolGlobalString($variablename).'</textarea>';
483} else {
484 include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
485 $doleditor = new DolEditor($variablename, getDolGlobalString($variablename), '', 80, 'dolibarr_notes');
486 print $doleditor->Create();
487}
488print '</td><td class="right">';
489print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">';
490print "</td></tr>\n";
491
492print '</table></div><br>';
493
494print '</form>';
495
496
497/*
498 * Notifications
499 */
500
501print load_fiche_titre($langs->trans("Notifications"), '', '');
502
503print '<div class="div-table-responsive-no-min">';
504print '<table class="noborder centpercent">';
505print '<tr class="liste_titre">';
506print '<td>'.$langs->trans("Parameter").'</td>';
507print '<td align="center" width="60"></td>';
508print '<td width="80">&nbsp;</td>';
509print "</tr>\n";
510
511print '<tr class="oddeven"><td colspan="2">';
512print $langs->trans("YouMayFindNotificationsFeaturesIntoModuleNotification").'<br>';
513print '</td><td class="right">';
514print "</td></tr>\n";
515
516print '</table>';
517print '</div>';
518
519// End of page
520llxFooter();
521$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.
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:70
Class to manage a WYSIWYG editor.
Class to manage suppliers invoices.
Class to manage generation of HTML components Only common components must be here.
Class to manage suppliers.
Class to manage third parties objects (customers, suppliers, prospects...)
llxFooter()
Footer empty.
Definition document.php:107
supplierorder_admin_prepare_head()
Return array head with list of tabs to view object information.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0)
Show a picto called object_picto (generic function)
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)
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)
Show tabs of a record.
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.
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:765
$conf db name
Only used if Module[ID]Name translation string is not found.
Definition repair.php:140
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.