dolibarr 18.0.6
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'; $massaction = '';
89}
90if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') {
91 $massaction = '';
92}
93
94$parameters = array();
95$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
96if ($reshook < 0) {
97 setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
98}
99
100if (empty($reshook)) {
101 // Selection of new fields
102 include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
103
104 // Purge search criteria
105 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
106 $search_ref = '';
107 $search_employee = '';
108 $search_type = '';
109 $search_description = '';
110 $toselect = array();
111 $search_array_options = array();
112 }
113
114 if (GETPOST('button_removefilter_x', 'alpha')
115 || GETPOST('button_removefilter.x', 'alpha')
116 || GETPOST('button_removefilter', 'alpha')
117 || GETPOST('button_search_x', 'alpha')
118 || GETPOST('button_search.x', 'alpha')
119 || GETPOST('button_search', 'alpha')) {
120 $massaction = '';
121 }
122}
123
124$arrayfields = array(
125 'cp.ref'=>array('label' => 'Ref', 'checked'=>1, 'position'=>5),
126 'cp.fk_type'=>array('label' => 'Type', 'checked'=>1, 'position'=>10),
127 'cp.fk_user'=>array('label' => 'Employee', 'checked'=>1, 'position'=>20),
128 'cp.date_debut'=>array('label' => 'DateDebCP', 'checked'=>-1, 'position'=>30),
129 'cp.date_fin'=>array('label' => 'DateFinCP', 'checked'=>-1, 'position'=>32),
130 'used_days'=>array('label' => 'NbUseDaysCPShort', 'checked'=>-1, 'position'=>34),
131 'date_start_month'=>array('label' => 'DateStartInMonth', 'checked'=>1, 'position'=>50),
132 'date_end_month'=>array('label' => 'DateEndInMonth', 'checked'=>1, 'position'=>52),
133 'used_days_month'=>array('label' => 'NbUseDaysCPShortInMonth', 'checked'=>1, 'position'=>54),
134 'cp.description'=>array('label' => 'DescCP', 'checked'=>-1, 'position'=>800),
135);
136
137
138/*
139 * View
140 */
141
142$form = new Form($db);
143$formother = new FormOther($db);
144$holidaystatic = new Holiday($db);
145
146$listhalfday = array('morning'=>$langs->trans("Morning"), "afternoon"=>$langs->trans("Afternoon"));
147
148$title = $langs->trans('CPTitreMenu');
149
150llxHeader('', $title);
151
152$search_month = GETPOST("remonth", 'int') ?GETPOST("remonth", 'int') : date("m", time());
153$search_year = GETPOST("reyear", 'int') ?GETPOST("reyear", 'int') : date("Y", time());
154$year_month = sprintf("%04d", $search_year).'-'.sprintf("%02d", $search_month);
155
156$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";
157$sql .= " FROM ".MAIN_DB_PREFIX."holiday cp";
158$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user u ON cp.fk_user = u.rowid";
159$sql .= " WHERE cp.rowid > 0";
160$sql .= " AND cp.statut = ".Holiday::STATUS_APPROVED;
161$sql .= " AND (";
162$sql .= " (date_format(cp.date_debut, '%Y-%m') = '".$db->escape($year_month)."' OR date_format(cp.date_fin, '%Y-%m') = '".$db->escape($year_month)."')";
163$sql .= " OR"; // For leave over several months
164$sql .= " (date_format(cp.date_debut, '%Y-%m') < '".$db->escape($year_month)."' AND date_format(cp.date_fin, '%Y-%m') > '".$db->escape($year_month)."') ";
165$sql .= " )";
166if (!empty($search_ref)) {
167 $sql .= natural_search('cp.ref', $search_ref);
168}
169if (!empty($search_employee) && $search_employee > 0) {
170 $sql .= " AND cp.fk_user = ".((int) $search_employee);
171}
172if (!empty($search_type) && $search_type != '-1') {
173 $sql .= ' AND cp.fk_type IN ('.$db->sanitize($search_type).')';
174}
175if (!empty($search_description)) {
176 $sql .= natural_search('cp.description', $search_description);
177}
178
179$sql .= $db->order($sortfield, $sortorder);
180
181$resql = $db->query($sql);
182if (empty($resql)) {
183 dol_print_error($db);
184 exit;
185}
186
187$num = $db->num_rows($resql);
188
189$param = '';
190if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
191 $param .= '&contextpage='.urlencode($contextpage);
192}
193if ($limit > 0 && $limit != $conf->liste_limit) {
194 $param .= '&limit='.((int) $limit);
195}
196if (!empty($search_ref)) {
197 $param .= '&search_ref='.urlencode($search_ref);
198}
199if (!empty($search_employee)) {
200 $param .= '&search_employee='.urlencode($search_employee);
201}
202if (!empty($search_type)) {
203 $param .= '&search_type='.urlencode($search_type);
204}
205if (!empty($search_description)) {
206 $param .= '&search_description='.urlencode($search_description);
207}
208
209print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
210if ($optioncss != '') {
211 print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
212}
213print '<input type="hidden" name="token" value="'.newToken().'">';
214print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
215print '<input type="hidden" name="action" value="list">';
216print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
217print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
218print '<input type="hidden" name="page" value="'.$page.'">';
219print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
220
221print load_fiche_titre($langs->trans('MenuReportMonth'), '', 'title_hrm');
222
223// Selection filter
224print '<div class="tabBar">';
225print $formother->select_month($search_month, 'remonth', 0, 0, 'minwidth50 maxwidth75imp valignmiddle', true);
226print $formother->selectyear($search_year, 'reyear', 0, 10, 5, 0, 0, '', 'valignmiddle width75', true);
227print '<input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("Search")).'" />';
228print '</div>';
229print '<br>';
230
231$moreforfilter = '';
232
233$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
234$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields
235$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
236
237print '<div class="div-table-responsive">';
238print '<table class="tagtable nobottomiftotal liste">';
239
240print '<tr class="liste_titre_filter">';
241
242// Action column
243if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
244 print '<th class="wrapcolumntitle center maxwidthsearch liste_titre">';
245 $searchpicto = $form->showFilterButtons('left');
246 print $searchpicto;
247 print '</th>';
248}
249
250// Filter: Ref
251if (!empty($arrayfields['cp.ref']['checked'])) {
252 print '<th class="liste_titre">';
253 print '<input class="flat maxwidth100" type="text" name="search_ref" value="'.dol_escape_htmltag($search_ref).'">';
254 print '</th>';
255}
256
257// Filter: Type
258if (!empty($arrayfields['cp.fk_type']['checked'])) {
259 $typeleaves = $holidaystatic->getTypes(1, -1);
260 $arraytypeleaves = array();
261 foreach ($typeleaves as $key => $val) {
262 $labeltoshow = ($langs->trans($val['code']) != $val['code'] ? $langs->trans($val['code']) : $val['label']);
263 $arraytypeleaves[$val['rowid']] = $labeltoshow;
264 }
265
266 print '<th class="liste_titre">';
267 print $form->selectarray('search_type', $arraytypeleaves, $search_type, 1, 0, 0, '', 0, 0, 0, '', 'maxwidth100', 1);
268 print '</th>';
269}
270
271// Filter: Employee
272if (!empty($arrayfields['cp.fk_user']['checked'])) {
273 print '<th class="liste_titre">';
274 print $form->select_dolusers($search_employee, "search_employee", 1, null, 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth100');
275 print '</th>';
276}
277
278if (!empty($arrayfields['cp.date_debut']['checked'])) {
279 print '<th class="liste_titre"></th>';
280}
281if (!empty($arrayfields['cp.date_fin']['checked'])) {
282 print '<th class="liste_titre"></th>';
283}
284if (!empty($arrayfields['used_days']['checked'])) {
285 print '<th class="liste_titre"></th>';
286}
287if (!empty($arrayfields['date_start_month']['checked'])) {
288 print '<th class="liste_titre"></th>';
289}
290if (!empty($arrayfields['date_end_month']['checked'])) {
291 print '<th class="liste_titre"></th>';
292}
293if (!empty($arrayfields['used_days_month']['checked'])) {
294 print '<th class="liste_titre"></th>';
295}
296
297// Filter: Description
298if (!empty($arrayfields['cp.description']['checked'])) {
299 print '<th class="liste_titre">';
300 print '<input type="text" class="maxwidth100" name="search_description" value="'.$search_description.'">';
301 print '</th>';
302}
303// Action column
304if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
305 print '<th class="liste_titre maxwidthsearch">';
306 $searchpicto = $form->showFilterButtons();
307 print $searchpicto;
308 print '</th>';
309}
310print '</tr>';
311
312print '<tr class="liste_titre">';
313// Action column
314if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
315 print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
316}
317if (!empty($arrayfields['cp.ref']['checked'])) {
318 print_liste_field_titre($arrayfields['cp.ref']['label'], $_SERVER["PHP_SELF"], 'cp.ref', '', '', '', $sortfield, $sortorder);
319}
320if (!empty($arrayfields['cp.fk_type']['checked'])) {
321 print_liste_field_titre($arrayfields['cp.fk_type']['label'], $_SERVER["PHP_SELF"], 'cp.fk_type', '', '', '', $sortfield, $sortorder);
322}
323if (!empty($arrayfields['cp.fk_user']['checked'])) {
324 print_liste_field_titre($arrayfields['cp.fk_user']['label'], $_SERVER["PHP_SELF"], 'cp.fk_user', '', '', '', $sortfield, $sortorder);
325}
326if (!empty($arrayfields['ct.label']['checked'])) {
327 print_liste_field_titre($arrayfields['ct.label']['label'], $_SERVER["PHP_SELF"], 'ct.label', '', '', '', $sortfield, $sortorder);
328}
329if (!empty($arrayfields['cp.date_debut']['checked'])) {
330 print_liste_field_titre($arrayfields['cp.date_debut']['label'], $_SERVER["PHP_SELF"], 'cp.date_debut', '', '', '', $sortfield, $sortorder, 'center ');
331}
332if (!empty($arrayfields['cp.date_fin']['checked'])) {
333 print_liste_field_titre($arrayfields['cp.date_fin']['label'], $_SERVER["PHP_SELF"], 'cp.date_fin', '', '', '', $sortfield, $sortorder, 'center ');
334}
335if (!empty($arrayfields['used_days']['checked'])) {
336 print_liste_field_titre($arrayfields['used_days']['label'], $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'maxwidth125 right ');
337}
338if (!empty($arrayfields['date_start_month']['checked'])) {
339 print_liste_field_titre($arrayfields['date_start_month']['label'], $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center ');
340}
341if (!empty($arrayfields['date_end_month']['checked'])) {
342 print_liste_field_titre($arrayfields['date_end_month']['label'], $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center ');
343}
344if (!empty($arrayfields['used_days_month']['checked'])) {
345 print_liste_field_titre($arrayfields['used_days_month']['label'], $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'maxwidth125 right ');
346}
347if (!empty($arrayfields['cp.description']['checked'])) {
348 print_liste_field_titre($arrayfields['cp.description']['label'], $_SERVER["PHP_SELF"], 'cp.description', '', '', '', $sortfield, $sortorder);
349}
350// Action column
351if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
352 print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
353}
354print '</tr>';
355
356if ($num == 0) {
357 print '<tr><td colspan="11"><span class="opacitymedium">'.$langs->trans('None').'</span></td></tr>';
358} else {
359 $tmpuser = new User($db);
360 while ($obj = $db->fetch_object($resql)) {
361 $tmpuser->fetch($obj->fk_user);
362
363 $date_start = $db->jdate($obj->date_debut, true);
364 $date_end = $db->jdate($obj->date_fin, true);
365
366 $tmpstart = dol_getdate($date_start);
367 $tmpend = dol_getdate($date_end);
368
369 $starthalfday = ($obj->halfday == -1 || $obj->halfday == 2) ? 'afternoon' : 'morning';
370 $endhalfday = ($obj->halfday == 1 || $obj->halfday == 2) ? 'morning' : 'afternoon';
371
372 $halfdayinmonth = $obj->halfday;
373 $starthalfdayinmonth = $starthalfday;
374 $endhalfdayinmonth = $endhalfday;
375
376 //0:Full days, 2:Start afternoon end morning, -1:Start afternoon end afternoon, 1:Start morning end morning
377
378 // Set date_start_gmt and date_end_gmt that are date to show for the selected month
379 $date_start_inmonth = $db->jdate($obj->date_debut, true);
380 $date_end_inmonth = $db->jdate($obj->date_fin, true);
381 if ($tmpstart['year'] < $search_year || $tmpstart['mon'] < $search_month) {
382 $date_start_inmonth = dol_get_first_day($search_year, $search_month, true);
383 $starthalfdayinmonth = 'morning';
384 if ($halfdayinmonth == 2) {
385 $halfdayinmonth = 1;
386 }
387 if ($halfdayinmonth == -1) {
388 $halfdayinmonth = 0;
389 }
390 }
391 if ($tmpend['year'] > $search_year || $tmpend['mon'] > $search_month) {
392 $date_end_inmonth = dol_get_last_day($search_year, $search_month, true) - ((24 * 3600) - 1);
393 $endhalfdayinmonth = 'afternoon';
394 if ($halfdayinmonth == 2) {
395 $halfdayinmonth = -1;
396 }
397 if ($halfdayinmonth == 1) {
398 $halfdayinmonth = 0;
399 }
400 }
401
402 // Leave request
403 $holidaystatic->id = $obj->rowid;
404 $holidaystatic->ref = $obj->ref;
405 $holidaystatic->statut = $obj->status;
406 $holidaystatic->status = $obj->status;
407 $holidaystatic->fk_user = $obj->fk_user;
408 $holidaystatic->fk_type = $obj->fk_type;
409 $holidaystatic->description = $obj->description;
410 $holidaystatic->halfday = $obj->halfday;
411 $holidaystatic->date_debut = $db->jdate($obj->date_debut);
412 $holidaystatic->date_fin = $db->jdate($obj->date_fin);
413
414
415 print '<tr class="oddeven">';
416 // Action column
417 if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
418 print '<td></td>';
419 }
420
421 if (!empty($arrayfields['cp.ref']['checked'])) {
422 print '<td class="nowraponall">'.$holidaystatic->getNomUrl(1, 1).'</td>';
423 }
424 if (!empty($arrayfields['cp.fk_type']['checked'])) {
425 print '<td>'.$arraytypeleaves[$obj->fk_type].'</td>';
426 }
427 if (!empty($arrayfields['cp.fk_user']['checked'])) {
428 print '<td class="tdoverflowmax150">'.$tmpuser->getNomUrl(-1).'</td>';
429 }
430
431 if (!empty($arrayfields['cp.date_debut']['checked'])) {
432 print '<td class="center">'.dol_print_date($db->jdate($obj->date_debut), 'day');
433 print ' <span class="opacitymedium">('.$langs->trans($listhalfday[$starthalfday]).')</span>';
434 print '</td>';
435 }
436
437 if (!empty($arrayfields['cp.date_fin']['checked'])) {
438 print '<td class="center">'.dol_print_date($db->jdate($obj->date_fin), 'day');
439 print ' <span class="opacitymedium">('.$langs->trans($listhalfday[$endhalfday]).')</span>';
440 print '</td>';
441 }
442
443 if (!empty($arrayfields['used_days']['checked'])) {
444 print '<td class="right">'.num_open_day($date_start, $date_end, 0, 1, $obj->halfday).'</td>';
445 }
446
447 if (!empty($arrayfields['date_start_month']['checked'])) {
448 print '<td class="center">'.dol_print_date($date_start_inmonth, 'day');
449 print ' <span class="opacitymedium">('.$langs->trans($listhalfday[$starthalfdayinmonth]).')</span>';
450 print '</td>';
451 }
452
453 if (!empty($arrayfields['date_end_month']['checked'])) {
454 print '<td class="center">'.dol_print_date($date_end_inmonth, 'day');
455 print ' <span class="opacitymedium">('.$langs->trans($listhalfday[$endhalfdayinmonth]).')</span>';
456 print '</td>';
457 }
458
459 if (!empty($arrayfields['used_days_month']['checked'])) {
460 print '<td class="right">'.num_open_day($date_start_inmonth, $date_end_inmonth, 0, 1, $halfdayinmonth).'</td>';
461 }
462 if (!empty($arrayfields['cp.description']['checked'])) {
463 print '<td class="maxwidth300 small">';
464 print '<div class="twolinesmax">';
465 print dolGetFirstLineOfText(dol_string_nohtmltag($obj->description, 1));
466 print '</div>';
467 print '</td>';
468 }
469 // Action column
470 if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
471 print '<td></td>';
472 }
473 print '</tr>';
474 }
475}
476print '</table>';
477print '</div>';
478print '</form>';
479
480// End of page
481llxFooter();
482$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:56
llxFooter()
Empty footer.
Definition wrapper.php:70
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:577
dol_get_last_day($year, $month=12, $gm=false)
Return GMT time for last day of a month or year.
Definition date.lib.php:596
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.