dolibarr 21.0.0-beta
card.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3 * Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
4 * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
5 * Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
6 * Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
7 * Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
8 * Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 3 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program. If not, see <https://www.gnu.org/licenses/>.
22 */
23
29// Load Dolibarr environment
30require '../../main.inc.php';
31require_once DOL_DOCUMENT_ROOT.'/core/lib/trip.lib.php';
32require_once DOL_DOCUMENT_ROOT.'/compta/deplacement/class/deplacement.class.php';
33require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
34if (isModEnabled('project')) {
35 require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
36}
37
46// Load translation files required by the page
47$langs->load("trips");
48
49
50// Security check
51$id = GETPOSTINT('id');
52if ($user->socid) {
53 $socid = $user->socid;
54}
55
56// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
57$hookmanager->initHooks(array('tripsandexpensescard', 'globalcard'));
58
59$result = restrictedArea($user, 'deplacement', $id, '');
60
61$action = GETPOST('action', 'aZ09');
62$confirm = GETPOST('confirm', 'alpha');
63
64$object = new Deplacement($db);
65
66$permissionnote = $user->hasRight('deplacement', 'creer'); // Used by the include of actions_setnotes.inc.php
67
68
69/*
70 * Actions
71 */
72
73include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not includ_once
74
75if ($action == 'validate' && $user->hasRight('deplacement', 'creer')) {
76 $object->fetch($id);
77 if ($object->statut == Deplacement::STATUS_DRAFT) {
78 $result = $object->setStatut(1);
79 if ($result > 0) {
80 header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
81 exit;
82 } else {
83 setEventMessages($object->error, $object->errors, 'errors');
84 }
85 }
86} elseif ($action == 'classifyrefunded' && $user->hasRight('deplacement', 'creer')) {
87 $object->fetch($id);
89 $result = $object->setStatut(Deplacement::STATUS_REFUNDED);
90 if ($result > 0) {
91 header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
92 exit;
93 } else {
94 setEventMessages($object->error, $object->errors, 'errors');
95 }
96 }
97} elseif ($action == 'confirm_delete' && $confirm == "yes" && $user->hasRight('deplacement', 'supprimer')) {
98 $result = $object->delete($user);
99 if ($result >= 0) {
100 header("Location: index.php");
101 exit;
102 } else {
103 setEventMessages($object->error, $object->errors, 'errors');
104 }
105} elseif ($action == 'add' && $user->hasRight('deplacement', 'creer')) {
106 if (!GETPOST('cancel', 'alpha')) {
107 $error = 0;
108
109 $object->date = dol_mktime(12, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear'));
110 $object->km = (float) price2num(GETPOST('km', 'alpha'), 'MU'); // Not 'int', it may be a formatted amount
111 $object->type = GETPOST('type', 'alpha');
112 $object->socid = GETPOSTINT('socid');
113 $object->fk_user = GETPOSTINT('fk_user');
114 $object->note_private = GETPOST('note_private', 'alpha');
115 $object->note_public = GETPOST('note_public', 'alpha');
117
118 if (!$object->date) {
119 setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Date")), null, 'errors');
120 $error++;
121 }
122 if ($object->type == '-1') {
123 setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")), null, 'errors');
124 $error++;
125 }
126 if (!($object->fk_user > 0)) {
127 setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Person")), null, 'errors');
128 $error++;
129 }
130
131 if (!$error) {
132 $id = $object->create($user);
133
134 if ($id > 0) {
135 header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
136 exit;
137 } else {
138 setEventMessages($object->error, $object->errors, 'errors');
139 $action = 'create';
140 }
141 } else {
142 $action = 'create';
143 }
144 } else {
145 header("Location: index.php");
146 exit;
147 }
148} elseif ($action == 'update' && $user->hasRight('deplacement', 'creer')) {
149 // Update record
150 if (!GETPOST('cancel', 'alpha')) {
151 $result = $object->fetch($id);
152
153 $object->date = dol_mktime(12, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear'));
154 $object->km = (float) price2num(GETPOST('km', 'alpha'), 'MU'); // Not 'int', it may be a formatted amount
155 $object->type = GETPOST('type', 'alpha');
156 $object->socid = GETPOSTINT('socid');
157 $object->fk_user = GETPOSTINT('fk_user');
158 $object->note_private = GETPOST('note_private', 'alpha');
159 $object->note_public = GETPOST('note_public', 'alpha');
160
161 $result = $object->update($user);
162
163 if ($result > 0) {
164 header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
165 exit;
166 } else {
167 setEventMessages($object->error, $object->errors, 'errors');
168 }
169 } else {
170 header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
171 exit;
172 }
173} elseif ($action == 'classin' && $user->hasRight('deplacement', 'creer')) {
174 // Set into a project
175 $object->fetch($id);
176 $result = $object->setProject(GETPOSTINT('projectid'));
177 if ($result < 0) {
178 dol_print_error($db, $object->error);
179 }
180} elseif ($action == 'setdated' && $user->hasRight('deplacement', 'creer')) {
181 // Set fields
182 $dated = dol_mktime(GETPOSTINT('datedhour'), GETPOSTINT('datedmin'), GETPOSTINT('datedsec'), GETPOSTINT('datedmonth'), GETPOSTINT('datedday'), GETPOSTINT('datedyear'));
183 $object->fetch($id);
184 $result = $object->setValueFrom('dated', $dated, '', null, 'date', '', $user, 'DEPLACEMENT_MODIFY');
185 if ($result < 0) {
186 dol_print_error($db, $object->error);
187 }
188} elseif ($action == 'setkm' && $user->hasRight('deplacement', 'creer')) {
189 $object->fetch($id);
190 $result = $object->setValueFrom('km', GETPOSTINT('km'), '', null, 'text', '', $user, 'DEPLACEMENT_MODIFY');
191 if ($result < 0) {
192 dol_print_error($db, $object->error);
193 }
194}
195
196
197/*
198 * View
199 */
200
201llxHeader();
202
203$form = new Form($db);
204
205/*
206 * Action create
207*/
208if ($action == 'create') {
209 //WYSIWYG Editor
210 require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
211
212 print load_fiche_titre($langs->trans("NewTrip"));
213
214 $datec = dol_mktime(12, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear'));
215
216 print '<form name="add" action="'.$_SERVER["PHP_SELF"].'" method="POST">'."\n";
217 print '<input type="hidden" name="token" value="'.newToken().'">';
218 print '<input type="hidden" name="action" value="add">';
219
220 print '<table class="border centpercent">';
221
222 print "<tr>";
223 print '<td class="fieldrequired">'.$langs->trans("Type").'</td><td>';
224 $form->select_type_fees(GETPOSTINT('type'), 'type', 1);
225 print '</td></tr>';
226
227 print "<tr>";
228 print '<td class="fieldrequired">'.$langs->trans("Person").'</td><td>';
229 print $form->select_dolusers(GETPOSTINT('fk_user'), 'fk_user', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300');
230 print '</td></tr>';
231
232 print "<tr>";
233 print '<td class="fieldrequired">'.$langs->trans("Date").'</td><td>';
234 print $form->selectDate($datec ? $datec : -1, '', 0, 0, 0, 'add', 1, 1);
235 print '</td></tr>';
236
237 // Km
238 print '<tr><td class="fieldrequired">'.$langs->trans("FeesKilometersOrAmout").'</td><td><input name="km" size="10" value="'.GETPOST("km").'"></td></tr>';
239
240 // Company
241 print "<tr>";
242 print '<td>'.$langs->trans("CompanyVisited").'</td><td>';
243 print $form->select_company(GETPOSTINT('socid'), 'socid', '', 1);
244 print '</td></tr>';
245
246 // Public note
247 print '<tr>';
248 print '<td class="tdtop">'.$langs->trans('NotePublic').'</td>';
249 print '<td>';
250
251 $doleditor = new DolEditor('note_public', GETPOST('note_public', 'restricthtml'), '', 200, 'dolibarr_notes', 'In', false, true, !getDolGlobalString('FCKEDITOR_ENABLE_NOTE_PUBLIC') ? 0 : 1, ROWS_8, '90%');
252 print $doleditor->Create(1);
253
254 print '</td></tr>';
255
256 // Private note
257 if (empty($user->socid)) {
258 print '<tr>';
259 print '<td class="tdtop">'.$langs->trans('NotePrivate').'</td>';
260 print '<td>';
261
262 $doleditor = new DolEditor('note_private', GETPOST('note_private', 'restricthtml'), '', 200, 'dolibarr_notes', 'In', false, true, !getDolGlobalString('FCKEDITOR_ENABLE_NOTE_PRIVATE') ? 0 : 1, ROWS_8, '90%');
263 print $doleditor->Create(1);
264
265 print '</td></tr>';
266 }
267
268 // Other attributes
269 $parameters = array();
270 $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
271 print $hookmanager->resPrint;
272
273 print '</table>';
274
275 print '<br><div class="center">';
276 print '<input class="button button-save" type="submit" value="'.$langs->trans("Save").'">';
277 print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
278 print '<input class="button button-cancel" type="submit" name="cancel" value="'.$langs->trans("Cancel").'">';
279 print '</div>';
280
281 print '</form>';
282} elseif ($id) {
283 $result = $object->fetch($id);
284 if ($result > 0) {
285 $head = trip_prepare_head($object);
286
287 print dol_get_fiche_head($head, 'card', $langs->trans("TripCard"), 0, 'trip');
288
289 if ($action == 'edit' && $user->hasRight('deplacement', 'creer')) {
290 //WYSIWYG Editor
291 require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
292
293 $soc = new Societe($db);
294 if ($object->socid) {
295 $soc->fetch($object->socid);
296 }
297
298 print '<form name="update" action="'.$_SERVER["PHP_SELF"].'" method="POST">'."\n";
299 print '<input type="hidden" name="token" value="'.newToken().'">';
300 print '<input type="hidden" name="action" value="update">';
301 print '<input type="hidden" name="id" value="'.$id.'">';
302
303 print '<table class="border centpercent">';
304
305 // Ref
306 print "<tr>";
307 print '<td class="titlefield">'.$langs->trans("Ref").'</td><td>';
308 print $object->ref;
309 print '</td></tr>';
310
311 // Type
312 print "<tr>";
313 print '<td class="fieldrequired">'.$langs->trans("Type").'</td><td>';
314 $form->select_type_fees(GETPOSTINT('type') ? GETPOSTINT('type') : $object->type, 'type', 0);
315 print '</td></tr>';
316
317 // Who
318 print "<tr>";
319 print '<td class="fieldrequired">'.$langs->trans("Person").'</td><td>';
320 print $form->select_dolusers(GETPOSTINT('fk_user') ? GETPOSTINT('fk_user') : $object->fk_user, 'fk_user', 0, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300');
321 print '</td></tr>';
322
323 // Date
324 print '<tr><td class="fieldrequired">'.$langs->trans("Date").'</td><td>';
325 print $form->selectDate($object->date, '', 0, 0, 0, 'update', 1, 0);
326 print '</td></tr>';
327
328 // Km
329 print '<tr><td class="fieldrequired">'.$langs->trans("FeesKilometersOrAmout").'</td><td>';
330 print '<input name="km" class="flat" size="10" value="'.$object->km.'">';
331 print '</td></tr>';
332
333 // Where
334 print "<tr>";
335 print '<td>'.$langs->trans("CompanyVisited").'</td><td>';
336 print $form->select_company($soc->id, 'socid', '', 1);
337 print '</td></tr>';
338
339 // Public note
340 print '<tr><td class="tdtop">'.$langs->trans("NotePublic").'</td>';
341 print '<td>';
342
343 $doleditor = new DolEditor('note_public', $object->note_public, '', 200, 'dolibarr_notes', 'In', false, true, !getDolGlobalString('FCKEDITOR_ENABLE_NOTE_PUBLIC') ? 0 : 1, ROWS_8, '90%');
344 print $doleditor->Create(1);
345
346 print "</td></tr>";
347
348 // Private note
349 if (empty($user->socid)) {
350 print '<tr><td class="tdtop">'.$langs->trans("NotePrivate").'</td>';
351 print '<td>';
352
353 $doleditor = new DolEditor('note_private', $object->note_private, '', 200, 'dolibarr_notes', 'In', false, true, !getDolGlobalString('FCKEDITOR_ENABLE_NOTE_PRIVATE') ? 0 : 1, ROWS_8, '90%');
354 print $doleditor->Create(1);
355
356 print "</td></tr>";
357 }
358
359 // Other attributes
360 $parameters = array();
361 $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
362 print $hookmanager->resPrint;
363
364 print '</table>';
365
366 print '<br><div class="center">';
367 print '<input type="submit" class="button button-save" value="'.$langs->trans("Save").'">';
368 print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
369 print '<input type="submit" name="cancel" class="button button-cancel" value="'.$langs->trans("Cancel").'">';
370 print '</div>';
371
372 print '</form>';
373
374 print '</div>';
375 } else {
376 /*
377 * Confirm delete trip
378 */
379 if ($action == 'delete') {
380 print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".urlencode((string) ($id)), $langs->trans("DeleteTrip"), $langs->trans("ConfirmDeleteTrip"), "confirm_delete");
381 }
382
383 $soc = new Societe($db);
384 if ($object->socid) {
385 $soc->fetch($object->socid);
386 }
387
388 print '<table class="border centpercent">';
389
390 $linkback = '<a href="'.DOL_URL_ROOT.'/compta/deplacement/list.php'.(!empty($socid) ? '?socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
391
392 // Ref
393 print '<tr><td width="25%">'.$langs->trans("Ref").'</td><td>';
394 print $form->showrefnav($object, 'id', $linkback, 1, 'rowid', 'ref', '');
395 print '</td></tr>';
396
397 $form->load_cache_types_fees();
398
399 // Type
400 print '<tr><td>';
401 print $form->editfieldkey("Type", 'type', $langs->trans($object->type), $object, $user->hasRight('deplacement', 'creer'), 'select:types_fees');
402 print '</td><td>';
403 print $form->editfieldval("Type", 'type', $form->cache_types_fees[$object->type], $object, $user->hasRight('deplacement', 'creer'), 'select:types_fees');
404 print '</td></tr>';
405
406 // Who
407 print '<tr><td>'.$langs->trans("Person").'</td><td>';
408 $userfee = new User($db);
409 $userfee->fetch($object->fk_user);
410 print $userfee->getNomUrl(1);
411 print '</td></tr>';
412
413 // Date
414 print '<tr><td>';
415 print $form->editfieldkey("Date", 'dated', $object->date, $object, $user->hasRight('deplacement', 'creer'), 'datepicker');
416 print '</td><td>';
417 print $form->editfieldval("Date", 'dated', $object->date, $object, $user->hasRight('deplacement', 'creer'), 'datepicker');
418 print '</td></tr>';
419
420 // Km/Price
421 print '<tr><td class="tdtop">';
422 print $form->editfieldkey("FeesKilometersOrAmout", 'km', $object->km, $object, $user->hasRight('deplacement', 'creer'), 'numeric:6');
423 print '</td><td>';
424 print $form->editfieldval("FeesKilometersOrAmout", 'km', $object->km, $object, $user->hasRight('deplacement', 'creer'), 'numeric:6');
425 print "</td></tr>";
426
427 // Where
428 print '<tr><td>'.$langs->trans("CompanyVisited").'</td>';
429 print '<td>';
430 if ($soc->id) {
431 print $soc->getNomUrl(1);
432 }
433 print '</td></tr>';
434
435 // Project
436 if (isModEnabled('project')) {
437 $langs->load('projects');
438 print '<tr>';
439 print '<td>';
440
441 print '<table class="nobordernopadding" width="100%"><tr><td>';
442 print $langs->trans('Project');
443 print '</td>';
444 if ($action != 'classify' && $user->hasRight('deplacement', 'creer')) {
445 print '<td class="right"><a href="'.$_SERVER["PHP_SELF"].'?action=classify&token='.newToken().'&id='.$object->id.'">';
446 print img_edit($langs->trans('SetProject'), 1);
447 print '</a></td>';
448 }
449 print '</tr></table>';
450 print '</td><td colspan="3">';
451 if ($action == 'classify') {
452 $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1);
453 } else {
454 $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none', 0, 0);
455 }
456 print '</td>';
457 print '</tr>';
458 }
459
460 // Statut
461 print '<tr><td>'.$langs->trans("Status").'</td><td>'.$object->getLibStatut(4).'</td></tr>';
462
463 // Other attributes
464 $parameters = array('socid' => $object->id);
465 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
466
467 print "</table><br>";
468
469 // Notes
470 $blocname = 'notes';
471 $title = $langs->trans('Notes');
472 include DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php';
473
474 print '</div>';
475
476 /*
477 * Action bar
478 */
479 print '<div class="tabsAction">';
480
481 if ($object->statut < Deplacement::STATUS_REFUNDED) { // if not refunded
482 if ($user->hasRight('deplacement', 'creer')) {
483 print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit&token='.newToken().'&id='.$id.'">'.$langs->trans('Modify').'</a>';
484 } else {
485 print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NotAllowed")).'">'.$langs->trans('Modify').'</a>';
486 }
487 }
488
489 if ($object->statut == Deplacement::STATUS_DRAFT) { // if draft
490 if ($user->hasRight('deplacement', 'creer')) {
491 print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=validate&id='.$id.'">'.$langs->trans('Validate').'</a>';
492 } else {
493 print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NotAllowed")).'">'.$langs->trans('Validate').'</a>';
494 }
495 }
496
497 if ($object->statut == Deplacement::STATUS_VALIDATED) { // if validated
498 if ($user->hasRight('deplacement', 'creer')) {
499 print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=classifyrefunded&token='.newToken().'&id='.$id.'">'.$langs->trans('ClassifyRefunded').'</a>';
500 } else {
501 print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NotAllowed")).'">'.$langs->trans('ClassifyRefunded').'</a>';
502 }
503 }
504
505 $permissiontodelete = $user->hasRight('deplacement', 'supprimer');
506 print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', $permissiontodelete);
507
508 print '</div>';
509 }
510 } else {
511 dol_print_error($db);
512 }
513}
514
515// End of page
516llxFooter();
517$db->close();
$id
Definition account.php:48
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
Definition card.php:66
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
Definition wrapper.php:87
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:71
Class to manage trips and working credit notes.
const STATUS_DRAFT
Draft status.
const STATUS_REFUNDED
Refunded status.
const STATUS_VALIDATED
Validated status.
Class to manage a WYSIWYG editor.
Class to manage generation of HTML components Only common components must be here.
Class to manage third parties objects (customers, suppliers, prospects...)
Class to manage Dolibarr users.
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm='auto', $check=1)
Return a timestamp date built from detailed information (by default a local PHP server timestamp) Rep...
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
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)
Show tabs of a record.
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
newToken()
Return the value of token currently saved into session with name 'newtoken'.
dolGetButtonAction($label, $text='', $actionType='default', $url='', $id='', $userRight=1, $params=array())
Function dolGetButtonAction.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
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 a Dolibarr global constant string value.
img_edit($titlealt='default', $float=0, $other='')
Show logo edit/modify fiche.
if(preg_match('/crypted:/i', $dolibarr_main_db_pass)||!empty($dolibarr_main_db_encrypted_pass)) $conf db type
Definition repair.php:149
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $mode=0)
Check permissions of a user to show a page and an object.
trip_prepare_head(Deplacement $object)
Prepare array with list of tabs.
Definition trip.lib.php:31