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