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