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