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