dolibarr  16.0.5
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-2018 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 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/expensereport.lib.php';
35 require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php';
36 
37 // Load translation files required by the page
38 $langs->loadLangs(array('admin', 'errors', 'trips', 'other'));
39 
40 if (!$user->admin) {
42 }
43 
44 $action = GETPOST('action', 'aZ09');
45 $value = GETPOST('value', 'alpha');
46 $modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php
47 
48 $label = GETPOST('label', 'alpha');
49 $scandir = GETPOST('scan_dir', 'alpha');
50 $type = 'expensereport';
51 
52 
53 /*
54  * Actions
55  */
56 
57 include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
58 
59 if ($action == 'updateMask') {
60  $maskconst = GETPOST('maskconst', 'alpha');
61  $maskvalue = GETPOST('maskvalue', 'alpha');
62  if ($maskconst) {
63  $res = dolibarr_set_const($db, $maskconst, $maskvalue, 'chaine', 0, '', $conf->entity);
64  }
65 
66  if (!($res > 0)) {
67  $error++;
68  }
69 
70  if (!$error) {
71  setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
72  } else {
73  setEventMessages($langs->trans("Error"), null, 'errors');
74  }
75 } elseif ($action == 'specimen') { // For fiche expensereport
76  $modele = GETPOST('module', 'alpha');
77 
78  $expensespecimen = new ExpenseReport($db);
79  $expensespecimen->initAsSpecimen();
80  $expensespecimen->status = 0; // Force statut draft to show watermark
81 
82  // Search template files
83  $file = ''; $classname = ''; $filefound = 0;
84  $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
85  foreach ($dirmodels as $reldir) {
86  $file = dol_buildpath($reldir."core/modules/expensereport/doc/pdf_".$modele.".modules.php", 0);
87  if (file_exists($file)) {
88  $filefound = 1;
89  $classname = "pdf_".$modele;
90  break;
91  }
92  }
93 
94  if ($filefound) {
95  require_once $file;
96 
97  $module = new $classname($db);
98 
99  if ($module->write_file($expensespecimen, $langs) > 0) {
100  header("Location: ".DOL_URL_ROOT."/document.php?modulepart=expensereport&file=SPECIMEN.pdf");
101  return;
102  } else {
103  setEventMessages($module->error, $module->errors, 'errors');
104  dol_syslog($module->error, LOG_ERR);
105  }
106  } else {
107  setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
108  dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
109  }
110 } elseif ($action == 'set') {
111  // Activate a model
112  $ret = addDocumentModel($value, $type, $label, $scandir);
113  if ($ret > 0 && empty($conf->global->EXPENSEREPORT_ADDON_PDF)) {
114  dolibarr_set_const($db, 'EXPENSEREPORT_ADDON_PDF', $value, 'chaine', 0, '', $conf->entity);
115  }
116 } elseif ($action == 'del') {
117  $ret = delDocumentModel($value, $type);
118  if ($ret > 0) {
119  if ($conf->global->EXPENSEREPORT_ADDON_PDF == "$value") {
120  dolibarr_del_const($db, 'EXPENSEREPORT_ADDON_PDF', $conf->entity);
121  }
122  }
123 } elseif ($action == 'setdoc') {
124  // Set default model
125  if (dolibarr_set_const($db, "EXPENSEREPORT_ADDON_PDF", $value, 'chaine', 0, '', $conf->entity)) {
126  // La constante qui a ete lue en avant du nouveau set
127  // on passe donc par une variable pour avoir un affichage coherent
128  $conf->global->EXPENSEREPORT_ADDON_PDF = $value;
129  }
130 
131  // On active le modele
132  $ret = delDocumentModel($value, $type);
133  if ($ret > 0) {
134  $ret = addDocumentModel($value, $type, $label, $scandir);
135  }
136 } elseif ($action == 'setmod') {
137  // TODO Verifier si module numerotation choisi peut etre active
138  // par appel methode canBeActivated
139 
140  dolibarr_set_const($db, "EXPENSEREPORT_ADDON", $value, 'chaine', 0, '', $conf->entity);
141 } elseif ($action == 'setoptions') {
142  $db->begin();
143 
144  $freetext = GETPOST('EXPENSEREPORT_FREE_TEXT', 'restricthtml'); // No alpha here, we want exact string
145  $res1 = dolibarr_set_const($db, "EXPENSEREPORT_FREE_TEXT", $freetext, 'chaine', 0, '', $conf->entity);
146 
147  $draft = GETPOST('EXPENSEREPORT_DRAFT_WATERMARK', 'alpha');
148  $res2 = dolibarr_set_const($db, "EXPENSEREPORT_DRAFT_WATERMARK", trim($draft), 'chaine', 0, '', $conf->entity);
149 
150  $res3 = 0;
151  if (!empty($conf->project->enabled) && GETPOSTISSET('EXPENSEREPORT_PROJECT_IS_REQUIRED')) { // Option may not be provided
152  $res3 = dolibarr_set_const($db, 'EXPENSEREPORT_PROJECT_IS_REQUIRED', GETPOST('EXPENSEREPORT_PROJECT_IS_REQUIRED', 'int'), 'chaine', 0, '', $conf->entity);
153  }
154 
155  $dates = GETPOST('EXPENSEREPORT_PREFILL_DATES_WITH_CURRENT_MONTH', 'int');
156  $res4 = dolibarr_set_const($db, 'EXPENSEREPORT_PREFILL_DATES_WITH_CURRENT_MONTH', intval($dates), 'chaine', 0, '', $conf->entity);
157 
158  $amounts = GETPOST('EXPENSEREPORT_FORCE_LINE_AMOUNTS_INCLUDING_TAXES_ONLY', 'int');
159  $res5 = dolibarr_set_const($db, 'EXPENSEREPORT_FORCE_LINE_AMOUNTS_INCLUDING_TAXES_ONLY', intval($amounts), 'chaine', 0, '', $conf->entity);
160 
161  if (!($res1 > 0) || !($res2 > 0) || !($res3 >= 0) || !($res4 >0) || !($res5 >0)) {
162  $error++;
163  }
164 
165  if (!$error) {
166  $db->commit();
167  setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
168  } else {
169  $db->rollback();
170  setEventMessages($langs->trans("Error"), null, 'errors');
171  }
172 }
173 
174 
175 /*
176  * View
177  */
178 
179 $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
180 
181 llxHeader('', $langs->trans("ExpenseReportsSetup"));
182 
183 $form = new Form($db);
184 
185 $linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
186 print load_fiche_titre($langs->trans("ExpenseReportsSetup"), $linkback, 'title_setup');
187 
188 
190 
191 print dol_get_fiche_head($head, 'expensereport', $langs->trans("ExpenseReports"), -1, 'trip');
192 
193 /*
194  * Expense report numbering model
195  */
196 
197 print load_fiche_titre($langs->trans("ExpenseReportNumberingModules"), '', '');
198 
199 print '<table class="noborder centpercent">';
200 print '<tr class="liste_titre">';
201 print '<td>'.$langs->trans("Name").'</td>';
202 print '<td>'.$langs->trans("Description").'</td>';
203 print '<td class="nowrap">'.$langs->trans("Example").'</td>';
204 print '<td class="center" width="60">'.$langs->trans("Status").'</td>';
205 print '<td class="center" width="16">'.$langs->trans("ShortInfo").'</td>';
206 print '</tr>'."\n";
207 
208 clearstatcache();
209 
210 foreach ($dirmodels as $reldir) {
211  $dir = dol_buildpath($reldir."core/modules/expensereport/");
212 
213  if (is_dir($dir)) {
214  $handle = opendir($dir);
215  if (is_resource($handle)) {
216  while (($file = readdir($handle)) !== false) {
217  if (substr($file, 0, 18) == 'mod_expensereport_' && substr($file, dol_strlen($file) - 3, 3) == 'php') {
218  $file = substr($file, 0, dol_strlen($file) - 4);
219 
220  require_once $dir.$file.'.php';
221 
222  $module = new $file($db);
223 
224  // Show modules according to features level
225  if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
226  continue;
227  }
228  if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
229  continue;
230  }
231 
232  if ($module->isEnabled()) {
233  print '<tr class="oddeven"><td>'.$module->nom."</td><td>\n";
234  print $module->info();
235  print '</td>';
236 
237  // Show example of numbering model
238  print '<td class="nowrap">';
239  $tmp = $module->getExample();
240  if (preg_match('/^Error/', $tmp)) {
241  $langs->load("errors");
242  print '<div class="error">'.$langs->trans($tmp).'</div>';
243  } elseif ($tmp == 'NotConfigured') {
244  print '<span class="opacitymedium">'.$langs->trans($tmp).'</span>';
245  } else {
246  print $tmp;
247  }
248  print '</td>'."\n";
249 
250  print '<td class="center">';
251  if ($conf->global->EXPENSEREPORT_ADDON == $file) {
252  print img_picto($langs->trans("Activated"), 'switch_on');
253  } else {
254  print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setmod&token='.newToken().'&value='.urlencode($file).'">';
255  print img_picto($langs->trans("Disabled"), 'switch_off');
256  print '</a>';
257  }
258  print '</td>';
259 
260  $exp = new ExpenseReport($db);
261  $exp->initAsSpecimen();
262 
263  // Info
264  $htmltooltip = '';
265  $htmltooltip .= ''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>';
266  $nextval = $module->getNextValue($exp);
267  if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval
268  $htmltooltip .= ''.$langs->trans("NextValue").': ';
269  if ($nextval) {
270  if (preg_match('/^Error/', $nextval) || $nextval == 'NotConfigured') {
271  $nextval = $langs->trans($nextval);
272  }
273  $htmltooltip .= $nextval.'<br>';
274  } else {
275  $htmltooltip .= $langs->trans($module->error).'<br>';
276  }
277  }
278 
279  print '<td class="center">';
280  print $form->textwithpicto('', $htmltooltip, 1, 0);
281  print '</td>';
282 
283  print "</tr>\n";
284  }
285  }
286  }
287  closedir($handle);
288  }
289  }
290 }
291 print "</table><br>\n";
292 
293 /*
294  * Documents models for ExpenseReport
295  */
296 
297 print load_fiche_titre($langs->trans("TemplatePDFExpenseReports"), '', '');
298 
299 // Defini tableau def des modeles
300 $type = 'expensereport';
301 $def = array();
302 $sql = "SELECT nom";
303 $sql .= " FROM ".MAIN_DB_PREFIX."document_model";
304 $sql .= " WHERE type = '".$db->escape($type)."'";
305 $sql .= " AND entity = ".$conf->entity;
306 $resql = $db->query($sql);
307 if ($resql) {
308  $i = 0;
309  $num_rows = $db->num_rows($resql);
310  while ($i < $num_rows) {
311  $array = $db->fetch_array($resql);
312  array_push($def, $array[0]);
313  $i++;
314  }
315 } else {
316  dol_print_error($db);
317 }
318 
319 print '<table class="noborder centpercent">';
320 print '<tr class="liste_titre">';
321 print '<td>'.$langs->trans("Name").'</td>';
322 print '<td>'.$langs->trans("Description").'</td>';
323 print '<td class="center" width="60">'.$langs->trans("Status")."</td>\n";
324 print '<td class="center" width="60">'.$langs->trans("Default")."</td>\n";
325 print '<td class="center" width="80">'.$langs->trans("ShortInfo").'</td>';
326 print '<td class="center" width="80">'.$langs->trans("Preview").'</td>';
327 print "</tr>\n";
328 
329 clearstatcache();
330 
331 foreach ($dirmodels as $reldir) {
332  $dir = dol_buildpath($reldir."core/modules/expensereport/doc");
333 
334  if (is_dir($dir)) {
335  $handle = opendir($dir);
336  if (is_resource($handle)) {
337  while (($file = readdir($handle)) !== false) {
338  $filelist[] = $file;
339  }
340  closedir($handle);
341  arsort($filelist);
342 
343  foreach ($filelist as $file) {
344  if (preg_match('/\.modules\.php$/i', $file) && preg_match('/^(pdf_|doc_)/', $file)) {
345  if (file_exists($dir.'/'.$file)) {
346  $name = substr($file, 4, dol_strlen($file) - 16);
347  $classname = substr($file, 0, dol_strlen($file) - 12);
348 
349  require_once $dir.'/'.$file;
350  $module = new $classname($db);
351 
352  $modulequalified = 1;
353  if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
354  $modulequalified = 0;
355  }
356  if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
357  $modulequalified = 0;
358  }
359 
360  if ($modulequalified) {
361  print '<tr class="oddeven"><td width="100">';
362  print (empty($module->name) ? $name : $module->name);
363  print "</td><td>\n";
364  if (method_exists($module, 'info')) {
365  print $module->info($langs);
366  } else {
367  print $module->description;
368  }
369  print '</td>';
370 
371  // Active
372  if (in_array($name, $def)) {
373  print '<td class="center">'."\n";
374  print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&token='.newToken().'&value='.urlencode($name).'&scan_dir='.urlencode($module->scandir).'&label='.urlencode($module->name).'">';
375  print img_picto($langs->trans("Enabled"), 'switch_on');
376  print '</a>';
377  print "</td>";
378  } else {
379  print '<td class="center">'."\n";
380  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>';
381  print "</td>";
382  }
383 
384  // Default
385  print '<td class="center">';
386  if ($conf->global->EXPENSEREPORT_ADDON_PDF == "$name") {
387  print img_picto($langs->trans("Default"), 'on');
388  } else {
389  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>';
390  }
391  print '</td>';
392 
393  // Info
394  $htmltooltip = ''.$langs->trans("Name").': '.$module->name;
395  $htmltooltip .= '<br>'.$langs->trans("Type").': '.($module->type ? $module->type : $langs->trans("Unknown"));
396  $htmltooltip .= '<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
397  $htmltooltip .= '<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
398  $htmltooltip .= '<br>'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1);
399  $htmltooltip .= '<br>'.$langs->trans("PaymentMode").': '.yn($module->option_modereg, 1, 1);
400  $htmltooltip .= '<br>'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg, 1, 1);
401  $htmltooltip .= '<br>'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1);
402  $htmltooltip .= '<br>'.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark, 1, 1);
403  print '<td class="center">';
404  print $form->textwithpicto('', $htmltooltip, -1, 0);
405  print '</td>';
406 
407  // Preview
408  print '<td class="center">';
409  if ($module->type == 'pdf') {
410  print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
411  } else {
412  print img_object($langs->trans("PreviewNotAvailable"), 'generic');
413  }
414  print '</td>';
415 
416  print '</tr>';
417  }
418  }
419  }
420  }
421  }
422  }
423 }
424 
425 print '</table>';
426 
427 
428 print '<br>';
429 
430 
431 
432 /*
433  * Other options
434  */
435 
436 print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
437 print '<input type="hidden" name="token" value="'.newToken().'">';
438 print '<input type="hidden" name="action" value="setoptions">';
439 
440 print load_fiche_titre($langs->trans("OtherOptions"), '', '');
441 print '<table class="noborder centpercent">';
442 print '<tr class="liste_titre">';
443 print '<td>'.$langs->trans("Parameter").'</td>';
444 print '<td class="center" width="60"></td>';
445 print "</tr>\n";
446 
447 $substitutionarray = pdf_getSubstitutionArray($langs, null, null, 2);
448 $substitutionarray['__(AnyTranslationKey)__'] = $langs->trans("Translation");
449 $htmltext = '<i>'.$langs->trans("AvailableVariables").':<br>';
450 foreach ($substitutionarray as $key => $val) {
451  $htmltext .= $key.'<br>';
452 }
453 $htmltext .= '</i>';
454 
455 print '<tr class="oddeven"><td colspan="2">';
456 print $form->textwithpicto($langs->trans("FreeLegalTextOnExpenseReports"), $langs->trans("AddCRIfTooLong").'<br><br>'.$htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').'<br>';
457 $variablename = 'EXPENSEREPORT_FREE_TEXT';
458 if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) {
459  print '<textarea name="'.$variablename.'" class="flat" cols="120">'.getDolGlobalString($variablename).'</textarea>';
460 } else {
461  include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
462  $doleditor = new DolEditor($variablename, getDolGlobalString($variablename), '', 80, 'dolibarr_notes');
463  print $doleditor->Create();
464 }
465 print '</td></tr>'."\n";
466 
467 // Use draft Watermark
468 
469 print '<tr class="oddeven"><td colspan="2">';
470 print $form->textwithpicto($langs->trans("WatermarkOnDraftExpenseReports"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').'<br>';
471 print '<input class="flat minwidth200" type="text" name="EXPENSEREPORT_DRAFT_WATERMARK" value="'.dol_escape_htmltag(getDolGlobalString('EXPENSEREPORT_DRAFT_WATERMARK')).'">';
472 print '</td></tr>'."\n";
473 
474 if (!empty($conf->project->enabled)) {
475  print '<tr class="oddeven"><td>';
476  print $langs->trans('ProjectIsRequiredOnExpenseReports');
477  print '</td><td class="right">';
478  print $form->selectyesno('EXPENSEREPORT_PROJECT_IS_REQUIRED', empty($conf->global->EXPENSEREPORT_PROJECT_IS_REQUIRED) ? 0 : 1, 1);
479  print '</td></tr>';
480 }
481 
482 print '<tr class="oddeven"><td>';
483 print $langs->trans('PrefillExpenseReportDatesWithCurrentMonth');
484 print '</td><td class="right">';
485 print $form->selectyesno('EXPENSEREPORT_PREFILL_DATES_WITH_CURRENT_MONTH', empty($conf->global->EXPENSEREPORT_PREFILL_DATES_WITH_CURRENT_MONTH) ? 0 : 1, 1);
486 print '</td></tr>';
487 
488 print '<tr class="oddeven"><td>';
489 print $langs->trans('ForceExpenseReportsLineAmountsIncludingTaxesOnly');
490 print '</td><td class="right">';
491 print $form->selectyesno('EXPENSEREPORT_FORCE_LINE_AMOUNTS_INCLUDING_TAXES_ONLY', empty($conf->global->EXPENSEREPORT_FORCE_LINE_AMOUNTS_INCLUDING_TAXES_ONLY) ? 0 : 1, 1);
492 print '</td></tr>';
493 
494 print '</table>';
495 
496 print $form->buttonsSaveCancel("Save", '');
497 
498 print '</form>';
499 
500 print dol_get_fiche_end();
501 
502 // End of page
503 llxFooter();
504 $db->close();
yn
yn($yesno, $case=1, $color=0)
Return yes or no in current language.
Definition: functions.lib.php:6491
llxFooter
llxFooter()
Empty footer.
Definition: wrapper.php:73
dolibarr_del_const
dolibarr_del_const($db, $name, $entity=1)
Delete a constant.
Definition: admin.lib.php:552
load_fiche_titre
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
Definition: functions.lib.php:5204
GETPOST
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
Definition: functions.lib.php:484
dol_print_error
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
Definition: functions.lib.php:4844
dol_buildpath
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
Definition: functions.lib.php:1062
$form
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
Definition: card.php:142
img_picto
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
Definition: functions.lib.php:3880
delDocumentModel
delDocumentModel($name, $type)
Delete document model used by doc generator.
Definition: admin.lib.php:1894
expensereport_admin_prepare_head
expensereport_admin_prepare_head()
Return array head with list of tabs to view object informations.
Definition: expensereport.lib.php:129
dol_syslog
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
Definition: functions.lib.php:1603
dol_get_fiche_head
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='')
Show tabs of a record.
Definition: functions.lib.php:1822
getDolGlobalString
if(!function_exists('utf8_encode')) if(!function_exists('utf8_decode')) getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
Definition: functions.lib.php:80
dol_strlen
dol_strlen($string, $stringencoding='UTF-8')
Make a strlen call.
Definition: functions.lib.php:3747
newToken
newToken()
Return the value of token currently saved into session with name 'newtoken'.
Definition: functions.lib.php:10878
dol_get_fiche_end
dol_get_fiche_end($notab=0)
Return tab footer of a card.
Definition: functions.lib.php:2018
dolibarr_set_const
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:627
GETPOSTISSET
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
Definition: functions.lib.php:386
addDocumentModel
addDocumentModel($name, $type, $label='', $description='')
Add document model used by doc generator.
Definition: admin.lib.php:1863
Form
Class to manage generation of HTML components Only common components must be here.
Definition: html.form.class.php:52
img_object
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0)
Show a picto called object_picto (generic function)
Definition: functions.lib.php:4211
ExpenseReport
Class to manage Trips and Expenses.
Definition: expensereport.class.php:36
$resql
if(isModEnabled('facture') &&!empty($user->rights->facture->lire)) if((isModEnabled('fournisseur') &&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->facture->lire)||(isModEnabled('supplier_invoice') && $user->rights->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->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $resql
Social contributions to pay.
Definition: index.php:742
pdf_getSubstitutionArray
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:737
setEventMessages
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='')
Set event messages in dol_events session object.
Definition: functions.lib.php:8137
accessforbidden
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program Calling this function terminate execution ...
Definition: security.lib.php:933
llxHeader
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOCSRFCHECK')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
Definition: wrapper.php:59
DolEditor
Class to manage a WYSIWYG editor.
Definition: doleditor.class.php:30