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