dolibarr  17.0.4
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  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 3 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program. If not, see <https://www.gnu.org/licenses/>.
22  */
23 
30 // Load Dolibarr environment
31 require '../main.inc.php';
32 require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
33 require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
34 require_once DOL_DOCUMENT_ROOT.'/core/lib/fourn.lib.php';
35 require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php';
36 require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
37 
38 // Load translation files required by the page
39 $langs->loadLangs(array("admin", "other", "orders"));
40 
41 $action = GETPOST('action', 'aZ09');
42 
43 $type = GETPOST('type', 'alpha');
44 $value = GETPOST('value', 'alpha');
45 $modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php
46 
47 $label = GETPOST('label', 'alpha');
48 $scandir = GETPOST('scan_dir', 'alpha');
49 
50 $specimenthirdparty = new Societe($db);
51 $specimenthirdparty->initAsSpecimen();
52 
53 $error = 0;
54 
55 if (!$user->admin) {
57 }
58 
59 
60 /*
61  * Actions
62  */
63 
64 if ($action == 'updateMask') {
65  $maskconstinvoice = GETPOST('maskconstinvoice', 'aZ09');
66  $maskconstcredit = GETPOST('maskconstcredit', 'aZ09');
67  $maskconstdeposit = GETPOST('maskconstdeposit', 'aZ09');
68  $maskinvoice = GETPOST('maskinvoice', 'alpha');
69  $maskcredit = GETPOST('maskcredit', 'alpha');
70  $maskdeposit = GETPOST('maskdeposit', 'alpha');
71 
72  if ($maskconstinvoice && preg_match('/_MASK$/', $maskconstinvoice)) {
73  $res = dolibarr_set_const($db, $maskconstinvoice, $maskinvoice, 'chaine', 0, '', $conf->entity);
74  }
75  if ($maskconstcredit && preg_match('/_MASK$/', $maskconstcredit)) {
76  $res = dolibarr_set_const($db, $maskconstcredit, $maskcredit, 'chaine', 0, '', $conf->entity);
77  }
78  if ($maskconstdeposit && preg_match('/_MASK$/', $maskconstdeposit)) {
79  $res = dolibarr_set_const($db, $maskconstdeposit, $maskdeposit, 'chaine', 0, '', $conf->entity);
80  }
81 
82  if (!($res > 0)) {
83  $error++;
84  }
85 
86  if (!$error) {
87  setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
88  } else {
89  setEventMessages($langs->trans("Error"), null, 'errors');
90  }
91 }
92 
93 if ($action == 'specimen') { // For invoices
94  $modele = GETPOST('module', 'alpha');
95 
96  $facture = new FactureFournisseur($db);
97  $facture->initAsSpecimen();
98  $facture->thirdparty = $specimenthirdparty; // Define who should has build the invoice (so the supplier)
99 
100  // Search template files
101  $file = '';
102  $classname = '';
103  $filefound = 0;
104  $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
105  foreach ($dirmodels as $reldir) {
106  $file = dol_buildpath($reldir."core/modules/supplier_invoice/doc/pdf_".$modele.".modules.php", 0);
107  if (file_exists($file)) {
108  $filefound = 1;
109  $classname = "pdf_".$modele;
110  break;
111  }
112  }
113 
114  if ($filefound) {
115  require_once $file;
116 
117  $module = new $classname($db, $facture);
118 
119  if ($module->write_file($facture, $langs) > 0) {
120  header("Location: ".DOL_URL_ROOT."/document.php?modulepart=facture_fournisseur&file=SPECIMEN.pdf");
121  return;
122  } else {
123  setEventMessages($module->error, $module->errors, 'errors');
124  dol_syslog($module->error, LOG_ERR);
125  }
126  } else {
127  setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
128  dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
129  }
130 } elseif ($action == 'set') {
131  // Activate a model
132  $ret = addDocumentModel($value, $type, $label, $scandir);
133 } elseif ($action == 'del') {
134  $ret = delDocumentModel($value, $type);
135  if ($ret > 0) {
136  if ($conf->global->INVOICE_SUPPLIER_ADDON_PDF == "$value") {
137  dolibarr_del_const($db, 'INVOICE_SUPPLIER_ADDON_PDF', $conf->entity);
138  }
139  }
140 } elseif ($action == 'setdoc') {
141  // Set default model
142  if (dolibarr_set_const($db, "INVOICE_SUPPLIER_ADDON_PDF", $value, 'chaine', 0, '', $conf->entity)) {
143  // La constante qui a ete lue en avant du nouveau set
144  // on passe donc par une variable pour avoir un affichage coherent
145  $conf->global->INVOICE_SUPPLIER_ADDON_PDF = $value;
146  }
147 
148  // On active le modele
149  $ret = delDocumentModel($value, $type);
150  if ($ret > 0) {
151  $ret = addDocumentModel($value, $type, $label, $scandir);
152  }
153 } elseif ($action == 'unsetdoc') {
154  dolibarr_del_const($db, "INVOICE_SUPPLIER_ADDON_PDF", $conf->entity);
155 }
156 
157 if ($action == 'setmod') {
158  // TODO Verifier si module numerotation choisi peut etre active
159  // par appel methode canBeActivated
160 
161  dolibarr_set_const($db, "INVOICE_SUPPLIER_ADDON_NUMBER", $value, 'chaine', 0, '', $conf->entity);
162 }
163 
164 if ($action == 'addcat') {
165  $fourn = new Fournisseur($db);
166  $fourn->CreateCategory($user, GETPOST('cat', 'alphanohtml'));
167 }
168 
169 if ($action == 'set_SUPPLIER_INVOICE_FREE_TEXT') {
170  $freetext = GETPOST('SUPPLIER_INVOICE_FREE_TEXT', 'restricthtml'); // No alpha here, we want exact string
171 
172  $res = dolibarr_set_const($db, "SUPPLIER_INVOICE_FREE_TEXT", $freetext, 'chaine', 0, '', $conf->entity);
173 
174  if (!($res > 0)) {
175  $error++;
176  }
177 
178  if (!$error) {
179  setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
180  } else {
181  setEventMessages($langs->trans("Error"), null, 'errors');
182  }
183 }
184 
185 
186 /*
187  * View
188  */
189 
190 $form = new Form($db);
191 
192 $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
193 
194 llxHeader("", "");
195 
196 $linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
197 print load_fiche_titre($langs->trans("SuppliersSetup"), $linkback, 'title_setup');
198 
199 print "<br>";
200 
202 
203 print dol_get_fiche_head($head, 'invoice', $langs->trans("Suppliers"), -1, 'company');
204 
205 
206 // Supplier invoice numbering module
207 
208 print load_fiche_titre($langs->trans("SuppliersInvoiceNumberingModel"), '', '');
209 
210 print '<div class="div-table-responsive-no-min">';
211 print '<table class="noborder centpercent">';
212 print '<tr class="liste_titre">';
213 print '<td width="100">'.$langs->trans("Name").'</td>';
214 print '<td>'.$langs->trans("Description").'</td>';
215 print '<td>'.$langs->trans("Example").'</td>';
216 print '<td align="center" width="60">'.$langs->trans("Status").'</td>';
217 print '<td align="center" width="16">'.$langs->trans("ShortInfo").'</td>';
218 print "</tr>\n";
219 
220 clearstatcache();
221 
222 foreach ($dirmodels as $reldir) {
223  $dir = dol_buildpath($reldir."core/modules/supplier_invoice");
224 
225  if (is_dir($dir)) {
226  $handle = opendir($dir);
227  if (is_resource($handle)) {
228  while (($file = readdir($handle)) !== false) {
229  if (substr($file, 0, 24) == 'mod_facture_fournisseur_' && substr($file, dol_strlen($file) - 3, 3) == 'php') {
230  $file = substr($file, 0, dol_strlen($file) - 4);
231 
232  require_once $dir.'/'.$file.'.php';
233 
234  $module = new $file;
235 
236  if ($module->isEnabled()) {
237  // Show modules according to features level
238  if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
239  continue;
240  }
241  if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
242  continue;
243  }
244 
245 
246  print '<tr class="oddeven"><td>'.$module->nom."</td><td>\n";
247  print $module->info();
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 ($conf->global->INVOICE_SUPPLIER_ADDON_NUMBER == "$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).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
268  }
269  print '</td>';
270 
271  $invoice = new FactureFournisseur($db);
272  $invoice->initAsSpecimen();
273 
274  // Info
275  $htmltooltip = '';
276  $htmltooltip .= ''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>';
277  $nextval = $module->getNextValue($mysoc, $invoice);
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, 0);
292  print '</td>';
293 
294  print '</tr>';
295  }
296  }
297  }
298  closedir($handle);
299  }
300  }
301 }
302 
303 print '</table></div><br>';
304 
305 
306 
307 
308 /*
309  * Documents models for supplier invoices
310  */
311 
312 print load_fiche_titre($langs->trans("BillsPDFModules"), '', '');
313 
314 // Defini tableau def de modele
315 $def = array();
316 
317 $sql = "SELECT nom";
318 $sql .= " FROM ".MAIN_DB_PREFIX."document_model";
319 $sql .= " WHERE type = 'invoice_supplier'";
320 $sql .= " AND entity = ".$conf->entity;
321 
322 $resql = $db->query($sql);
323 if ($resql) {
324  $i = 0;
325  $num_rows = $db->num_rows($resql);
326  while ($i < $num_rows) {
327  $array = $db->fetch_array($resql);
328  array_push($def, $array[0]);
329  $i++;
330  }
331 } else {
332  dol_print_error($db);
333 }
334 
335 print '<div class="div-table-responsive-no-min">';
336 print '<table class="noborder centpercent">'."\n";
337 print '<tr class="liste_titre">'."\n";
338 print '<td width="100">'.$langs->trans("Name").'</td>'."\n";
339 print '<td>'.$langs->trans("Description").'</td>'."\n";
340 print '<td align="center" width="60">'.$langs->trans("Status").'</td>'."\n";
341 print '<td align="center" width="60">'.$langs->trans("Default").'</td>'."\n";
342 print '<td align="center" width="40">'.$langs->trans("ShortInfo").'</td>';
343 print '<td align="center" width="40">'.$langs->trans("Preview").'</td>';
344 print '</tr>'."\n";
345 
346 clearstatcache();
347 
348 foreach ($dirmodels as $reldir) {
349  $realpath = $reldir."core/modules/supplier_invoice/doc";
350  $dir = dol_buildpath($realpath);
351 
352  if (is_dir($dir)) {
353  $handle = opendir($dir);
354 
355 
356  if (is_resource($handle)) {
357  while (($file = readdir($handle)) !== false) {
358  if (preg_match('/\.modules\.php$/i', $file) && preg_match('/^(pdf_|doc_)/', $file)) {
359  $name = substr($file, 4, dol_strlen($file) - 16);
360  $classname = substr($file, 0, dol_strlen($file) - 12);
361 
362  require_once $dir.'/'.$file;
363  $module = new $classname($db, new FactureFournisseur($db));
364 
365 
366  print "<tr class=\"oddeven\">\n";
367  print "<td>";
368  print (empty($module->name) ? $name : $module->name);
369  print "</td>\n";
370  print "<td>\n";
371  require_once $dir.'/'.$file;
372  $module = new $classname($db, $specimenthirdparty);
373  if (method_exists($module, 'info')) {
374  print $module->info($langs);
375  } else {
376  print $module->description;
377  }
378 
379  print "</td>\n";
380 
381  // Active
382  if (in_array($name, $def)) {
383  print '<td class="center">'."\n";
384  //if ($conf->global->INVOICE_SUPPLIER_ADDON_PDF != "$name")
385  //{
386  // Even if choice is the default value, we allow to disable it: For supplier invoice, we accept to have no doc generation at all
387  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">';
388  print img_picto($langs->trans("Enabled"), 'switch_on');
389  print '</a>';
390  /*}
391  else
392  {
393  print img_picto($langs->trans("Enabled"),'switch_on');
394  }*/
395  print "</td>";
396  } else {
397  print '<td class="center">'."\n";
398  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>';
399  print "</td>";
400  }
401 
402  // Default
403  print '<td class="center">';
404  if (getDolGlobalString("INVOICE_SUPPLIER_ADDON_PDF") == "$name") {
405  //print img_picto($langs->trans("Default"),'on');
406  // Even if choice is the default value, we allow to disable it: For supplier invoice, we accept to have no doc generation at all
407  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>';
408  } else {
409  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>';
410  }
411  print '</td>';
412 
413  // Info
414  $htmltooltip = ''.$langs->trans("Name").': '.$module->name;
415  $htmltooltip .= '<br>'.$langs->trans("Type").': '.($module->type ? $module->type : $langs->trans("Unknown"));
416  $htmltooltip .= '<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
417  $htmltooltip .= '<br>'.$langs->trans("Path").': '.preg_replace('/^\//', '', $realpath).'/'.$file;
418 
419  $htmltooltip .= '<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
420  $htmltooltip .= '<br>'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1);
421  $htmltooltip .= '<br>'.$langs->trans("PaymentMode").': '.yn($module->option_modereg, 1, 1);
422  $htmltooltip .= '<br>'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg, 1, 1);
423  print '<td class="center">';
424  print $form->textwithpicto('', $htmltooltip, 1, 0);
425  print '</td>';
426  print '<td class="center">';
427  print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.urlencode($name).'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
428  print '</td>';
429 
430  print "</tr>\n";
431  }
432  }
433 
434  closedir($handle);
435  }
436  }
437 }
438 
439 print '</table></div><br>';
440 
441 /*
442  * Other options
443  */
444 
445 print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
446 print '<input type="hidden" name="token" value="'.newToken().'">';
447 print '<input type="hidden" name="action" value="set_SUPPLIER_INVOICE_FREE_TEXT">';
448 
449 print load_fiche_titre($langs->trans("OtherOptions"), '', '');
450 
451 print '<div class="div-table-responsive-no-min">';
452 print '<table class="noborder centpercent">';
453 print '<tr class="liste_titre">';
454 print '<td>'.$langs->trans("Parameter").'</td>';
455 print '<td align="center" width="60">'.$langs->trans("Value").'</td>';
456 print '<td width="80">&nbsp;</td>';
457 print "</tr>\n";
458 
459 $substitutionarray = pdf_getSubstitutionArray($langs, null, null, 2);
460 $substitutionarray['__(AnyTranslationKey)__'] = $langs->trans("Translation");
461 $htmltext = '<i>'.$langs->trans("AvailableVariables").':<br>';
462 foreach ($substitutionarray as $key => $val) {
463  $htmltext .= $key.'<br>';
464 }
465 $htmltext .= '</i>';
466 
467 print '<tr class="oddeven"><td colspan="2">';
468 print $form->textwithpicto($langs->trans("FreeLegalTextOnInvoices"), $langs->trans("AddCRIfTooLong").'<br><br>'.$htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').'<br>';
469 $variablename = 'SUPPLIER_INVOICE_FREE_TEXT';
470 if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) {
471  print '<textarea name="'.$variablename.'" class="flat" cols="120">'.getDolGlobalString($variablename).'</textarea>';
472 } else {
473  include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
474  $doleditor = new DolEditor($variablename, getDolGlobalString($variablename), '', 80, 'dolibarr_notes');
475  print $doleditor->Create();
476 }
477 print '</td><td class="right">';
478 print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">';
479 print "</td></tr>\n";
480 
481 print '</table></div><br>';
482 
483 print '</form>';
484 
485 
486 /*
487  * Notifications
488  */
489 
490 print load_fiche_titre($langs->trans("Notifications"), '', '');
491 
492 print '<div class="div-table-responsive-no-min">';
493 print '<table class="noborder centpercent">';
494 print '<tr class="liste_titre">';
495 print '<td>'.$langs->trans("Parameter").'</td>';
496 print '<td align="center" width="60"></td>';
497 print '<td width="80">&nbsp;</td>';
498 print "</tr>\n";
499 
500 print '<tr class="oddeven"><td colspan="2">';
501 print $langs->trans("YouMayFindNotificationsFeaturesIntoModuleNotification").'<br>';
502 print '</td><td class="right">';
503 print "</td></tr>\n";
504 
505 print '</table>';
506 print '</div>';
507 
508 // End of page
509 llxFooter();
510 $db->close();
addDocumentModel($name, $type, $label='', $description='')
Add document model used by doc generator.
Definition: admin.lib.php:1888
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).
Definition: admin.lib.php:632
dolibarr_del_const($db, $name, $entity=1)
Delete a constant.
Definition: admin.lib.php:556
delDocumentModel($name, $type)
Delete document model used by doc generator.
Definition: admin.lib.php:1919
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
Definition: wrapper.php:56
llxFooter()
Empty footer.
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...)
if(isModEnabled('facture') &&!empty($user->rights->facture->lire)) if((isModEnabled('fournisseur') &&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->hasRight("fournisseur", "facture", "lire"))||(isModEnabled('supplier_invoice') && $user->hasRight("supplier_invoice", "lire"))) if(isModEnabled('don') &&!empty($user->rights->don->lire)) if(isModEnabled('tax') &&!empty($user->rights->tax->charges->lire)) if(isModEnabled('facture') &&isModEnabled('commande') && $user->hasRight("commande", "lire") &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $resql
Social contributions to pay.
Definition: index.php:745
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
Definition: card.php:143
supplierorder_admin_prepare_head()
Return array head with list of tabs to view object informations.
Definition: fourn.lib.php:251
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='')
Show tabs of a record.
yn($yesno, $case=1, $color=0)
Return yes or no in current language.
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0)
Show a picto called object_picto (generic function)
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='')
Set event messages in dol_events session object.
dol_strlen($string, $stringencoding='UTF-8')
Make a strlen call.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
newToken()
Return the value of token currently saved into session with name 'newtoken'.
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.
if(!function_exists('utf8_encode')) if(!function_exists('utf8_decode')) getDolGlobalString($key, $default='')
Return 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)
Return array of possible substitutions for PDF content (without external module substitutions).
Definition: pdf.lib.php:749
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.