dolibarr  20.0.0-beta
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
33 require '../main.inc.php';
34 require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
35 require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
36 require_once DOL_DOCUMENT_ROOT.'/core/lib/fourn.lib.php';
37 require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php';
38 require_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 
57 if (!$user->admin) {
59 }
60 
61 
62 /*
63  * Actions
64  */
65 
66 include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
67 
68 if ($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 
76  if ($maskconstinvoice && preg_match('/_MASK$/', $maskconstinvoice)) {
77  $res = dolibarr_set_const($db, $maskconstinvoice, $maskinvoice, 'chaine', 0, '', $conf->entity);
78  }
79  if ($maskconstcredit && preg_match('/_MASK$/', $maskconstcredit)) {
80  $res = dolibarr_set_const($db, $maskconstcredit, $maskcredit, 'chaine', 0, '', $conf->entity);
81  }
82  if ($maskconstdeposit && preg_match('/_MASK$/', $maskconstdeposit)) {
83  $res = dolibarr_set_const($db, $maskconstdeposit, $maskdeposit, 'chaine', 0, '', $conf->entity);
84  }
85 
86  if (!($res > 0)) {
87  $error++;
88  }
89 
90  if (!$error) {
91  setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
92  } else {
93  setEventMessages($langs->trans("Error"), null, 'errors');
94  }
95 }
96 
97 if ($action == 'specimen') { // For invoices
98  $modele = GETPOST('module', 'alpha');
99 
100  $facture = new FactureFournisseur($db);
101  $facture->initAsSpecimen();
102  $facture->thirdparty = $specimenthirdparty; // Define who should has build the invoice (so the supplier)
103 
104  // Search template files
105  $file = '';
106  $classname = '';
107  $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
108  foreach ($dirmodels as $reldir) {
109  $file = dol_buildpath($reldir."core/modules/supplier_invoice/doc/pdf_".$modele.".modules.php", 0);
110  if (file_exists($file)) {
111  $classname = "pdf_".$modele;
112  break;
113  }
114  }
115 
116  if ($classname !== '') {
117  require_once $file;
118 
119  $module = new $classname($db, $facture);
120  '@phan-var-force CommonDocGenerator $module';
121 
122  if ($module->write_file($facture, $langs) > 0) {
123  header("Location: ".DOL_URL_ROOT."/document.php?modulepart=facture_fournisseur&file=SPECIMEN.pdf");
124  return;
125  } else {
126  setEventMessages($module->error, $module->errors, 'errors');
127  dol_syslog($module->error, LOG_ERR);
128  }
129  } else {
130  setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
131  dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
132  }
133 } elseif ($action == 'set') {
134  // Activate a model
135  $ret = addDocumentModel($value, $type, $label, $scandir);
136 } elseif ($action == 'del') {
137  $ret = delDocumentModel($value, $type);
138  if ($ret > 0) {
139  if ($conf->global->INVOICE_SUPPLIER_ADDON_PDF == "$value") {
140  dolibarr_del_const($db, 'INVOICE_SUPPLIER_ADDON_PDF', $conf->entity);
141  }
142  }
143 } elseif ($action == 'setdoc') {
144  // Set default model
145  if (dolibarr_set_const($db, "INVOICE_SUPPLIER_ADDON_PDF", $value, 'chaine', 0, '', $conf->entity)) {
146  // La constante qui a ete lue en avant du nouveau set
147  // on passe donc par une variable pour avoir un affichage coherent
148  $conf->global->INVOICE_SUPPLIER_ADDON_PDF = $value;
149  }
150 
151  // On active le modele
152  $ret = delDocumentModel($value, $type);
153  if ($ret > 0) {
154  $ret = addDocumentModel($value, $type, $label, $scandir);
155  }
156 } elseif ($action == 'unsetdoc') {
157  dolibarr_del_const($db, "INVOICE_SUPPLIER_ADDON_PDF", $conf->entity);
158 }
159 
160 if ($action == 'setmod') {
161  // TODO Verify if the chosen numbering module can be activated
162  // by calling method canBeActivated
163 
164  dolibarr_set_const($db, "INVOICE_SUPPLIER_ADDON_NUMBER", $value, 'chaine', 0, '', $conf->entity);
165 }
166 
167 if ($action == 'addcat') {
168  $fourn = new Fournisseur($db);
169  $fourn->CreateCategory($user, GETPOST('cat', 'alphanohtml'));
170 }
171 
172 if ($action == 'set_SUPPLIER_INVOICE_FREE_TEXT') {
173  $freetext = GETPOST('SUPPLIER_INVOICE_FREE_TEXT', 'restricthtml'); // No alpha here, we want exact string
174 
175  $res = dolibarr_set_const($db, "SUPPLIER_INVOICE_FREE_TEXT", $freetext, 'chaine', 0, '', $conf->entity);
176 
177  if (!($res > 0)) {
178  $error++;
179  }
180 
181  if (!$error) {
182  setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
183  } else {
184  setEventMessages($langs->trans("Error"), null, 'errors');
185  }
186 }
187 
188 
189 /*
190  * View
191  */
192 
193 $form = new Form($db);
194 
195 $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
196 
197 llxHeader("", "");
198 
199 $linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
200 print load_fiche_titre($langs->trans("SuppliersSetup"), $linkback, 'title_setup');
201 
202 print "<br>";
203 
205 
206 print dol_get_fiche_head($head, 'invoice', $langs->trans("Suppliers"), -1, 'company');
207 
208 
209 // Supplier invoice numbering module
210 
211 print load_fiche_titre($langs->trans("SuppliersInvoiceNumberingModel"), '', '');
212 
213 print '<div class="div-table-responsive-no-min">';
214 print '<table class="noborder centpercent">';
215 print '<tr class="liste_titre">';
216 print '<td width="100">'.$langs->trans("Name").'</td>';
217 print '<td>'.$langs->trans("Description").'</td>';
218 print '<td>'.$langs->trans("Example").'</td>';
219 print '<td align="center" width="60">'.$langs->trans("Status").'</td>';
220 print '<td align="center" width="16">'.$langs->trans("ShortInfo").'</td>';
221 print "</tr>\n";
222 
223 clearstatcache();
224 
225 foreach ($dirmodels as $reldir) {
226  $dir = dol_buildpath($reldir."core/modules/supplier_invoice");
227 
228  if (is_dir($dir)) {
229  $handle = opendir($dir);
230  if (is_resource($handle)) {
231  while (($file = readdir($handle)) !== false) {
232  if (substr($file, 0, 24) == 'mod_facture_fournisseur_' && substr($file, dol_strlen($file) - 3, 3) == 'php') {
233  $file = substr($file, 0, dol_strlen($file) - 4);
234 
235  require_once $dir.'/'.$file.'.php';
236 
237  $module = new $file();
238 
239  if ($module->isEnabled()) {
240  // Show modules according to features level
241  if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
242  continue;
243  }
244  if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
245  continue;
246  }
247 
248 
249  print '<tr class="oddeven"><td>'.$module->nom."</td><td>\n";
250  print $module->info($langs);
251  print '</td>';
252 
253  // Show example of numbering module
254  print '<td class="nowrap">';
255  $tmp = $module->getExample();
256  if (preg_match('/^Error/', $tmp)) {
257  $langs->load("errors");
258  print '<div class="error">'.$langs->trans($tmp).'</div>';
259  } elseif ($tmp == 'NotConfigured') {
260  print '<span class="opacitymedium">'.$langs->trans($tmp).'</span>';
261  } else {
262  print $tmp;
263  }
264  print '</td>'."\n";
265 
266  print '<td class="center">';
267  if ($conf->global->INVOICE_SUPPLIER_ADDON_NUMBER == "$file") {
268  print img_picto($langs->trans("Activated"), 'switch_on');
269  } else {
270  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>';
271  }
272  print '</td>';
273 
274  $invoice = new FactureFournisseur($db);
275  $invoice->initAsSpecimen();
276 
277  // Info
278  $htmltooltip = '';
279  $htmltooltip .= ''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>';
280  $nextval = $module->getNextValue($mysoc, $invoice);
281  if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval
282  $htmltooltip .= ''.$langs->trans("NextValue").': ';
283  if ($nextval) {
284  if (preg_match('/^Error/', $nextval) || $nextval == 'NotConfigured') {
285  $nextval = $langs->trans($nextval);
286  }
287  $htmltooltip .= $nextval.'<br>';
288  } else {
289  $htmltooltip .= $langs->trans($module->error).'<br>';
290  }
291  }
292 
293  print '<td class="center">';
294  print $form->textwithpicto('', $htmltooltip, 1, 0);
295  print '</td>';
296 
297  print '</tr>';
298  }
299  }
300  }
301  closedir($handle);
302  }
303  }
304 }
305 
306 print '</table></div><br>';
307 
308 
309 
310 
311 /*
312  * Documents models for supplier invoices
313  */
314 
315 print load_fiche_titre($langs->trans("BillsPDFModules"), '', '');
316 
317 // Defini tableau def de modele
318 $def = array();
319 
320 $sql = "SELECT nom";
321 $sql .= " FROM ".MAIN_DB_PREFIX."document_model";
322 $sql .= " WHERE type = 'invoice_supplier'";
323 $sql .= " AND entity = ".$conf->entity;
324 
325 $resql = $db->query($sql);
326 if ($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 print '<div class="div-table-responsive-no-min">';
341 print '<table class="noborder centpercent">'."\n";
342 print '<tr class="liste_titre">'."\n";
343 print '<td width="100">'.$langs->trans("Name").'</td>'."\n";
344 print '<td>'.$langs->trans("Description").'</td>'."\n";
345 print '<td align="center" width="60">'.$langs->trans("Status").'</td>'."\n";
346 print '<td align="center" width="60">'.$langs->trans("Default").'</td>'."\n";
347 print '<td align="center" width="40">'.$langs->trans("ShortInfo").'</td>';
348 print '<td align="center" width="40">'.$langs->trans("Preview").'</td>';
349 print '</tr>'."\n";
350 
351 clearstatcache();
352 
353 foreach ($dirmodels as $reldir) {
354  $realpath = $reldir."core/modules/supplier_invoice/doc";
355  $dir = dol_buildpath($realpath);
356 
357  if (is_dir($dir)) {
358  $handle = opendir($dir);
359 
360 
361  if (is_resource($handle)) {
362  while (($file = readdir($handle)) !== false) {
363  if (preg_match('/\.modules\.php$/i', $file) && preg_match('/^(pdf_|doc_)/', $file)) {
364  $name = substr($file, 4, dol_strlen($file) - 16);
365  $classname = substr($file, 0, dol_strlen($file) - 12);
366 
367  require_once $dir.'/'.$file;
368  $module = new $classname($db, new FactureFournisseur($db));
369 
370 
371  print "<tr class=\"oddeven\">\n";
372  print "<td>";
373  print(empty($module->name) ? $name : $module->name);
374  print "</td>\n";
375  print "<td>\n";
376  require_once $dir.'/'.$file;
377  $module = new $classname($db, $specimenthirdparty);
378  if (method_exists($module, 'info')) {
379  print $module->info($langs);
380  } else {
381  print $module->description;
382  }
383 
384  print "</td>\n";
385 
386  // Active
387  if (in_array($name, $def)) {
388  print '<td class="center">'."\n";
389  //if ($conf->global->INVOICE_SUPPLIER_ADDON_PDF != "$name")
390  //{
391  // Even if choice is the default value, we allow to disable it: For supplier invoice, we accept to have no doc generation at all
392  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">';
393  print img_picto($langs->trans("Enabled"), 'switch_on');
394  print '</a>';
395  /*}
396  else
397  {
398  print img_picto($langs->trans("Enabled"),'switch_on');
399  }*/
400  print "</td>";
401  } else {
402  print '<td class="center">'."\n";
403  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>';
404  print "</td>";
405  }
406 
407  // Default
408  print '<td class="center">';
409  if (getDolGlobalString("INVOICE_SUPPLIER_ADDON_PDF") == "$name") {
410  //print img_picto($langs->trans("Default"),'on');
411  // Even if choice is the default value, we allow to disable it: For supplier invoice, we accept to have no doc generation at all
412  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>';
413  } else {
414  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>';
415  }
416  print '</td>';
417 
418  // Info
419  $htmltooltip = ''.$langs->trans("Name").': '.$module->name;
420  $htmltooltip .= '<br>'.$langs->trans("Type").': '.($module->type ? $module->type : $langs->trans("Unknown"));
421  $htmltooltip .= '<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
422  $htmltooltip .= '<br>'.$langs->trans("Path").': '.preg_replace('/^\//', '', $realpath).'/'.$file;
423 
424  $htmltooltip .= '<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
425  $htmltooltip .= '<br>'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1);
426  $htmltooltip .= '<br>'.$langs->trans("PaymentMode").': '.yn($module->option_modereg, 1, 1);
427  $htmltooltip .= '<br>'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg, 1, 1);
428  print '<td class="center">';
429  print $form->textwithpicto('', $htmltooltip, 1, 0);
430  print '</td>';
431  print '<td class="center">';
432  print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.urlencode($name).'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
433  print '</td>';
434 
435  print "</tr>\n";
436  }
437  }
438 
439  closedir($handle);
440  }
441  }
442 }
443 
444 print '</table></div><br>';
445 
446 /*
447  * Other options
448  */
449 
450 print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
451 print '<input type="hidden" name="token" value="'.newToken().'">';
452 print '<input type="hidden" name="action" value="set_SUPPLIER_INVOICE_FREE_TEXT">';
453 
454 print load_fiche_titre($langs->trans("OtherOptions"), '', '');
455 
456 print '<div class="div-table-responsive-no-min">';
457 print '<table class="noborder centpercent">';
458 print '<tr class="liste_titre">';
459 print '<td>'.$langs->trans("Parameter").'</td>';
460 print '<td align="center" width="60">'.$langs->trans("Value").'</td>';
461 print '<td width="80">&nbsp;</td>';
462 print "</tr>\n";
463 
464 $substitutionarray = pdf_getSubstitutionArray($langs, null, null, 2);
465 $substitutionarray['__(AnyTranslationKey)__'] = $langs->trans("Translation");
466 $htmltext = '<i>'.$langs->trans("AvailableVariables").':<br>';
467 foreach ($substitutionarray as $key => $val) {
468  $htmltext .= $key.'<br>';
469 }
470 $htmltext .= '</i>';
471 
472 print '<tr class="oddeven"><td colspan="2">';
473 print $form->textwithpicto($langs->trans("FreeLegalTextOnInvoices"), $langs->trans("AddCRIfTooLong").'<br><br>'.$htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').'<br>';
474 $variablename = 'SUPPLIER_INVOICE_FREE_TEXT';
475 if (!getDolGlobalString('PDF_ALLOW_HTML_FOR_FREE_TEXT')) {
476  print '<textarea name="'.$variablename.'" class="flat" cols="120">'.getDolGlobalString($variablename).'</textarea>';
477 } else {
478  include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
479  $doleditor = new DolEditor($variablename, getDolGlobalString($variablename), '', 80, 'dolibarr_notes');
480  print $doleditor->Create();
481 }
482 print '</td><td class="right">';
483 print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">';
484 print "</td></tr>\n";
485 
486 print '</table></div><br>';
487 
488 print '</form>';
489 
490 
491 /*
492  * Notifications
493  */
494 
495 print load_fiche_titre($langs->trans("Notifications"), '', '');
496 
497 print '<div class="div-table-responsive-no-min">';
498 print '<table class="noborder centpercent">';
499 print '<tr class="liste_titre">';
500 print '<td>'.$langs->trans("Parameter").'</td>';
501 print '<td align="center" width="60"></td>';
502 print '<td width="80">&nbsp;</td>';
503 print "</tr>\n";
504 
505 print '<tr class="oddeven"><td colspan="2">';
506 print $langs->trans("YouMayFindNotificationsFeaturesIntoModuleNotification").'<br>';
507 print '</td><td class="right">';
508 print "</td></tr>\n";
509 
510 print '</table>';
511 print '</div>';
512 
513 // End of page
514 llxFooter();
515 $db->close();
addDocumentModel($name, $type, $label='', $description='')
Add document model used by doc generator.
Definition: admin.lib.php:1940
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:656
dolibarr_del_const($db, $name, $entity=1)
Delete a constant.
Definition: admin.lib.php:580
delDocumentModel($name, $type)
Delete document model used by doc generator.
Definition: admin.lib.php:1971
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
Definition: wrapper.php:55
llxFooter()
Empty footer.
Definition: wrapper.php:69
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('invoice') && $user->hasRight('facture', 'lire')) if((isModEnabled('fournisseur') &&!getDolGlobalString('MAIN_USE_NEW_SUPPLIERMOD') && $user->hasRight("fournisseur", "facture", "lire"))||(isModEnabled('supplier_invoice') && $user->hasRight("supplier_invoice", "lire"))) if(isModEnabled('don') && $user->hasRight('don', 'lire')) if(isModEnabled('tax') && $user->hasRight('tax', 'charges', 'lire')) if(isModEnabled('invoice') &&isModEnabled('order') && $user->hasRight("commande", "lire") &&!getDolGlobalString('WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER')) $sql
Social contributions to pay.
Definition: index.php:745
supplierorder_admin_prepare_head()
Return array head with list of tabs to view object information.
Definition: fourn.lib.php:253
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)
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
yn($yesno, $case=1, $color=0)
Return yes or no in current language.
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'.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
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 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:769
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.