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