dolibarr 19.0.3
month_report.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2007-2010 Laurent Destailleur <eldy@users.sourceforge.net>
3 * Copyright (C) 2011 François Legastelois <flegastelois@teclib.com>
4 * Copyright (C) 2018-2019 Frédéric France <frederic.france@netlogic.fr>
5 * Copyright (C) 2020 Tobias Sekan <tobias.sekan@startmail.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
27// Load Dolibarr environment
28require '../main.inc.php';
29require_once DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php';
30require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
31require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
32require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
33require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
34
35// Load translation files required by the page
36$langs->loadLangs(array('holiday', 'hrm'));
37
38$action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view';
39$massaction = GETPOST('massaction', 'alpha');
40$contextpage = GETPOST('contextpage', 'aZ');
41$optioncss = GETPOST('optioncss', 'aZ');
42
43$id = GETPOST('id', 'int');
44
45$search_ref = GETPOST('search_ref', 'alphanohtml');
46$search_employee = GETPOST('search_employee', 'int');
47$search_type = GETPOST('search_type', 'int');
48$search_description = GETPOST('search_description', 'alphanohtml');
49
50$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
51$sortfield = GETPOST('sortfield', 'aZ09comma');
52$sortorder = GETPOST('sortorder', 'aZ09comma');
53
54if (!$sortfield) {
55 $sortfield = "cp.rowid";
56}
57if (!$sortorder) {
58 $sortorder = "ASC";
59}
60
61$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
62if (empty($page) || $page == -1) {
63 $page = 0;
64}
65
66$hookmanager->initHooks(array('leavemovementlist'));
67
68$arrayfields = array();
69$arrayofmassactions = array();
70
71// Security check
72if ($user->socid > 0) { // Protection if external user
73 //$socid = $user->socid;
75}
76$result = restrictedArea($user, 'holiday', $id);
77
78if (!$user->hasRight('holiday', 'readall')) {
80}
81
82
83/*
84 * Actions
85 */
86
87if (GETPOST('cancel', 'alpha')) {
88 $action = 'list';
89 $massaction = '';
90}
91if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') {
92 $massaction = '';
93}
94
95$parameters = array();
96$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
97if ($reshook < 0) {
98 setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
99}
100
101if (empty($reshook)) {
102 // Selection of new fields
103 include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
104
105 // Purge search criteria
106 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
107 $search_ref = '';
108 $search_employee = '';
109 $search_type = '';
110 $search_description = '';
111 $toselect = array();
112 $search_array_options = array();
113 }
114
115 if (GETPOST('button_removefilter_x', 'alpha')
116 || GETPOST('button_removefilter.x', 'alpha')
117 || GETPOST('button_removefilter', 'alpha')
118 || GETPOST('button_search_x', 'alpha')
119 || GETPOST('button_search.x', 'alpha')
120 || GETPOST('button_search', 'alpha')) {
121 $massaction = '';
122 }
123}
124
125$arrayfields = array(
126 'cp.ref'=>array('label' => 'Ref', 'checked'=>1, 'position'=>5),
127 'cp.fk_type'=>array('label' => 'Type', 'checked'=>1, 'position'=>10),
128 'cp.fk_user'=>array('label' => 'Employee', 'checked'=>1, 'position'=>20),
129 'cp.date_debut'=>array('label' => 'DateDebCP', 'checked'=>-1, 'position'=>30),
130 'cp.date_fin'=>array('label' => 'DateFinCP', 'checked'=>-1, 'position'=>32),
131 'used_days'=>array('label' => 'NbUseDaysCPShort', 'checked'=>-1, 'position'=>34),
132 'date_start_month'=>array('label' => 'DateStartInMonth', 'checked'=>1, 'position'=>50),
133 'date_end_month'=>array('label' => 'DateEndInMonth', 'checked'=>1, 'position'=>52),
134 'used_days_month'=>array('label' => 'NbUseDaysCPShortInMonth', 'checked'=>1, 'position'=>54),
135 'cp.description'=>array('label' => 'DescCP', 'checked'=>-1, 'position'=>800),
136);
137
138
139/*
140 * View
141 */
142
143$form = new Form($db);
144$formother = new FormOther($db);
145$holidaystatic = new Holiday($db);
146
147$listhalfday = array('morning'=>$langs->trans("Morning"), "afternoon"=>$langs->trans("Afternoon"));
148
149$title = $langs->trans('CPTitreMenu');
150
151llxHeader('', $title);
152
153$search_month = GETPOST("remonth", 'int') ? GETPOST("remonth", 'int') : date("m", time());
154$search_year = GETPOST("reyear", 'int') ? GETPOST("reyear", 'int') : date("Y", time());
155$year_month = sprintf("%04d", $search_year).'-'.sprintf("%02d", $search_month);
156
157$sql = "SELECT cp.rowid, cp.ref, cp.fk_user, cp.date_debut, cp.date_fin, cp.fk_type, cp.description, cp.halfday, cp.statut as status";
158$sql .= " FROM ".MAIN_DB_PREFIX."holiday cp";
159$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user u ON cp.fk_user = u.rowid";
160$sql .= " WHERE cp.rowid > 0";
161$sql .= " AND cp.statut = ".Holiday::STATUS_APPROVED;
162$sql .= " AND (";
163$sql .= " (date_format(cp.date_debut, '%Y-%m') = '".$db->escape($year_month)."' OR date_format(cp.date_fin, '%Y-%m') = '".$db->escape($year_month)."')";
164$sql .= " OR"; // For leave over several months
165$sql .= " (date_format(cp.date_debut, '%Y-%m') < '".$db->escape($year_month)."' AND date_format(cp.date_fin, '%Y-%m') > '".$db->escape($year_month)."') ";
166$sql .= " )";
167if (!empty($search_ref)) {
168 $sql .= natural_search('cp.ref', $search_ref);
169}
170if (!empty($search_employee) && $search_employee > 0) {
171 $sql .= " AND cp.fk_user = ".((int) $search_employee);
172}
173if (!empty($search_type) && $search_type != '-1') {
174 $sql .= ' AND cp.fk_type IN ('.$db->sanitize($search_type).')';
175}
176if (!empty($search_description)) {
177 $sql .= natural_search('cp.description', $search_description);
178}
179
180$sql .= $db->order($sortfield, $sortorder);
181
182$resql = $db->query($sql);
183if (empty($resql)) {
184 dol_print_error($db);
185 exit;
186}
187
188$num = $db->num_rows($resql);
189
190$param = '';
191if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
192 $param .= '&contextpage='.urlencode($contextpage);
193}
194if ($limit > 0 && $limit != $conf->liste_limit) {
195 $param .= '&limit='.((int) $limit);
196}
197if (!empty($search_ref)) {
198 $param .= '&search_ref='.urlencode($search_ref);
199}
200if (!empty($search_employee)) {
201 $param .= '&search_employee='.urlencode($search_employee);
202}
203if (!empty($search_type)) {
204 $param .= '&search_type='.urlencode($search_type);
205}
206if (!empty($search_description)) {
207 $param .= '&search_description='.urlencode($search_description);
208}
209
210print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
211if ($optioncss != '') {
212 print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
213}
214print '<input type="hidden" name="token" value="'.newToken().'">';
215print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
216print '<input type="hidden" name="action" value="list">';
217print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
218print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
219print '<input type="hidden" name="page" value="'.$page.'">';
220print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
221
222print load_fiche_titre($langs->trans('MenuReportMonth'), '', 'title_hrm');
223
224// Selection filter
225print '<div class="tabBar">';
226print $formother->select_month($search_month, 'remonth', 0, 0, 'minwidth50 maxwidth75imp valignmiddle', true);
227print $formother->selectyear($search_year, 'reyear', 0, 10, 5, 0, 0, '', 'valignmiddle width75', true);
228print '<input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("Search")).'" />';
229print '</div>';
230print '<br>';
231
232$moreforfilter = '';
233
234$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
235$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields
236$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
237
238print '<div class="div-table-responsive">';
239print '<table class="tagtable nobottomiftotal liste">';
240
241print '<tr class="liste_titre_filter">';
242
243// Action column
244if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
245 print '<th class="wrapcolumntitle center maxwidthsearch liste_titre">';
246 $searchpicto = $form->showFilterButtons('left');
247 print $searchpicto;
248 print '</th>';
249}
250
251// Filter: Ref
252if (!empty($arrayfields['cp.ref']['checked'])) {
253 print '<th class="liste_titre">';
254 print '<input class="flat maxwidth100" type="text" name="search_ref" value="'.dol_escape_htmltag($search_ref).'">';
255 print '</th>';
256}
257
258// Filter: Type
259if (!empty($arrayfields['cp.fk_type']['checked'])) {
260 $typeleaves = $holidaystatic->getTypes(1, -1);
261 $arraytypeleaves = array();
262 foreach ($typeleaves as $key => $val) {
263 $labeltoshow = ($langs->trans($val['code']) != $val['code'] ? $langs->trans($val['code']) : $val['label']);
264 $arraytypeleaves[$val['rowid']] = $labeltoshow;
265 }
266
267 print '<th class="liste_titre">';
268 print $form->selectarray('search_type', $arraytypeleaves, $search_type, 1, 0, 0, '', 0, 0, 0, '', 'maxwidth100', 1);
269 print '</th>';
270}
271
272// Filter: Employee
273if (!empty($arrayfields['cp.fk_user']['checked'])) {
274 print '<th class="liste_titre">';
275 print $form->select_dolusers($search_employee, "search_employee", 1, null, 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth100');
276 print '</th>';
277}
278
279if (!empty($arrayfields['cp.date_debut']['checked'])) {
280 print '<th class="liste_titre"></th>';
281}
282if (!empty($arrayfields['cp.date_fin']['checked'])) {
283 print '<th class="liste_titre"></th>';
284}
285if (!empty($arrayfields['used_days']['checked'])) {
286 print '<th class="liste_titre"></th>';
287}
288if (!empty($arrayfields['date_start_month']['checked'])) {
289 print '<th class="liste_titre"></th>';
290}
291if (!empty($arrayfields['date_end_month']['checked'])) {
292 print '<th class="liste_titre"></th>';
293}
294if (!empty($arrayfields['used_days_month']['checked'])) {
295 print '<th class="liste_titre"></th>';
296}
297
298// Filter: Description
299if (!empty($arrayfields['cp.description']['checked'])) {
300 print '<th class="liste_titre">';
301 print '<input type="text" class="maxwidth100" name="search_description" value="'.$search_description.'">';
302 print '</th>';
303}
304// Action column
305if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
306 print '<th class="liste_titre maxwidthsearch">';
307 $searchpicto = $form->showFilterButtons();
308 print $searchpicto;
309 print '</th>';
310}
311print '</tr>';
312
313print '<tr class="liste_titre">';
314// Action column
315if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
316 print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
317}
318if (!empty($arrayfields['cp.ref']['checked'])) {
319 print_liste_field_titre($arrayfields['cp.ref']['label'], $_SERVER["PHP_SELF"], 'cp.ref', '', '', '', $sortfield, $sortorder);
320}
321if (!empty($arrayfields['cp.fk_type']['checked'])) {
322 print_liste_field_titre($arrayfields['cp.fk_type']['label'], $_SERVER["PHP_SELF"], 'cp.fk_type', '', '', '', $sortfield, $sortorder);
323}
324if (!empty($arrayfields['cp.fk_user']['checked'])) {
325 print_liste_field_titre($arrayfields['cp.fk_user']['label'], $_SERVER["PHP_SELF"], 'u.lastname', '', '', '', $sortfield, $sortorder);
326}
327if (!empty($arrayfields['ct.label']['checked'])) {
328 print_liste_field_titre($arrayfields['ct.label']['label'], $_SERVER["PHP_SELF"], 'ct.label', '', '', '', $sortfield, $sortorder);
329}
330if (!empty($arrayfields['cp.date_debut']['checked'])) {
331 print_liste_field_titre($arrayfields['cp.date_debut']['label'], $_SERVER["PHP_SELF"], 'cp.date_debut', '', '', '', $sortfield, $sortorder, 'center ');
332}
333if (!empty($arrayfields['cp.date_fin']['checked'])) {
334 print_liste_field_titre($arrayfields['cp.date_fin']['label'], $_SERVER["PHP_SELF"], 'cp.date_fin', '', '', '', $sortfield, $sortorder, 'center ');
335}
336if (!empty($arrayfields['used_days']['checked'])) {
337 print_liste_field_titre($arrayfields['used_days']['label'], $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'maxwidth125 right ');
338}
339if (!empty($arrayfields['date_start_month']['checked'])) {
340 print_liste_field_titre($arrayfields['date_start_month']['label'], $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center ');
341}
342if (!empty($arrayfields['date_end_month']['checked'])) {
343 print_liste_field_titre($arrayfields['date_end_month']['label'], $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center ');
344}
345if (!empty($arrayfields['used_days_month']['checked'])) {
346 print_liste_field_titre($arrayfields['used_days_month']['label'], $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'maxwidth125 right ');
347}
348if (!empty($arrayfields['cp.description']['checked'])) {
349 print_liste_field_titre($arrayfields['cp.description']['label'], $_SERVER["PHP_SELF"], 'cp.description', '', '', '', $sortfield, $sortorder);
350}
351// Action column
352if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
353 print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
354}
355print '</tr>';
356
357if ($num == 0) {
358 print '<tr><td colspan="11"><span class="opacitymedium">'.$langs->trans('None').'</span></td></tr>';
359} else {
360 $tmpuser = new User($db);
361 while ($obj = $db->fetch_object($resql)) {
362 $tmpuser->fetch($obj->fk_user);
363
364 $date_start = $db->jdate($obj->date_debut, true);
365 $date_end = $db->jdate($obj->date_fin, true);
366
367 $tmpstart = dol_getdate($date_start);
368 $tmpend = dol_getdate($date_end);
369
370 $starthalfday = ($obj->halfday == -1 || $obj->halfday == 2) ? 'afternoon' : 'morning';
371 $endhalfday = ($obj->halfday == 1 || $obj->halfday == 2) ? 'morning' : 'afternoon';
372
373 $halfdayinmonth = $obj->halfday;
374 $starthalfdayinmonth = $starthalfday;
375 $endhalfdayinmonth = $endhalfday;
376
377 //0:Full days, 2:Start afternoon end morning, -1:Start afternoon end afternoon, 1:Start morning end morning
378
379 // Set date_start_gmt and date_end_gmt that are date to show for the selected month
380 $date_start_inmonth = $db->jdate($obj->date_debut, true);
381 $date_end_inmonth = $db->jdate($obj->date_fin, true);
382 if ($tmpstart['year'] < $search_year || $tmpstart['mon'] < $search_month) {
383 $date_start_inmonth = dol_get_first_day($search_year, $search_month, true);
384 $starthalfdayinmonth = 'morning';
385 if ($halfdayinmonth == 2) {
386 $halfdayinmonth = 1;
387 }
388 if ($halfdayinmonth == -1) {
389 $halfdayinmonth = 0;
390 }
391 }
392 if ($tmpend['year'] > $search_year || $tmpend['mon'] > $search_month) {
393 $date_end_inmonth = dol_get_last_day($search_year, $search_month, true) - ((24 * 3600) - 1);
394 $endhalfdayinmonth = 'afternoon';
395 if ($halfdayinmonth == 2) {
396 $halfdayinmonth = -1;
397 }
398 if ($halfdayinmonth == 1) {
399 $halfdayinmonth = 0;
400 }
401 }
402
403 // Leave request
404 $holidaystatic->id = $obj->rowid;
405 $holidaystatic->ref = $obj->ref;
406 $holidaystatic->statut = $obj->status;
407 $holidaystatic->status = $obj->status;
408 $holidaystatic->fk_user = $obj->fk_user;
409 $holidaystatic->fk_type = $obj->fk_type;
410 $holidaystatic->description = $obj->description;
411 $holidaystatic->halfday = $obj->halfday;
412 $holidaystatic->date_debut = $db->jdate($obj->date_debut);
413 $holidaystatic->date_fin = $db->jdate($obj->date_fin);
414
415
416 print '<tr class="oddeven">';
417 // Action column
418 if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
419 print '<td></td>';
420 }
421
422 if (!empty($arrayfields['cp.ref']['checked'])) {
423 print '<td class="nowraponall">'.$holidaystatic->getNomUrl(1, 1).'</td>';
424 }
425 if (!empty($arrayfields['cp.fk_type']['checked'])) {
426 print '<td>'.$arraytypeleaves[$obj->fk_type].'</td>';
427 }
428 if (!empty($arrayfields['cp.fk_user']['checked'])) {
429 print '<td class="tdoverflowmax150">'.$tmpuser->getNomUrl(-1).'</td>';
430 }
431
432 if (!empty($arrayfields['cp.date_debut']['checked'])) {
433 print '<td class="center">'.dol_print_date($db->jdate($obj->date_debut), 'day');
434 print ' <span class="opacitymedium">('.$langs->trans($listhalfday[$starthalfday]).')</span>';
435 print '</td>';
436 }
437
438 if (!empty($arrayfields['cp.date_fin']['checked'])) {
439 print '<td class="center">'.dol_print_date($db->jdate($obj->date_fin), 'day');
440 print ' <span class="opacitymedium">('.$langs->trans($listhalfday[$endhalfday]).')</span>';
441 print '</td>';
442 }
443
444 if (!empty($arrayfields['used_days']['checked'])) {
445 print '<td class="right">'.num_open_day($date_start, $date_end, 0, 1, $obj->halfday).'</td>';
446 }
447
448 if (!empty($arrayfields['date_start_month']['checked'])) {
449 print '<td class="center">'.dol_print_date($date_start_inmonth, 'day');
450 print ' <span class="opacitymedium">('.$langs->trans($listhalfday[$starthalfdayinmonth]).')</span>';
451 print '</td>';
452 }
453
454 if (!empty($arrayfields['date_end_month']['checked'])) {
455 print '<td class="center">'.dol_print_date($date_end_inmonth, 'day');
456 print ' <span class="opacitymedium">('.$langs->trans($listhalfday[$endhalfdayinmonth]).')</span>';
457 print '</td>';
458 }
459
460 if (!empty($arrayfields['used_days_month']['checked'])) {
461 print '<td class="right">'.num_open_day($date_start_inmonth, $date_end_inmonth, 0, 1, $halfdayinmonth).'</td>';
462 }
463 if (!empty($arrayfields['cp.description']['checked'])) {
464 print '<td class="maxwidth300 small">';
465 print '<div class="twolinesmax">';
466 print dolGetFirstLineOfText(dol_string_nohtmltag($obj->description, 1));
467 print '</div>';
468 print '</td>';
469 }
470 // Action column
471 if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
472 print '<td></td>';
473 }
474 print '</tr>';
475 }
476}
477print '</table>';
478print '</div>';
479print '</form>';
480
481// End of page
482llxFooter();
483$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 generation of HTML components Only common components must be here.
Classe permettant la generation de composants html autre Only common components are here.
Class of the module paid holiday.
Class to manage Dolibarr users.
dol_get_first_day($year, $month=1, $gm=false)
Return GMT time for first day of a month or year.
Definition date.lib.php:594
dol_get_last_day($year, $month=12, $gm=false)
Return GMT time for last day of a month or year.
Definition date.lib.php:613
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
dolGetFirstLineOfText($text, $nboflines=1, $charset='UTF-8')
Return first line of text.
dol_string_nohtmltag($stringtoclean, $removelinefeed=1, $pagecodeto='UTF-8', $strip_tags=0, $removedoublespaces=1)
Clean a string from all HTML tags and entities.
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
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.
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_getdate($timestamp, $fast=false, $forcetimezone='')
Return an array with locale date info.
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $mode=0)
Check permissions of a user to show a page and an object.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.