dolibarr 23.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-2025 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 * Copyright (C) 2025 MDW <mdeweerd@users.noreply.github.com>
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 3 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program. If not, see <https://www.gnu.org/licenses/>.
21 */
22
29// Load Dolibarr environment
30require '../main.inc.php';
31require_once DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php';
32require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
33require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
34require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
35require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
36
45// Load translation files required by the page
46$langs->loadLangs(array('holiday', 'hrm'));
47
48$action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view';
49$massaction = GETPOST('massaction', 'alpha');
50$contextpage = GETPOST('contextpage', 'aZ');
51$optioncss = GETPOST('optioncss', 'aZ');
52
53$id = GETPOSTINT('id');
54
55$search_ref = GETPOST('search_ref', 'alphanohtml');
56$search_employee = GETPOST('search_employee', "intcomma");
57$search_type = GETPOST('search_type', "intcomma");
58$search_description = GETPOST('search_description', 'alphanohtml');
59
60$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit;
61$sortfield = GETPOST('sortfield', 'aZ09comma');
62$sortorder = GETPOST('sortorder', 'aZ09comma');
63
64if (!$sortfield) {
65 $sortfield = "cp.rowid";
66}
67if (!$sortorder) {
68 $sortorder = "ASC";
69}
70
71$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page");
72if (empty($page) || $page == -1) {
73 $page = 0;
74}
75
76$hookmanager->initHooks(array('leavemovementlist'));
77
78$arrayfields = array();
79$arrayofmassactions = array();
80
81// Security check
82if ($user->socid > 0) { // Protection if external user
83 //$socid = $user->socid;
85}
86$result = restrictedArea($user, 'holiday', $id);
87
88if (!$user->hasRight('holiday', 'readall')) {
90}
91
92
93/*
94 * Actions
95 */
96
97if (GETPOST('cancel', 'alpha')) {
98 $action = 'list';
99 $massaction = '';
100}
101if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') {
102 $massaction = '';
103}
104
105$parameters = array();
106$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
107if ($reshook < 0) {
108 setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
109}
110
111if (empty($reshook)) {
112 // Selection of new fields
113 include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
114
115 // Purge search criteria
116 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
117 $search_ref = '';
118 $search_employee = '';
119 $search_type = '';
120 $search_description = '';
121 $toselect = array();
122 $search_array_options = array();
123 }
124
125 if (GETPOST('button_removefilter_x', 'alpha')
126 || GETPOST('button_removefilter.x', 'alpha')
127 || GETPOST('button_removefilter', 'alpha')
128 || GETPOST('button_search_x', 'alpha')
129 || GETPOST('button_search.x', 'alpha')
130 || GETPOST('button_search', 'alpha')) {
131 $massaction = '';
132 }
133}
134
135$arrayfields = array(
136 'cp.ref' => array('label' => 'Ref', 'checked' => '1', 'position' => 5),
137 'cp.fk_type' => array('label' => 'Type', 'checked' => '1', 'position' => 10),
138 'cp.fk_user' => array('label' => 'Employee', 'checked' => '1', 'position' => 20),
139 'cp.date_debut' => array('label' => 'DateDebCP', 'checked' => '-1', 'position' => 30),
140 'cp.date_fin' => array('label' => 'DateFinCP', 'checked' => '-1', 'position' => 32),
141 'used_days' => array('label' => 'NbUseDaysCPShort', 'checked' => '-1', 'position' => 34),
142 'date_start_month' => array('label' => 'DateStartInMonth', 'checked' => '1', 'position' => 50),
143 'date_end_month' => array('label' => 'DateEndInMonth', 'checked' => '1', 'position' => 52),
144 'used_days_month' => array('label' => 'NbUseDaysCPShortInMonth', 'checked' => '1', 'position' => 54),
145 'cp.description' => array('label' => 'DescCP', 'checked' => '-1', 'position' => 800),
146);
147
148
149/*
150 * View
151 */
152
153$form = new Form($db);
154$formother = new FormOther($db);
155$holidaystatic = new Holiday($db);
156
157$listhalfday = array('morning' => $langs->trans("Morning"), "afternoon" => $langs->trans("Afternoon"));
158
159$title = $langs->trans('CPTitreMenu');
160$help_url = 'EN:Module_Holiday';
161
162llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-holiday page-month_report');
163
164$search_month = GETPOSTINT("search_month") ? GETPOSTINT("search_month") : (int) dol_print_date(dol_now(), "%m");
165$search_year = GETPOSTINT("search_year") ? GETPOSTINT("search_year") : (int) dol_print_date(dol_now(), "%Y");
166$year_month = sprintf("%04d", $search_year).'-'.sprintf("%02d", $search_month);
167
168$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";
169$sql .= " FROM ".MAIN_DB_PREFIX."holiday cp";
170$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user u ON cp.fk_user = u.rowid";
171$sql .= " WHERE cp.entity IN (".getEntity('holiday').") AND cp.rowid > 0";
172$sql .= " AND cp.statut = ".Holiday::STATUS_APPROVED;
173$sql .= " AND (";
174$sql .= " (date_format(cp.date_debut, '%Y-%m') = '".$db->escape($year_month)."' OR date_format(cp.date_fin, '%Y-%m') = '".$db->escape($year_month)."')";
175$sql .= " OR"; // For leave over several months
176$sql .= " (date_format(cp.date_debut, '%Y-%m') < '".$db->escape($year_month)."' AND date_format(cp.date_fin, '%Y-%m') > '".$db->escape($year_month)."') ";
177$sql .= " )";
178if (!empty($search_ref)) {
179 $sql .= natural_search('cp.ref', $search_ref);
180}
181if (!empty($search_employee) && $search_employee != '-1') {
182 $sql .= " AND cp.fk_user IN (".$db->sanitize($search_employee).")";
183}
184if (!empty($search_type) && $search_type != '-1') {
185 $sql .= " AND cp.fk_type IN (".$db->sanitize($search_type).")";
186}
187if (!empty($search_description)) {
188 $sql .= natural_search('cp.description', $search_description);
189}
190
191$sql .= $db->order($sortfield, $sortorder);
192
193$resql = $db->query($sql);
194if (empty($resql)) {
195 dol_print_error($db);
196 exit;
197}
198
199$num = $db->num_rows($resql);
200
201$param = '';
202if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
203 $param .= '&contextpage='.urlencode($contextpage);
204}
205if ($limit > 0 && $limit != $conf->liste_limit) {
206 $param .= '&limit='.((int) $limit);
207}
208if (!empty($search_ref)) {
209 $param .= '&search_ref='.urlencode($search_ref);
210}
211if (!empty($search_employee) && $search_employee != '-1') {
212 $param .= '&search_employee='.urlencode($search_employee);
213}
214if (!empty($search_type) && $search_type != '-1') {
215 $param .= '&search_type='.urlencode($search_type);
216}
217if (!empty($search_description)) {
218 $param .= '&search_description='.urlencode($search_description);
219}
220if (!empty($search_month)) {
221 $param .= '&search_month='.((int) $search_month);
222}
223if (!empty($search_year)) {
224 $param .= '&search_year='.((int) $search_year);
225}
226
227print '<form method="POST" id="searchFormList" action="'.dolBuildUrl($_SERVER["PHP_SELF"]).'">';
228if ($optioncss != '') {
229 print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
230}
231print '<input type="hidden" name="token" value="'.newToken().'">';
232print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
233print '<input type="hidden" name="action" value="list">';
234print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
235print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
236print '<input type="hidden" name="page" value="'.$page.'">';
237print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
238
239print load_fiche_titre($langs->trans('MenuReportMonth'), '', 'title_hrm');
240
241// Selection filter
242print '<div class="tabBar">';
243print $formother->select_month($search_month, 'search_month', 0, 1, 'minwidth75 maxwidth150imp valignmiddle', true);
244print $formother->selectyear($search_year, 'search_year', 0, 10, 5, 0, 0, '', 'valignmiddle width75', true);
245print '<input type="submit" class="button small" value="'.dol_escape_htmltag($langs->trans("Search")).'" />';
246print '</div>';
247print '<br>';
248
249//$moreforfilter = '';
250
251$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
252$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields
253$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
254
255print '<div class="div-table-responsive">';
256print '<table class="tagtable nobottomiftotal liste">';
257
258print '<tr class="liste_titre_filter">';
259
260// Action column
261if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
262 print '<th class="wrapcolumntitle center maxwidthsearch liste_titre">';
263 $searchpicto = $form->showFilterButtons('left');
264 print $searchpicto;
265 print '</th>';
266}
267
268// Filter: Ref
269if (!empty($arrayfields['cp.ref']['checked'])) {
270 print '<th class="liste_titre">';
271 print '<input class="flat maxwidth100" type="text" name="search_ref" value="'.dol_escape_htmltag($search_ref).'">';
272 print '</th>';
273}
274
275// Filter: Type
276if (!empty($arrayfields['cp.fk_type']['checked'])) {
277 $typeleaves = $holidaystatic->getTypes(1, -1);
278 $arraytypeleaves = array();
279 foreach ($typeleaves as $key => $val) {
280 $labeltoshow = ($langs->trans($val['code']) != $val['code'] ? $langs->trans($val['code']) : $val['label']);
281 $arraytypeleaves[$val['rowid']] = $labeltoshow;
282 }
283
284 print '<th class="liste_titre">';
285 print $form->selectarray('search_type', $arraytypeleaves, $search_type, 1, 0, 0, '', 0, 0, 0, '', 'maxwidth150', 1);
286 print '</th>';
287}
288
289// Filter: Employee
290if (!empty($arrayfields['cp.fk_user']['checked'])) {
291 print '<th class="liste_titre">';
292 print $form->select_dolusers($search_employee, "search_employee", 1, null, 0, '', '', '0', 0, 0, '', 0, '', 'maxwidth150');
293 print '</th>';
294}
295
296if (!empty($arrayfields['cp.date_debut']['checked'])) {
297 print '<th class="liste_titre"></th>';
298}
299if (!empty($arrayfields['cp.date_fin']['checked'])) {
300 print '<th class="liste_titre"></th>';
301}
302if (!empty($arrayfields['used_days']['checked'])) {
303 print '<th class="liste_titre"></th>';
304}
305if (!empty($arrayfields['date_start_month']['checked'])) {
306 print '<th class="liste_titre"></th>';
307}
308if (!empty($arrayfields['date_end_month']['checked'])) {
309 print '<th class="liste_titre"></th>';
310}
311if (!empty($arrayfields['used_days_month']['checked'])) {
312 print '<th class="liste_titre"></th>';
313}
314
315// Filter: Description
316if (!empty($arrayfields['cp.description']['checked'])) {
317 print '<th class="liste_titre">';
318 print '<input type="text" class="maxwidth100" name="search_description" value="'.$search_description.'">';
319 print '</th>';
320}
321// Action column
322if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
323 print '<th class="liste_titre maxwidthsearch">';
324 $searchpicto = $form->showFilterButtons();
325 print $searchpicto;
326 print '</th>';
327}
328print '</tr>';
329
330print '<tr class="liste_titre">';
331// Action column
332if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
333 print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
334}
335if (!empty($arrayfields['cp.ref']['checked'])) {
336 print_liste_field_titre($arrayfields['cp.ref']['label'], $_SERVER["PHP_SELF"], 'cp.ref', '', $param, '', $sortfield, $sortorder);
337}
338if (!empty($arrayfields['cp.fk_type']['checked'])) {
339 print_liste_field_titre($arrayfields['cp.fk_type']['label'], $_SERVER["PHP_SELF"], 'cp.fk_type', '', $param, '', $sortfield, $sortorder);
340}
341if (!empty($arrayfields['cp.fk_user']['checked'])) {
342 print_liste_field_titre($arrayfields['cp.fk_user']['label'], $_SERVER["PHP_SELF"], 'u.lastname', '', $param, '', $sortfield, $sortorder);
343}
344if (!empty($arrayfields['ct.label']['checked'])) {
345 print_liste_field_titre($arrayfields['ct.label']['label'], $_SERVER["PHP_SELF"], 'ct.label', '', $param, '', $sortfield, $sortorder);
346}
347if (!empty($arrayfields['cp.date_debut']['checked'])) {
348 print_liste_field_titre($arrayfields['cp.date_debut']['label'], $_SERVER["PHP_SELF"], 'cp.date_debut', '', $param, '', $sortfield, $sortorder, 'center ');
349}
350if (!empty($arrayfields['cp.date_fin']['checked'])) {
351 print_liste_field_titre($arrayfields['cp.date_fin']['label'], $_SERVER["PHP_SELF"], 'cp.date_fin', '', $param, '', $sortfield, $sortorder, 'center ');
352}
353if (!empty($arrayfields['used_days']['checked'])) {
354 print_liste_field_titre($arrayfields['used_days']['label'], $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'maxwidth125 right ');
355}
356if (!empty($arrayfields['date_start_month']['checked'])) {
357 print_liste_field_titre($arrayfields['date_start_month']['label'], $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'center ');
358}
359if (!empty($arrayfields['date_end_month']['checked'])) {
360 print_liste_field_titre($arrayfields['date_end_month']['label'], $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'center ');
361}
362if (!empty($arrayfields['used_days_month']['checked'])) {
363 print_liste_field_titre($arrayfields['used_days_month']['label'], $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'maxwidth125 right ');
364}
365if (!empty($arrayfields['cp.description']['checked'])) {
366 print_liste_field_titre($arrayfields['cp.description']['label'], $_SERVER["PHP_SELF"], 'cp.description', '', $param, '', $sortfield, $sortorder);
367}
368// Action column
369if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
370 print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
371}
372print '</tr>';
373
374if ($num == 0) {
375 print '<tr><td colspan="11"><span class="opacitymedium">'.$langs->trans('None').'</span></td></tr>';
376} else {
377 $tmpuser = new User($db);
378 while ($obj = $db->fetch_object($resql)) {
379 $tmpuser->fetch($obj->fk_user);
380
381 $date_start = $db->jdate($obj->date_debut, true);
382 $date_end = $db->jdate($obj->date_fin, true);
383
384 $tmpstart = dol_getdate($date_start);
385 $tmpend = dol_getdate($date_end);
386
387 $starthalfday = ($obj->halfday == -1 || $obj->halfday == 2) ? 'afternoon' : 'morning';
388 $endhalfday = ($obj->halfday == 1 || $obj->halfday == 2) ? 'morning' : 'afternoon';
389
390 $halfdayinmonth = $obj->halfday;
391 $starthalfdayinmonth = $starthalfday;
392 $endhalfdayinmonth = $endhalfday;
393
394 //0:Full days, 2:Start afternoon end morning, -1:Start afternoon end afternoon, 1:Start morning end morning
395
396 // Set date_start_gmt and date_end_gmt that are date to show for the selected month
397 $date_start_inmonth = $db->jdate($obj->date_debut, true);
398 $date_end_inmonth = $db->jdate($obj->date_fin, true);
399 if ($tmpstart['year'] < $search_year || $tmpstart['mon'] < $search_month) {
400 $date_start_inmonth = dol_get_first_day($search_year, $search_month, true);
401 $starthalfdayinmonth = 'morning';
402 if ($halfdayinmonth == 2) {
403 $halfdayinmonth = 1;
404 }
405 if ($halfdayinmonth == -1) {
406 $halfdayinmonth = 0;
407 }
408 }
409 if ($tmpend['year'] > $search_year || $tmpend['mon'] > $search_month) {
410 $date_end_inmonth = dol_get_last_day($search_year, $search_month, true) - ((24 * 3600) - 1);
411 $endhalfdayinmonth = 'afternoon';
412 if ($halfdayinmonth == 2) {
413 $halfdayinmonth = -1;
414 }
415 if ($halfdayinmonth == 1) {
416 $halfdayinmonth = 0;
417 }
418 }
419
420 // Leave request
421 $holidaystatic->id = $obj->rowid;
422 $holidaystatic->ref = $obj->ref;
423 $holidaystatic->status = $obj->status;
424 $holidaystatic->status = $obj->status;
425 $holidaystatic->fk_user = $obj->fk_user;
426 $holidaystatic->fk_type = $obj->fk_type;
427 $holidaystatic->description = $obj->description;
428 $holidaystatic->halfday = $obj->halfday;
429 $holidaystatic->date_debut = $db->jdate($obj->date_debut);
430 $holidaystatic->date_fin = $db->jdate($obj->date_fin);
431
432
433 print '<tr class="oddeven">';
434 // Action column
435 if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
436 print '<td></td>';
437 }
438
439 if (!empty($arrayfields['cp.ref']['checked'])) {
440 print '<td class="nowraponall">'.$holidaystatic->getNomUrl(1, 1).'</td>';
441 }
442 if (!empty($arrayfields['cp.fk_type']['checked'])) {
443 print '<td>'.$arraytypeleaves[$obj->fk_type].'</td>';
444 }
445 if (!empty($arrayfields['cp.fk_user']['checked'])) {
446 print '<td class="tdoverflowmax150">'.$tmpuser->getNomUrl(-1).'</td>';
447 }
448
449 if (!empty($arrayfields['cp.date_debut']['checked'])) {
450 print '<td class="center">'.dol_print_date($db->jdate($obj->date_debut), 'day');
451 print ' <span class="opacitymedium">('.$langs->trans($listhalfday[$starthalfday]).')</span>';
452 print '</td>';
453 }
454
455 if (!empty($arrayfields['cp.date_fin']['checked'])) {
456 print '<td class="center">'.dol_print_date($db->jdate($obj->date_fin), 'day');
457 print ' <span class="opacitymedium">('.$langs->trans($listhalfday[$endhalfday]).')</span>';
458 print '</td>';
459 }
460
461 if (!empty($arrayfields['used_days']['checked'])) {
462 print '<td class="right">'.num_open_day($date_start, $date_end, 0, 1, $obj->halfday, $tmpuser->country_id).'</td>';
463 }
464
465 if (!empty($arrayfields['date_start_month']['checked'])) {
466 print '<td class="center">'.dol_print_date($date_start_inmonth, 'day');
467 print ' <span class="opacitymedium">('.$langs->trans($listhalfday[$starthalfdayinmonth]).')</span>';
468 print '</td>';
469 }
470
471 if (!empty($arrayfields['date_end_month']['checked'])) {
472 print '<td class="center">'.dol_print_date($date_end_inmonth, 'day');
473 print ' <span class="opacitymedium">('.$langs->trans($listhalfday[$endhalfdayinmonth]).')</span>';
474 print '</td>';
475 }
476
477 if (!empty($arrayfields['used_days_month']['checked'])) {
478 print '<td class="right">'.num_open_day($date_start_inmonth, $date_end_inmonth, 0, 1, $halfdayinmonth, $tmpuser->country_id).'</td>';
479 }
480 if (!empty($arrayfields['cp.description']['checked'])) {
481 print '<td class="maxwidth300 small">';
482 print '<div class="twolinesmax">';
483 print dolGetFirstLineOfText(dol_string_nohtmltag($obj->description, 1));
484 print '</div>';
485 print '</td>';
486 }
487 // Action column
488 if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
489 print '<td></td>';
490 }
491 print '</tr>';
492 }
493}
494print '</table>';
495print '</div>';
496print '</form>';
497
498// End of page
499llxFooter();
500$db->close();
$id
Support class for third parties, contacts, members, users or resources.
Definition account.php:47
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 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:603
dol_get_last_day($year, $month=12, $gm=false)
Return GMT time for last day of a month or year.
Definition date.lib.php:622
dol_now($mode='gmt')
Return date for now.
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.
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, $sqltoadd='')
Generate natural SQL search string for a criteria (this criteria can be tested on one or several fiel...
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_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false, $decorate=0)
Output date in a string format according to outputlangs (or langs if not defined).
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='', $morecssonpicto='widthpictotitle')
Load a title with picto.
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.