dolibarr  19.0.0-dev
expensereport.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2003-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3  * Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
4  * Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
5  * Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
6  * Copyright (C) 2005-2014 Regis Houssin <regis.houssin@inodbox.com>
7  * Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
8  * Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
9  * Copyright (C) 2011-2022 Philippe Grand <philippe.grand@atoo-net.com>
10  *
11  * This program is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License as published by
13  * the Free Software Foundation; either version 3 of the License, or
14  * (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program. If not, see <https://www.gnu.org/licenses/>.
23  */
24 
31 // Load Dolibarr environment
32 require '../main.inc.php';
33 require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
34 require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
35 require_once DOL_DOCUMENT_ROOT.'/core/lib/expensereport.lib.php';
36 require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php';
37 
38 // Load translation files required by the page
39 $langs->loadLangs(array('admin', 'errors', 'trips', 'other'));
40 
41 if (!$user->admin) {
43 }
44 
45 $action = GETPOST('action', 'aZ09');
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 $type = 'expensereport';
52 
53 
54 /*
55  * Actions
56  */
57 
58 include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
59 
60 if ($action == 'updateMask') {
61  $maskconst = GETPOST('maskconst', 'aZ09');
62  $maskvalue = GETPOST('maskvalue', 'alpha');
63  if ($maskconst && preg_match('/_MASK$/', $maskconst)) {
64  $res = dolibarr_set_const($db, $maskconst, $maskvalue, 'chaine', 0, '', $conf->entity);
65  }
66 
67  if (!($res > 0)) {
68  $error++;
69  }
70 
71  if (!$error) {
72  setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
73  } else {
74  setEventMessages($langs->trans("Error"), null, 'errors');
75  }
76 } elseif ($action == 'specimen') { // For fiche expensereport
77  $modele = GETPOST('module', 'alpha');
78 
79  $expensespecimen = new ExpenseReport($db);
80  $expensespecimen->initAsSpecimen();
81  $expensespecimen->status = 0; // Force statut draft to show watermark
82 
83  // Search template files
84  $file = ''; $classname = ''; $filefound = 0;
85  $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
86  foreach ($dirmodels as $reldir) {
87  $file = dol_buildpath($reldir."core/modules/expensereport/doc/pdf_".$modele.".modules.php", 0);
88  if (file_exists($file)) {
89  $filefound = 1;
90  $classname = "pdf_".$modele;
91  break;
92  }
93  }
94 
95  if ($filefound) {
96  require_once $file;
97 
98  $module = new $classname($db);
99 
100  if ($module->write_file($expensespecimen, $langs) > 0) {
101  header("Location: ".DOL_URL_ROOT."/document.php?modulepart=expensereport&file=SPECIMEN.pdf");
102  return;
103  } else {
104  setEventMessages($module->error, $module->errors, 'errors');
105  dol_syslog($module->error, LOG_ERR);
106  }
107  } else {
108  setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
109  dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
110  }
111 } elseif ($action == 'set') {
112  // Activate a model
113  $ret = addDocumentModel($value, $type, $label, $scandir);
114  if ($ret > 0 && empty($conf->global->EXPENSEREPORT_ADDON_PDF)) {
115  dolibarr_set_const($db, 'EXPENSEREPORT_ADDON_PDF', $value, 'chaine', 0, '', $conf->entity);
116  }
117 } elseif ($action == 'del') {
118  $ret = delDocumentModel($value, $type);
119  if ($ret > 0) {
120  if ($conf->global->EXPENSEREPORT_ADDON_PDF == "$value") {
121  dolibarr_del_const($db, 'EXPENSEREPORT_ADDON_PDF', $conf->entity);
122  }
123  }
124 } elseif ($action == 'setdoc') {
125  // Set default model
126  if (dolibarr_set_const($db, "EXPENSEREPORT_ADDON_PDF", $value, 'chaine', 0, '', $conf->entity)) {
127  // La constante qui a ete lue en avant du nouveau set
128  // on passe donc par une variable pour avoir un affichage coherent
129  $conf->global->EXPENSEREPORT_ADDON_PDF = $value;
130  }
131 
132  // On active le modele
133  $ret = delDocumentModel($value, $type);
134  if ($ret > 0) {
135  $ret = addDocumentModel($value, $type, $label, $scandir);
136  }
137 } elseif ($action == 'setmod') {
138  // TODO Verifier si module numerotation choisi peut etre active
139  // par appel methode canBeActivated
140 
141  dolibarr_set_const($db, "EXPENSEREPORT_ADDON", $value, 'chaine', 0, '', $conf->entity);
142 } elseif ($action == 'setoptions') {
143  $db->begin();
144 
145  $freetext = GETPOST('EXPENSEREPORT_FREE_TEXT', 'restricthtml'); // No alpha here, we want exact string
146  $res1 = dolibarr_set_const($db, "EXPENSEREPORT_FREE_TEXT", $freetext, 'chaine', 0, '', $conf->entity);
147 
148  $draft = GETPOST('EXPENSEREPORT_DRAFT_WATERMARK', 'alpha');
149  $res2 = dolibarr_set_const($db, "EXPENSEREPORT_DRAFT_WATERMARK", trim($draft), 'chaine', 0, '', $conf->entity);
150 
151  $res3 = 0;
152  if (isModEnabled('project') && GETPOSTISSET('EXPENSEREPORT_PROJECT_IS_REQUIRED')) { // Option may not be provided
153  $res3 = dolibarr_set_const($db, 'EXPENSEREPORT_PROJECT_IS_REQUIRED', GETPOST('EXPENSEREPORT_PROJECT_IS_REQUIRED', 'int'), 'chaine', 0, '', $conf->entity);
154  }
155 
156  $dates = GETPOST('EXPENSEREPORT_PREFILL_DATES_WITH_CURRENT_MONTH', 'int');
157  $res4 = dolibarr_set_const($db, 'EXPENSEREPORT_PREFILL_DATES_WITH_CURRENT_MONTH', intval($dates), 'chaine', 0, '', $conf->entity);
158 
159  $amounts = GETPOST('EXPENSEREPORT_FORCE_LINE_AMOUNTS_INCLUDING_TAXES_ONLY', 'int');
160  $res5 = dolibarr_set_const($db, 'EXPENSEREPORT_FORCE_LINE_AMOUNTS_INCLUDING_TAXES_ONLY', intval($amounts), 'chaine', 0, '', $conf->entity);
161 
162  if (!($res1 > 0) || !($res2 > 0) || !($res3 >= 0) || !($res4 >0) || !($res5 >0)) {
163  $error++;
164  }
165 
166  if (!$error) {
167  $db->commit();
168  setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
169  } else {
170  $db->rollback();
171  setEventMessages($langs->trans("Error"), null, 'errors');
172  }
173 }
174 
175 
176 /*
177  * View
178  */
179 
180 $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
181 
182 llxHeader('', $langs->trans("ExpenseReportsSetup"));
183 
184 $form = new Form($db);
185 
186 $linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
187 print load_fiche_titre($langs->trans("ExpenseReportsSetup"), $linkback, 'title_setup');
188 
189 
191 
192 print dol_get_fiche_head($head, 'expensereport', $langs->trans("ExpenseReports"), -1, 'trip');
193 
194 /*
195  * Expense report numbering model
196  */
197 
198 print load_fiche_titre($langs->trans("ExpenseReportNumberingModules"), '', '');
199 
200 print '<table class="noborder centpercent">';
201 print '<tr class="liste_titre">';
202 print '<td>'.$langs->trans("Name").'</td>';
203 print '<td>'.$langs->trans("Description").'</td>';
204 print '<td class="nowrap">'.$langs->trans("Example").'</td>';
205 print '<td class="center" width="60">'.$langs->trans("Status").'</td>';
206 print '<td class="center" width="16">'.$langs->trans("ShortInfo").'</td>';
207 print '</tr>'."\n";
208 
209 clearstatcache();
210 
211 foreach ($dirmodels as $reldir) {
212  $dir = dol_buildpath($reldir."core/modules/expensereport/");
213 
214  if (is_dir($dir)) {
215  $handle = opendir($dir);
216  if (is_resource($handle)) {
217  while (($file = readdir($handle)) !== false) {
218  if (substr($file, 0, 18) == 'mod_expensereport_' && substr($file, dol_strlen($file) - 3, 3) == 'php') {
219  $file = substr($file, 0, dol_strlen($file) - 4);
220 
221  require_once $dir.$file.'.php';
222 
223  $module = new $file($db);
224 
225  // Show modules according to features level
226  if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
227  continue;
228  }
229  if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
230  continue;
231  }
232 
233  if ($module->isEnabled()) {
234  print '<tr class="oddeven"><td>'.$module->nom."</td><td>\n";
235  print $module->info();
236  print '</td>';
237 
238  // Show example of numbering model
239  print '<td class="nowrap">';
240  $tmp = $module->getExample();
241  if (preg_match('/^Error/', $tmp)) {
242  $langs->load("errors");
243  print '<div class="error">'.$langs->trans($tmp).'</div>';
244  } elseif ($tmp == 'NotConfigured') {
245  print '<span class="opacitymedium">'.$langs->trans($tmp).'</span>';
246  } else {
247  print $tmp;
248  }
249  print '</td>'."\n";
250 
251  print '<td class="center">';
252  if ($conf->global->EXPENSEREPORT_ADDON == $file) {
253  print img_picto($langs->trans("Activated"), 'switch_on');
254  } else {
255  print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setmod&token='.newToken().'&value='.urlencode($file).'">';
256  print img_picto($langs->trans("Disabled"), 'switch_off');
257  print '</a>';
258  }
259  print '</td>';
260 
261  $exp = new ExpenseReport($db);
262  $exp->initAsSpecimen();
263 
264  // Info
265  $htmltooltip = '';
266  $htmltooltip .= ''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>';
267  $nextval = $module->getNextValue($exp);
268  if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval
269  $htmltooltip .= ''.$langs->trans("NextValue").': ';
270  if ($nextval) {
271  if (preg_match('/^Error/', $nextval) || $nextval == 'NotConfigured') {
272  $nextval = $langs->trans($nextval);
273  }
274  $htmltooltip .= $nextval.'<br>';
275  } else {
276  $htmltooltip .= $langs->trans($module->error).'<br>';
277  }
278  }
279 
280  print '<td class="center">';
281  print $form->textwithpicto('', $htmltooltip, 1, 0);
282  print '</td>';
283 
284  print "</tr>\n";
285  }
286  }
287  }
288  closedir($handle);
289  }
290  }
291 }
292 print "</table><br>\n";
293 
294 /*
295  * Documents models for ExpenseReport
296  */
297 
298 print load_fiche_titre($langs->trans("TemplatePDFExpenseReports"), '', '');
299 
300 // Defini tableau def des modeles
301 $type = 'expensereport';
302 $def = array();
303 $sql = "SELECT nom";
304 $sql .= " FROM ".MAIN_DB_PREFIX."document_model";
305 $sql .= " WHERE type = '".$db->escape($type)."'";
306 $sql .= " AND entity = ".$conf->entity;
307 $resql = $db->query($sql);
308 if ($resql) {
309  $i = 0;
310  $num_rows = $db->num_rows($resql);
311  while ($i < $num_rows) {
312  $array = $db->fetch_array($resql);
313  array_push($def, $array[0]);
314  $i++;
315  }
316 } else {
317  dol_print_error($db);
318 }
319 
320 print '<table class="noborder centpercent">';
321 print '<tr class="liste_titre">';
322 print '<td>'.$langs->trans("Name").'</td>';
323 print '<td>'.$langs->trans("Description").'</td>';
324 print '<td class="center" width="60">'.$langs->trans("Status")."</td>\n";
325 print '<td class="center" width="60">'.$langs->trans("Default")."</td>\n";
326 print '<td class="center" width="80">'.$langs->trans("ShortInfo").'</td>';
327 print '<td class="center" width="80">'.$langs->trans("Preview").'</td>';
328 print "</tr>\n";
329 
330 clearstatcache();
331 
332 foreach ($dirmodels as $reldir) {
333  $dir = dol_buildpath($reldir."core/modules/expensereport/doc");
334 
335  if (is_dir($dir)) {
336  $handle = opendir($dir);
337  if (is_resource($handle)) {
338  while (($file = readdir($handle)) !== false) {
339  $filelist[] = $file;
340  }
341  closedir($handle);
342  arsort($filelist);
343 
344  foreach ($filelist as $file) {
345  if (preg_match('/\.modules\.php$/i', $file) && preg_match('/^(pdf_|doc_)/', $file)) {
346  if (file_exists($dir.'/'.$file)) {
347  $name = substr($file, 4, dol_strlen($file) - 16);
348  $classname = substr($file, 0, dol_strlen($file) - 12);
349 
350  require_once $dir.'/'.$file;
351  $module = new $classname($db);
352 
353  $modulequalified = 1;
354  if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
355  $modulequalified = 0;
356  }
357  if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
358  $modulequalified = 0;
359  }
360 
361  if ($modulequalified) {
362  print '<tr class="oddeven"><td width="100">';
363  print (empty($module->name) ? $name : $module->name);
364  print "</td><td>\n";
365  if (method_exists($module, 'info')) {
366  print $module->info($langs);
367  } else {
368  print $module->description;
369  }
370  print '</td>';
371 
372  // Active
373  if (in_array($name, $def)) {
374  print '<td class="center">'."\n";
375  print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&token='.newToken().'&value='.urlencode($name).'&scan_dir='.urlencode($module->scandir).'&label='.urlencode($module->name).'">';
376  print img_picto($langs->trans("Enabled"), 'switch_on');
377  print '</a>';
378  print "</td>";
379  } else {
380  print '<td class="center">'."\n";
381  print '<a 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>';
382  print "</td>";
383  }
384 
385  // Default
386  print '<td class="center">';
387  if ($conf->global->EXPENSEREPORT_ADDON_PDF == "$name") {
388  print img_picto($langs->trans("Default"), 'on');
389  } else {
390  print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&token='.newToken().'&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
391  }
392  print '</td>';
393 
394  // Info
395  $htmltooltip = ''.$langs->trans("Name").': '.$module->name;
396  $htmltooltip .= '<br>'.$langs->trans("Type").': '.($module->type ? $module->type : $langs->trans("Unknown"));
397  $htmltooltip .= '<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
398  $htmltooltip .= '<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
399  $htmltooltip .= '<br>'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1);
400  $htmltooltip .= '<br>'.$langs->trans("PaymentMode").': '.yn($module->option_modereg, 1, 1);
401  $htmltooltip .= '<br>'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg, 1, 1);
402  $htmltooltip .= '<br>'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1);
403  $htmltooltip .= '<br>'.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark, 1, 1);
404  print '<td class="center">';
405  print $form->textwithpicto('', $htmltooltip, -1, 0);
406  print '</td>';
407 
408  // Preview
409  print '<td class="center">';
410  if ($module->type == 'pdf') {
411  print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
412  } else {
413  print img_object($langs->trans("PreviewNotAvailable"), 'generic');
414  }
415  print '</td>';
416 
417  print '</tr>';
418  }
419  }
420  }
421  }
422  }
423  }
424 }
425 
426 print '</table>';
427 
428 
429 print '<br>';
430 
431 
432 
433 /*
434  * Other options
435  */
436 
437 print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
438 print '<input type="hidden" name="token" value="'.newToken().'">';
439 print '<input type="hidden" name="action" value="setoptions">';
440 
441 print load_fiche_titre($langs->trans("OtherOptions"), '', '');
442 print '<table class="noborder centpercent">';
443 print '<tr class="liste_titre">';
444 print '<td>'.$langs->trans("Parameter").'</td>';
445 print '<td class="center" width="60"></td>';
446 print "</tr>\n";
447 
448 $substitutionarray = pdf_getSubstitutionArray($langs, null, null, 2);
449 $substitutionarray['__(AnyTranslationKey)__'] = $langs->trans("Translation");
450 $htmltext = '<i>'.$langs->trans("AvailableVariables").':<br>';
451 foreach ($substitutionarray as $key => $val) {
452  $htmltext .= $key.'<br>';
453 }
454 $htmltext .= '</i>';
455 
456 print '<tr class="oddeven"><td colspan="2">';
457 print $form->textwithpicto($langs->trans("FreeLegalTextOnExpenseReports"), $langs->trans("AddCRIfTooLong").'<br><br>'.$htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').'<br>';
458 $variablename = 'EXPENSEREPORT_FREE_TEXT';
459 if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) {
460  print '<textarea name="'.$variablename.'" class="flat" cols="120">'.getDolGlobalString($variablename).'</textarea>';
461 } else {
462  include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
463  $doleditor = new DolEditor($variablename, getDolGlobalString($variablename), '', 80, 'dolibarr_notes');
464  print $doleditor->Create();
465 }
466 print '</td></tr>'."\n";
467 
468 // Use draft Watermark
469 
470 print '<tr class="oddeven"><td colspan="2">';
471 print $form->textwithpicto($langs->trans("WatermarkOnDraftExpenseReports"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').'<br>';
472 print '<input class="flat minwidth200" type="text" name="EXPENSEREPORT_DRAFT_WATERMARK" value="'.dol_escape_htmltag(getDolGlobalString('EXPENSEREPORT_DRAFT_WATERMARK')).'">';
473 print '</td></tr>'."\n";
474 
475 if (isModEnabled('project')) {
476  print '<tr class="oddeven"><td>';
477  print $langs->trans('ProjectIsRequiredOnExpenseReports');
478  print '</td><td class="right">';
479  print $form->selectyesno('EXPENSEREPORT_PROJECT_IS_REQUIRED', empty($conf->global->EXPENSEREPORT_PROJECT_IS_REQUIRED) ? 0 : 1, 1);
480  print '</td></tr>';
481 }
482 
483 print '<tr class="oddeven"><td>';
484 print $langs->trans('PrefillExpenseReportDatesWithCurrentMonth');
485 print '</td><td class="right">';
486 print $form->selectyesno('EXPENSEREPORT_PREFILL_DATES_WITH_CURRENT_MONTH', empty($conf->global->EXPENSEREPORT_PREFILL_DATES_WITH_CURRENT_MONTH) ? 0 : 1, 1);
487 print '</td></tr>';
488 
489 print '<tr class="oddeven"><td>';
490 print $langs->trans('ForceExpenseReportsLineAmountsIncludingTaxesOnly');
491 print '</td><td class="right">';
492 print $form->selectyesno('EXPENSEREPORT_FORCE_LINE_AMOUNTS_INCLUDING_TAXES_ONLY', empty($conf->global->EXPENSEREPORT_FORCE_LINE_AMOUNTS_INCLUDING_TAXES_ONLY) ? 0 : 1, 1);
493 print '</td></tr>';
494 
495 print '</table>';
496 
497 print $form->buttonsSaveCancel("Save", '');
498 
499 print '</form>';
500 
501 print dol_get_fiche_end();
502 
503 // End of page
504 llxFooter();
505 $db->close();
addDocumentModel($name, $type, $label='', $description='')
Add document model used by doc generator.
Definition: admin.lib.php:1918
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:638
dolibarr_del_const($db, $name, $entity=1)
Delete a constant.
Definition: admin.lib.php:562
delDocumentModel($name, $type)
Delete document model used by doc generator.
Definition: admin.lib.php:1949
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 Trips and Expenses.
Class to manage generation of HTML components Only common components must be here.
if(isModEnabled('facture') && $user->hasRight('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') && $user->hasRight('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)) $sql
Social contributions to pay.
Definition: index.php:746
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
Definition: card.php:143
expensereport_admin_prepare_head()
Return array head with list of tabs to view object informations.
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
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_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)
dol_get_fiche_end($notab=0)
Return tab footer of a card.
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.
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.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
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:753
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.