dolibarr 21.0.0-alpha
define_holiday.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2007-2022 Laurent Destailleur <eldy@users.sourceforge.net>
3 * Copyright (C) 2011 Dimitri Mouillard <dmouillard@teclib.com>
4 * Copyright (C) 2013 Marcos García <marcosgdf@gmail.com>
5 * Copyright (C) 2016 Regis Houssin <regis.houssin@inodbox.com>
6 * Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
7 * Copyright (C) 2024 Alexandre Spangaro <alexandre@inovea-conseil.com>
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
32// Load Dolibarr environment
33require '../main.inc.php';
34require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
35require_once DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php';
36
37// Load translation files required by the page
38$langs->loadlangs(array('users', 'other', 'holiday', 'hrm'));
39
40$action = GETPOST('action', 'aZ09');
41$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'defineholidaylist';
42$massaction = GETPOST('massaction', 'alpha');
43$optioncss = GETPOST('optioncss', 'alpha');
44$mode = GETPOST('optioncss', 'aZ');
45
46$search_name = GETPOST('search_name', 'alpha');
47$search_supervisor = GETPOST('search_supervisor', "intcomma");
48
49// Load variable for pagination
50$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit;
51$sortfield = GETPOST('sortfield', 'aZ09comma');
52$sortorder = GETPOST('sortorder', 'aZ09comma');
53$toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list
54$confirm = GETPOST('confirm', 'alpha');
55
56$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page");
57if (empty($page) || $page == -1) {
58 $page = 0;
59} // If $page is not defined, or '' or -1
60$offset = $limit * $page;
61$pageprev = $page - 1;
62$pagenext = $page + 1;
63if (!$sortfield) {
64 $sortfield = "t.rowid"; // Set here default search field
65}
66if (!$sortorder) {
67 $sortorder = "ASC";
68}
69
70
71// Initialize a technical object to manage hooks. Note that conf->hooks_modules contains array
72$hookmanager->initHooks(array('defineholidaylist'));
73$extrafields = new ExtraFields($db);
74
75$holiday = new Holiday($db);
76
77$arrayfields = array(
78 'cp.rowid' => array('label' => $langs->trans("Employee"), 'checked' => 1, 'position' => 20),
79 'cp.fk_user' => array('label' => $langs->trans("Supervisor"), 'checked' => 1, 'position' => 30),
80 'cp.nbHoliday' => array('label' => $langs->trans("MenuConfCP"), 'checked' => 1, 'position' => 40),
81 'cp.note_public' => array('label' => $langs->trans("Note"), 'checked' => 1, 'position' => 50),
82);
83
84$permissiontoread = $user->hasRight('holiday', 'read');
85$permissiontoreadall = $user->hasRight('holiday', 'readall');
86$permissiontowrite = $user->hasRight('holiday', 'write');
87$permissiontowriteall = $user->hasRight('holiday', 'writeall');
88$permissiontodelete = $user->hasRight('holiday', 'delete');
89
90$permissiontoapprove = $user->hasRight('holiday', 'approve');
91$permissiontosetup = $user->hasRight('holiday', 'define_holiday');
92
93if (!isModEnabled('holiday')) {
94 accessforbidden('Module not enabled');
95}
96
97// Protection if external user
98if ($user->socid > 0) {
100}
101
102// If the user does not have perm to read the page
103if (!$user->hasRight('holiday', 'read')) {
105}
106
107
108/*
109 * Actions
110 */
111
112if (GETPOST('cancel', 'alpha')) {
113 $action = 'list';
114 $massaction = '';
115}
116if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') {
117 $massaction = '';
118}
119
120$parameters = array();
121$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
122if ($reshook < 0) {
123 setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
124}
125
126if (empty($reshook)) {
127 // Selection of new fields
128 include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
129
130 // Purge search criteria
131 if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers
132 $search_name = '';
133 $search_supervisor = '';
134 $toselect = array();
135 $search_array_options = array();
136 }
137
138 // Mass actions
139 $objectclass = 'Holiday';
140 $objectlabel = 'Holiday';
141 $uploaddir = $conf->holiday->dir_output;
142 include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
143
144 // If there is an update action
145 if ($action == 'update' && GETPOSTISSET('update_cp') && $permissiontosetup) {
146 $error = 0;
147 $nbok = 0;
148
149 $typeleaves = $holiday->getTypes(1, 1);
150
151 $userID = array_keys(GETPOST('update_cp'));
152 $userID = $userID[0];
153
154 $db->begin();
155
156 foreach ($typeleaves as $key => $val) {
157 $userValue = GETPOST('nb_holiday_'.$val['rowid']);
158 $userValue = $userValue[$userID];
159
160 if (!empty($userValue) || (string) $userValue == '0') {
161 $userValue = price2num($userValue, 5);
162 } else {
163 $userValue = '';
164 }
165
166 //If the user set a comment, we add it to the log comment
167 $note_holiday = GETPOST('note_holiday');
168 $comment = ((isset($note_holiday[$userID]) && !empty($note_holiday[$userID])) ? ' ('.$note_holiday[$userID].')' : '');
169
170 //print 'holiday: '.$val['rowid'].'-'.$userValue;exit;
171 if ($userValue != '') {
172 // We add the modification to the log (must be done before the update of balance because we read current value of balance inside this method)
173 $result = $holiday->addLogCP($user->id, $userID, $langs->transnoentitiesnoconv('ManualUpdate').$comment, $userValue, $val['rowid']);
174 if ($result < 0) {
175 setEventMessages($holiday->error, $holiday->errors, 'errors');
176 $error++;
177 }
178
179 // Update of the days of the employee
180 if ($result > 0) {
181 $nbok++;
182
183 $result = $holiday->updateSoldeCP($userID, $userValue, $val['rowid']);
184 if ($result < 0) {
185 setEventMessages($holiday->error, $holiday->errors, 'errors');
186 $error++;
187 }
188 }
189
190 // If it first update of balance, we set date to avoid to have sold incremented by new month
191 /*
192 $now=dol_now();
193 $sql = "UPDATE ".MAIN_DB_PREFIX."holiday_config SET";
194 $sql.= " value = '".dol_print_date($now,'%Y%m%d%H%M%S')."'";
195 $sql.= " WHERE name = 'lastUpdate' and value IS NULL"; // Add value IS NULL to be sure to update only at init.
196 dol_syslog('define_holiday update lastUpdate entry', LOG_DEBUG);
197 $result = $db->query($sql);
198 */
199 }
200 }
201
202 if (!$error && !$nbok) {
203 setEventMessages($langs->trans("HolidayQtyNotModified", $user->login), null, 'warnings');
204 }
205
206 if (!$error) {
207 $db->commit();
208
209 if ($nbok > 0) {
210 setEventMessages('UpdateConfCPOK', null, 'mesgs');
211 }
212 } else {
213 $db->rollback();
214 }
215 }
216}
217
218
219/*
220 * View
221 */
222
223$form = new Form($db);
224$userstatic = new User($db);
225
226
227$title = $langs->trans('CPTitreMenu');
228$help_url = 'EN:Module_Holiday';
229
230llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-holiday page-define_holiday');
231
232$typeleaves = $holiday->getTypes(1, 1);
233$result = $holiday->updateBalance(); // Create users into table holiday if they don't exists. TODO Remove this whif we use field into table user.
234if ($result < 0) {
235 setEventMessages($holiday->error, $holiday->errors, 'errors');
236}
237
238// List of mass actions available
239$arrayofmassactions = array(
240 //'generate_doc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"),
241 //'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
242 //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"),
243);
244if ($permissiontosetup) {
245 $arrayofmassactions['preincreaseholiday'] = img_picto('', 'add', 'class="pictofixedwidth"').$langs->trans("IncreaseHolidays");
246}
247$massactionbutton = $form->selectMassAction('', $arrayofmassactions);
248
249
250print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
251if ($optioncss != '') {
252 print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
253}
254print '<input type="hidden" name="token" value="'.newToken().'">';
255print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
256print '<input type="hidden" name="action" value="update">';
257print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
258print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
259print '<input type="hidden" name="page" value="'.$page.'">';
260print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
261
262$title = $langs->trans("MenuConfCP");
263print_barre_liste($title, $page, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, $massactionbutton, 0, '', 'title_hrm', 0, '', '', $limit, 0, 0, 1);
264
265include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
266
267if ($massaction == 'preincreaseholiday') {
268 $langs->loadLangs(array("holiday", "hrm"));
269 require_once DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php';
270 $staticholiday = new Holiday($db);
271 $arraytypeholidays = $staticholiday->getTypes(1, 1);
272 $formquestion = array();
273 $labeltypes = array();
274 foreach ($typeleaves as $key => $val) {
275 $labeltypes[$val['id']] = ($langs->trans($val['code']) != $val['code']) ? $langs->trans($val['code']) : $langs->trans($val['label']);
276 }
277 $formquestion [] = array( 'type' => 'other',
278 'name' => 'typeofholiday',
279 'label' => $langs->trans("Type"),
280 'value' => $form->selectarray('typeholiday', $labeltypes, GETPOST('typeholiday', 'alpha'), 1)
281 );
282 $formquestion [] = array( 'type' => 'other',
283 'name' => 'nbdaysholydays',
284 'label' => $langs->trans("NumberDayAddMass"),
285 'value' => '<input name="nbdaysholidays" class="maxwidth75" id="nbdaysholidays" value="'.GETPOSTINT('nbdaysholidays').'">'
286 );
287 print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmMassIncreaseHoliday"), $langs->trans("ConfirmMassIncreaseHolidayQuestion", count($toselect)), "increaseholiday", $formquestion, 1, 0, 200, 500, 1);
288}
289
290print '<div class="info">'.$langs->trans('LastUpdateCP').': '."\n";
291$lastUpdate = $holiday->getConfCP('lastUpdate');
292if ($lastUpdate) {
293 print '<strong>'.dol_print_date($db->jdate($lastUpdate), 'dayhour').'</strong>';
294 print '<br>'.$langs->trans("MonthOfLastMonthlyUpdate").': <strong>'.$langs->trans('Month'.substr($lastUpdate, 4, 2)).' '.substr($lastUpdate, 0, 4).'</strong>'."\n";
295} else {
296 print $langs->trans('None');
297}
298print "</div><br>\n";
299
300
301$filters = '';
302
303// Filter on array of ids of all children
304$userchilds = array();
305if (!$permissiontoreadall) {
306 $userchilds = $user->getAllChildIds(1);
307 $filters .= ' AND u.rowid IN ('.$db->sanitize(implode(', ', $userchilds)).')';
308}
309if (!empty($search_name)) {
310 $filters .= natural_search(array('u.firstname', 'u.lastname'), $search_name);
311}
312if ($search_supervisor > 0) {
313 $filters .= natural_search(array('u.fk_user'), $search_supervisor, 2);
314}
315$filters .= ' AND employee = 1'; // Only employee users are visible
316
317$listUsers = $holiday->fetchUsers(false, true, $filters);
318if (is_numeric($listUsers) && $listUsers < 0) {
319 setEventMessages($holiday->error, $holiday->errors, 'errors');
320}
321
322$i = 0;
323
324
325
326if (count($typeleaves) == 0) {
327 //print '<div class="info">';
328 print $langs->trans("NoLeaveWithCounterDefined")."<br>\n";
329 print $langs->trans("GoIntoDictionaryHolidayTypes");
330 //print '</div>';
331} else {
332 $canedit = 0;
333 if ($permissiontosetup) {
334 $canedit = 1;
335 }
336
337 $moreforfilter = '';
338
339 $selectedfields = '';
340 if ($massactionbutton) {
341 $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
342 $selectedfields .= ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) : ''); // This also change content of $arrayfields
343 $selectedfields .= $form->showCheckAddButtons('checkforselect', 1);
344 }
345
346 print '<div class="div-table-responsive">';
347 print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'" id="tablelines3">'."\n";
348
349 print '<tr class="liste_titre_filter">';
350
351 // Action column
352 if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
353 print '<td class="liste_titre maxwidthsearch center">';
354 $searchpicto = $form->showFilterButtons();
355 print $searchpicto;
356 print '</td>';
357 }
358
359 // User
360 if (!empty($arrayfields['cp.rowid']['checked'])) {
361 print '<td class="liste_titre">';
362 print '<input type="text" name="search_name" value="'.dol_escape_htmltag($search_name).'" class="maxwidth100">';
363 print '</td>';
364 }
365 // Supervisor
366 if (!empty($arrayfields['cp.fk_user']['checked'])) {
367 print '<td class="liste_titre">';
368 print $form->select_dolusers($search_supervisor, 'search_supervisor', 1, null, 0, array(), '', 0, 0, 0, '', 0, '', 'maxwidth150');
369 print '</td>';
370 }
371 // Type of leave request
372 if (!empty($arrayfields['cp.nbHoliday']['checked'])) {
373 if (count($typeleaves)) {
374 foreach ($typeleaves as $key => $val) {
375 print '<td class="liste_titre" style="text-align:center"></td>';
376 }
377 } else {
378 print '<td class="liste_titre"></td>';
379 }
380 }
381 if (!empty($arrayfields['cp.note_public']['checked'])) {
382 print '<td class="liste_titre"></td>';
383 }
384 print '<td class="liste_titre"></td>';
385
386 // Action column
387 if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
388 print '<td class="liste_titre maxwidthsearch center">';
389 $searchpicto = $form->showFilterButtons();
390 print $searchpicto;
391 print '</td>';
392 }
393
394 print '</tr>';
395
396 print '<tr class="liste_titre">';
397 // Action column
398 if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
399 print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
400 }
401 if (!empty($arrayfields['cp.rowid']['checked'])) {
402 print_liste_field_titre('Employee', $_SERVER["PHP_SELF"]);
403 }
404 if (!empty($arrayfields['cp.fk_user']['checked'])) {
405 print_liste_field_titre('Supervisor', $_SERVER["PHP_SELF"]);
406 }
407 if (!empty($arrayfields['cp.nbHoliday']['checked'])) {
408 if (count($typeleaves)) {
409 foreach ($typeleaves as $key => $val) {
410 $labeltype = ($langs->trans($val['code']) != $val['code']) ? $langs->trans($val['code']) : $langs->trans($val['label']);
411 print_liste_field_titre($labeltype, $_SERVER["PHP_SELF"], '', '', '', '', '', '', 'center ');
412 }
413 } else {
414 print_liste_field_titre('NoLeaveWithCounterDefined', $_SERVER["PHP_SELF"], '', '', '', '');
415 }
416 }
417 if (!empty($arrayfields['cp.note_public']['checked'])) {
418 print_liste_field_titre($permissiontosetup ? 'Note' : '', $_SERVER["PHP_SELF"]);
419 }
421 // Action column
422 if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
423 print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
424 }
425 print '</tr>';
426 $usersupervisor = new User($db);
427
428 foreach ($listUsers as $users) {
429 $arrayofselected = is_array($toselect) ? $toselect : array();
430
431 // If user has not permission to edit/read all, we must see only subordinates
432 if (!$permissiontoreadall) {
433 if (($users['rowid'] != $user->id) && (!in_array($users['rowid'], $userchilds))) {
434 continue; // This user is not into hierarchy of current user, we hide it.
435 }
436 }
437
438 $userstatic->id = $users['rowid'];
439 $userstatic->lastname = $users['lastname'];
440 $userstatic->firstname = $users['firstname'];
441 $userstatic->gender = $users['gender'];
442 $userstatic->photo = $users['photo'];
443 $userstatic->status = $users['status'];
444 $userstatic->employee = $users['employee'];
445 $userstatic->fk_user = $users['fk_user'];
446
447 if ($userstatic->fk_user > 0) {
448 $usersupervisor->fetch($userstatic->fk_user);
449 }
450
451 print '<tr class="oddeven">';
452
453 // Action column
454 if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
455 print '<td class="nowrap center">';
456
457 if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
458 $selected = 0;
459 if (in_array($userstatic->id, $arrayofselected)) {
460 $selected = 1;
461 }
462 print '<input id="cb'.$userstatic->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$userstatic->id.'"'.($selected ? ' checked="checked"' : '').'>';
463 }
464 print '</td>';
465 }
466
467 // User
468 if (!empty($arrayfields['cp.rowid']['checked'])) {
469 print '<td>';
470 print $userstatic->getNomUrl(-1);
471 print '</td>';
472 }
473 // Supervisor
474 if (!empty($arrayfields['cp.fk_user']['checked'])) {
475 print '<td>';
476 if ($userstatic->fk_user > 0) {
477 print $usersupervisor->getNomUrl(-1);
478 }
479 print '</td>';
480 }
481
482 // Amount for each type
483 if (!empty($arrayfields['cp.nbHoliday']['checked'])) {
484 if (count($typeleaves)) {
485 foreach ($typeleaves as $key => $val) {
486 $nbtoshow = '';
487 if ($holiday->getCPforUser($users['rowid'], $val['rowid']) != '') {
488 $nbtoshow = price2num($holiday->getCPforUser($users['rowid'], $val['rowid']), 5);
489 }
490
491 //var_dump($users['rowid'].' - '.$val['rowid']);
492 print '<td style="text-align:center">';
493 if ($canedit) {
494 print '<input type="text"'.($canedit ? '' : ' disabled="disabled"').' value="'.$nbtoshow.'" name="nb_holiday_'.$val['rowid'].'['.$users['rowid'].']" class="width75 center" />';
495 } else {
496 print $nbtoshow;
497 }
498 //print ' '.$langs->trans('days');
499 print '</td>'."\n";
500 }
501 } else {
502 print '<td></td>';
503 }
504 }
505
506 // Note
507 if (!empty($arrayfields['cp.note_public']['checked'])) {
508 print '<td>';
509 if ($canedit) {
510 print '<input type="text"'.($canedit ? '' : ' disabled="disabled"').' class="maxwidthonsmartphone" value="" name="note_holiday['.$users['rowid'].']" size="30"/>';
511 }
512 print '</td>';
513 }
514
515 // Button modify
516 print '<td class="center">';
517 if ($permissiontosetup) { // Allowed to set the balance of any user
518 print '<input type="submit" name="update_cp['.$users['rowid'].']" value="'.dol_escape_htmltag($langs->trans("Save")).'" class="button smallpaddingimp"/>';
519 }
520 print '</td>'."\n";
521
522 // Action column
523 if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
524 print '<td class="nowrap center">';
525
526 if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
527 $selected = 0;
528 if (in_array($userstatic->id, $arrayofselected)) {
529 $selected = 1;
530 }
531 print '<input id="cb'.$userstatic->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$userstatic->id.'"'.($selected ? ' checked="checked"' : '').'>';
532 }
533 print '</td>';
534 }
535
536 print '</tr>';
537
538 $i++;
539 }
540
541 if (count($listUsers) <= 0) {
542 $colspan = 2;
543 foreach ($arrayfields as $key => $val) {
544 if (!empty($val['checked'])) {
545 if ($key == 'cp.nbHoliday') {
546 foreach ($typeleaves as $leave_key => $leave_val) {
547 $colspan++;
548 }
549 } else {
550 $colspan++;
551 }
552 }
553 }
554 print '<tr><td colspan="'.$colspan.'"><span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span></td></tr>';
555 }
556
557 print '</table>';
558 print '</div>';
559}
560
561print '</form>';
562
563// End of page
564llxFooter();
565$db->close();
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
Definition card.php:58
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:70
Class to manage standard extra fields.
Class to manage generation of HTML components Only common components must be here.
Class of the module paid holiday.
Class to manage Dolibarr users.
llxFooter()
Footer empty.
Definition document.php:107
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)
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.
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
natural_search($fields, $value, $mode=0, $nofirstand=0)
Generate natural SQL search string for a criteria (this criteria can be tested on one or several fiel...
print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $disablesortlink=0, $tooltip='', $forcenowrapcolumntitle=0)
Get title line of an array.
print_barre_liste($title, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='generic', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $hideselectlimit=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow='')
Print a title with navigation controls for pagination.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Returns text escaped for inclusion in HTML alt or title or value tags, or into values of HTML input f...
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.