dolibarr 22.0.5
view_log.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2007-2016 Laurent Destailleur <eldy@users.sourceforge.net>
3 * Copyright (C) 2011 Dimitri Mouillard <dmouillard@teclib.com>
4 * Copyright (C) 2020 Tobias Sekan <tobias.sekan@startmail.com>
5 * Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
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
30// Load Dolibarr environment
31require '../main.inc.php';
32
33// Security check (access forbidden for external user too)
34if (!$user->hasRight('holiday', 'define_holiday') || $user->socid > 0) {
36}
37
38require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
39require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
40require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
41require_once DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php';
42
51// Load translation files required by the page
52$langs->loadLangs(array('users', 'other', 'holiday'));
53
54$action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ...
55$massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists)
56$mode = GETPOST('mode', 'alpha');
57$show_files = GETPOSTINT('show_files'); // Show files area generated by bulk actions ?
58$confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation
59$cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button
60$toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list
61$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'myobjectlist'; // To manage different context of search
62$backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page
63$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
64
65$search_id = GETPOST('search_id', 'alphanohtml');
66$search_month = GETPOSTINT('search_month');
67$search_year = GETPOSTINT('search_year');
68$search_employee = GETPOST('search_employee', "intcomma");
69$search_validator = GETPOST('search_validator', "intcomma");
70$search_description = GETPOST('search_description', 'alphanohtml');
71$search_type = GETPOST('search_type', "intcomma");
72$search_prev_solde = GETPOST('search_prev_solde', 'alphanohtml');
73$search_new_solde = GETPOST('search_new_solde', 'alphanohtml');
74
75// Load variable for pagination
76$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit;
77$sortfield = GETPOST('sortfield', 'aZ09comma');
78$sortorder = GETPOST('sortorder', 'aZ09comma');
79$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page");
80if (empty($page) || $page == -1 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha') || (empty($toselect) && $massaction === '0')) {
81 $page = 0;
82} // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action
83$offset = $limit * $page;
84$pageprev = $page - 1;
85$pagenext = $page + 1;
86if (!$sortfield) {
87 $sortfield = "cpl.rowid";
88}
89if (!$sortorder) {
90 $sortorder = "DESC";
91}
92
93// Initialize a technical objects
94$object = new Holiday($db);
95$extrafields = new ExtraFields($db);
96//$diroutputmassaction = $conf->mymodule->dir_output . '/temp/massgeneration/'.$user->id;
97$hookmanager->initHooks(array('leavemovementlist')); // Note that conf->hooks_modules contains array
98
99$arrayfields = array();
100$arrayofmassactions = array();
101
102if (!isModEnabled('holiday')) {
103 accessforbidden('Module not enabled');
104}
105
106// Si l'utilisateur n'a pas le droit de lire cette page
107if (!$user->hasRight('holiday', 'readall')) {
109}
110
111
112/*
113 * Actions
114 */
115
116if (GETPOST('cancel', 'alpha')) {
117 $action = 'list';
118 $massaction = '';
119}
120if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') {
121 $massaction = '';
122}
123
124$parameters = array();
125$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
126if ($reshook < 0) {
127 setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
128}
129
130if (empty($reshook)) {
131 // Selection of new fields
132 include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
133
134 // Purge search criteria
135 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
136 $search_id = '';
137 $search_month = '';
138 $search_year = '';
139 $search_employee = '';
140 $search_validator = '';
141 $search_description = '';
142 $search_type = '';
143 $search_prev_solde = '';
144 $search_new_solde = '';
145 $toselect = array();
146 $search_array_options = array();
147 }
148
149 if (GETPOST('button_removefilter_x', 'alpha')
150 || GETPOST('button_removefilter.x', 'alpha')
151 || GETPOST('button_removefilter', 'alpha')
152 || GETPOST('button_search_x', 'alpha')
153 || GETPOST('button_search.x', 'alpha')
154 || GETPOST('button_search', 'alpha')) {
155 $massaction = ''; // Protection to avoid mass action if we force a new search during a mass action confirmation
156 }
157
158 // Mass actions
159 /*$objectclass='MyObject';
160 $objectlabel='MyObject';
161 $permissiontoread = $user->rights->mymodule->read;
162 $permissiontodelete = $user->rights->mymodule->delete;
163 $uploaddir = $conf->mymodule->dir_output;
164 include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
165 */
166}
167
168
169// Definition of fields for lists
170$arrayfields = array(
171 'cpl.rowid' => array('label' => "ID", 'checked' => '1'),
172 'cpl.date_action' => array('label' => "Date", 'checked' => '1'),
173 'cpl.fk_user_action' => array('label' => "ActionByCP", 'checked' => '1'),
174 'cpl.fk_user_update' => array('label' => "UserUpdateCP", 'checked' => '1'),
175 'cpl.type_action' => array('label' => "Description", 'checked' => '1'),
176 'cpl.fk_type' => array('label' => "Type", 'checked' => '1'),
177 'cpl.prev_solde' => array('label' => "PrevSoldeCP", 'checked' => '1'),
178 'variation' => array('label' => "Variation", 'checked' => '1'),
179 'cpl.new_solde' => array('label' => "NewSoldeCP", 'checked' => '1'),
180);
181
182
183/*
184 * View
185 */
186
187$form = new Form($db);
188$formother = new FormOther($db);
189$holidaylogstatic = new stdClass();
190$alltypeleaves = $object->getTypes(1, -1); // To have labels
191
192$title = $langs->trans('CPTitreMenu');
193$help_url = 'EN:Module_Holiday';
194
195llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-holiday page-view_log');
196
197$sqlwhere = '';
198
199if (!empty($search_year) && $search_year > 0) {
200 if (!empty($search_month) && $search_month > 0) {
201 $from_date = dol_get_first_day($search_year, $search_month, 1);
202 $to_date = dol_get_last_day($search_year, $search_month, 1);
203 } else {
204 $from_date = dol_get_first_day($search_year, 1, 1);
205 $to_date = dol_get_last_day($search_year, 12, 1);
206 }
207
208 $sqlwhere .= "AND date_action BETWEEN '".$db->idate($from_date)."' AND '".$db->idate($to_date)."'";
209}
210
211if (!empty($search_id) && $search_id > 0) {
212 $sqlwhere .= natural_search('rowid', $search_id, 1);
213}
214if (!empty($search_validator) && $search_validator > 0) {
215 $sqlwhere .= natural_search('fk_user_action', $search_validator, 1);
216}
217if (!empty($search_employee) && $search_employee > 0) {
218 $sqlwhere .= natural_search('fk_user_update', $search_employee, 1);
219}
220if (!empty($search_description)) {
221 $sqlwhere .= natural_search('type_action', $search_description);
222}
223if (!empty($search_type) && $search_type > 0) {
224 $sqlwhere .= natural_search('fk_type', $search_type, 1);
225}
226if (!empty($search_prev_solde)) {
227 $sqlwhere .= natural_search('prev_solde', $search_prev_solde, 1);
228}
229if (!empty($search_new_solde)) {
230 $sqlwhere .= natural_search('new_solde', $search_new_solde, 1);
231}
232
233$sqlorder = $db->order($sortfield, $sortorder);
234
235// Recent changes are more important than old changes
236$log_holiday = $object->fetchLog($sqlorder, $sqlwhere); // Load $object->logs
237
238// Count total nb of records
239$nbtotalofrecords = '';
240if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
241 //TODO: $result = $db->query($sql);
242 //TODO: $nbtotalofrecords = $db->num_rows($result);
243 $nbtotalofrecords = is_array($object->logs) ? count($object->logs) : 0;
244
245 if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
246 $page = 0;
247 $offset = 0;
248 }
249}
250
251// TODO: $num = $db->num_rows($resql);
252$num = is_array($object->logs) ? count($object->logs) : 0;
253
254$param = '';
255if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
256 $param .= '&contextpage='.urlencode($contextpage);
257}
258if ($limit > 0 && $limit != $conf->liste_limit) {
259 $param .= '&limit='.((int) $limit);
260}
261if (!empty($search_id)) {
262 $param .= '&search_status='.urlencode($search_status);
263}
264if (!empty($search_month) && $search_month > 0) {
265 $param .= '&search_month='.urlencode((string) ($search_month));
266}
267if (!empty($search_year) && $search_year > 0) {
268 $param .= '&search_year='.urlencode((string) ($search_year));
269}
270if (!empty($search_validator) && $search_validator > 0) {
271 $param .= '&search_validator='.urlencode((string) ($search_validator));
272}
273if (!empty($search_employee) && $search_employee > 0) {
274 $param .= '&search_employee='.urlencode((string) ($search_employee));
275}
276if (!empty($search_description)) {
277 $param .= '&search_description='.urlencode($search_description);
278}
279if (!empty($search_type) && $search_type > 0) {
280 $param .= '&search_type='.urlencode((string) ($search_type));
281}
282if (!empty($search_prev_solde)) {
283 $param .= '&search_prev_solde='.urlencode($search_prev_solde);
284}
285if (!empty($search_new_solde)) {
286 $param .= '&search_new_solde='.urlencode($search_new_solde);
287}
288
289print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
290if ($optioncss != '') {
291 print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
292}
293print '<input type="hidden" name="token" value="'.newToken().'">';
294print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
295print '<input type="hidden" name="action" value="list">';
296print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
297print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
298print '<input type="hidden" name="page" value="'.$page.'">';
299print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
300
301$newcardbutton = dolGetButtonTitle($langs->trans('MenuAddCP'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/holiday/card.php?action=create', '', $user->hasRight('holiday', 'write'));
302// @phan-suppress-next-line PhanPluginSuspiciousParamOrder
303print_barre_liste($langs->trans('LogCP'), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_hrm', 0, $newcardbutton, '', $limit, 0, 0, 1);
304
305print '<div class="info">'.$langs->trans('LastUpdateCP').': ';
306
307$lastUpdate = $object->getConfCP('lastUpdate');
308if ($lastUpdate) {
309 $monthLastUpdate = $lastUpdate[4].$lastUpdate[5];
310 $yearLastUpdate = $lastUpdate[0].$lastUpdate[1].$lastUpdate[2].$lastUpdate[3];
311 print '<strong>'.dol_print_date($db->jdate($object->getConfCP('lastUpdate')), 'dayhour', 'tzuser').'</strong>';
312 print '<br>';
313 print $langs->trans("MonthOfLastMonthlyUpdate").': <strong>'.$yearLastUpdate.'-'.$monthLastUpdate.'</strong>';
314} else {
315 print $langs->trans('None');
316}
317print '</div>';
318print '<br>';
319
320$moreforfilter = '';
321$morefilter = '';
322$disabled = 0;
323$include = '';
324
325$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
326$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup
327$selectedfields = ($mode != 'kanban' ? $htmlofselectarray : '');
328$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
329
330print '<div class="div-table-responsive">';
331print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'" id="tablelines3">';
332
333print '<tr class="liste_titre_filter">';
334
335// Action column
336if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
337 print '<td class="liste_titre maxwidthsearch">';
338 $searchpicto = $form->showFilterButtons();
339 print $searchpicto;
340 print '</td>';
341}
342
343// Filter Id
344if (!empty($arrayfields['cpl.rowid']['checked'])) {
345 print '<td class="liste_titre"><input type="text" class="maxwidth50" name="search_id" value="'.$search_id.'"></td>';
346}
347
348// Filter: Date
349if (!empty($arrayfields['cpl.date_action']['checked'])) {
350 print '<td class="liste_titre center">';
351 print '<input class="flat valignmiddle maxwidth25" type="text" maxlength="2" name="search_month" value="'.dol_escape_htmltag($search_month ? (string) $search_month : '').'">';
352 print $formother->selectyear($search_year, 'search_year', 1, 10, 5, 0, 0, '', 'valignmiddle width75', true);
353 print '</td>';
354}
355
356// Filter: Validator
357if (!empty($arrayfields['cpl.fk_user_action']['checked'])) {
358 $validator = new UserGroup($db);
359 $excludefilter = $user->admin ? '' : 'u.rowid <> '.((int) $user->id);
360 $valideurobjects = $validator->listUsersForGroup($excludefilter, 1);
361 $valideurarray = array();
362 foreach ($valideurobjects as $val) {
363 $valideurarray[$val] = $val;
364 }
365
366 print '<td class="liste_titre">';
367 print $form->select_dolusers($search_validator, "search_validator", 1, null, 0, $valideurarray, '', '0', 0, 0, $morefilter, 0, '', 'maxwidth200');
368 print '</td>';
369}
370
371// Filter: User
372if (!empty($arrayfields['cpl.fk_user_update']['checked'])) {
373 print '<td class="liste_titre">';
374 print $form->select_dolusers($search_employee, "search_employee", 1, null, $disabled, $include, '', '0', 0, 0, $morefilter, 0, '', 'maxwidth200');
375 print '</td>';
376}
377
378// Filter: Description
379if (!empty($arrayfields['cpl.type_action']['checked'])) {
380 print '<td class="liste_titre">';
381 print '<input type="text" class="maxwidth50" name="search_description" value="'.$search_description.'">';
382 print '</td>';
383}
384
385// Filter: Type
386if (!empty($arrayfields['cpl.fk_type']['checked'])) {
387 $arraytypeleaves = array();
388 foreach ($alltypeleaves as $key => $val) {
389 $labeltoshow = ($langs->trans($val['code']) != $val['code'] ? $langs->trans($val['code']) : $val['label']);
390 $arraytypeleaves[$val['rowid']] = $labeltoshow;
391 }
392
393 print '<td class="liste_titre">';
394 print $form->selectarray('search_type', $arraytypeleaves, $search_type, 1, 0, 0, '', 0, 0, 0, '', '', 1);
395 print '</td>';
396}
397
398// Filter: Previous balance
399if (!empty($arrayfields['cpl.prev_solde']['checked'])) {
400 print '<td class="liste_titre right">';
401 print '<input type="text" class="maxwidth50" name="search_prev_solde" value="'.$search_prev_solde.'">';
402 print '</td>';
403}
404
405// Filter: Variation (only placeholder)
406if (!empty($arrayfields['variation']['checked'])) {
407 print '<td class="liste_titre"></td>';
408}
409
410// Filter: New Balance
411if (!empty($arrayfields['cpl.new_solde']['checked'])) {
412 print '<td class="liste_titre right">';
413 print '<input type="text" class="maxwidth50" name="search_new_solde" value="'.$search_new_solde.'">';
414 print '</td>';
415}
416
417// Action column
418if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
419 print '<td class="liste_titre maxwidthsearch">';
420 $searchpicto = $form->showFilterButtons();
421 print $searchpicto;
422 print '</td>';
423}
424print '</tr>';
425
426print '<tr class="liste_titre">';
427// Action column
428if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
429 print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ');
430}
431if (!empty($arrayfields['cpl.rowid']['checked'])) {
432 print_liste_field_titre($arrayfields['cpl.rowid']['label'], $_SERVER["PHP_SELF"], 'cpl.rowid', '', '', '', $sortfield, $sortorder);
433}
434if (!empty($arrayfields['cpl.date_action']['checked'])) {
435 print_liste_field_titre($arrayfields['cpl.date_action']['label'], $_SERVER["PHP_SELF"], 'date_action', '', '', '', $sortfield, $sortorder, 'center ');
436}
437if (!empty($arrayfields['cpl.fk_user_action']['checked'])) {
438 print_liste_field_titre($arrayfields['cpl.fk_user_action']['label'], $_SERVER["PHP_SELF"], 'fk_user_action', '', '', '', $sortfield, $sortorder);
439}
440if (!empty($arrayfields['cpl.fk_user_update']['checked'])) {
441 print_liste_field_titre($arrayfields['cpl.fk_user_update']['label'], $_SERVER["PHP_SELF"], 'fk_user_update', '', '', '', $sortfield, $sortorder);
442}
443if (!empty($arrayfields['cpl.type_action']['checked'])) {
444 print_liste_field_titre($arrayfields['cpl.type_action']['label'], $_SERVER["PHP_SELF"], 'type_action', '', '', '', $sortfield, $sortorder);
445}
446if (!empty($arrayfields['cpl.fk_type']['checked'])) {
447 print_liste_field_titre($arrayfields['cpl.fk_type']['label'], $_SERVER["PHP_SELF"], 'fk_type', '', '', '', $sortfield, $sortorder);
448}
449if (!empty($arrayfields['cpl.prev_solde']['checked'])) {
450 print_liste_field_titre($arrayfields['cpl.prev_solde']['label'], $_SERVER["PHP_SELF"], 'prev_solde', '', '', '', $sortfield, $sortorder, 'right ');
451}
452if (!empty($arrayfields['variation']['checked'])) {
453 print_liste_field_titre($arrayfields['variation']['label'], $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'right ');
454}
455if (!empty($arrayfields['cpl.new_solde']['checked'])) {
456 print_liste_field_titre($arrayfields['cpl.new_solde']['label'], $_SERVER["PHP_SELF"], 'new_solde', '', '', '', $sortfield, $sortorder, 'right ');
457}
458// Action column
459if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
460 print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ');
461}
462print '</tr>';
463
464
465$j = 0;
466while ($j < ($page * $limit)) {
467 $obj = next($object->logs);
468 $j++;
469}
470
471$i = 0;
472while ($i < min($num, $limit)) {
473 //TODO: $obj = $db->fetch_object($resql);
474 $obj = current($object->logs);
475 if (empty($obj)) {
476 break;
477 }
478
479 $holidaylogstatic->id = (int) $obj['rowid'];
480 $holidaylogstatic->date = (string) $obj['date_action'];
481 $holidaylogstatic->validator = (int) $obj['fk_user_action'];
482 $holidaylogstatic->employee = (int) $obj['fk_user_update'];
483 $holidaylogstatic->description = (string) $obj['type_action'];
484 $holidaylogstatic->type = (int) $obj['fk_type'];
485 $holidaylogstatic->balance_previous = (float) $obj['prev_solde'];
486 $holidaylogstatic->balance_new = (float) $obj['new_solde'];
487
488 print '<tr class="oddeven">';
489
490 // Action column
491 if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
492 print '<td></td>';
493 }
494
495 // Id
496 if (!empty($arrayfields['cpl.rowid']['checked'])) {
497 print '<td>'.$holidaylogstatic->id.'</td>';
498 }
499
500 // Date
501 if (!empty($arrayfields['cpl.date_action']['checked'])) {
502 print '<td style="text-align: center">'.$holidaylogstatic->date.'</td>';
503 }
504
505 // Validator
506 if (!empty($arrayfields['cpl.fk_user_action']['checked'])) {
507 $user_action = new User($db);
508 $user_action->fetch($holidaylogstatic->validator);
509 print '<td>'.$user_action->getNomUrl(-1).'</td>';
510 }
511
512 // Emloyee
513 if (!empty($arrayfields['cpl.fk_user_update']['checked'])) {
514 $user_update = new User($db);
515 $user_update->fetch($holidaylogstatic->employee);
516 print '<td>'.$user_update->getNomUrl(-1).'</td>';
517 }
518
519 // Description
520 if (!empty($arrayfields['cpl.type_action']['checked'])) {
521 print '<td class="tdoverflowmax400" title="'.dol_escape_htmltag($holidaylogstatic->description).'">'.dol_escape_htmltag($holidaylogstatic->description).'</td>';
522 }
523
524 // Type
525 if (!empty($arrayfields['cpl.fk_type']['checked'])) {
526 $label = '';
527 if (!empty($alltypeleaves[$holidaylogstatic->type])) {
528 if ($alltypeleaves[$holidaylogstatic->type]['code'] && $langs->trans($alltypeleaves[$holidaylogstatic->type]['code']) != $alltypeleaves[$holidaylogstatic->type]['code']) {
529 $label = $langs->trans($alltypeleaves[$holidaylogstatic->type]['code']);
530 } else {
531 $label = $alltypeleaves[$holidaylogstatic->type]['label'];
532 }
533 }
534
535 print '<td>';
536 print $label ? $label : $holidaylogstatic->type;
537 print '</td>';
538 }
539
540 // Previous balance
541 if (!empty($arrayfields['cpl.prev_solde']['checked'])) {
542 print '<td style="text-align: right;">'.price2num($holidaylogstatic->balance_previous, 5).' '.$langs->trans('days').'</td>';
543 }
544
545 // Variation
546 if (!empty($arrayfields['variation']['checked'])) {
547 $delta = price2num($holidaylogstatic->balance_new - $holidaylogstatic->balance_previous, 5);
548 print '<td style="text-align: right;">';
549 if ($delta > 0) {
550 print '<span class="stockmovemententry fontsizeunset">+'.$delta.'</span>';
551 } else {
552 print '<span class="stockmovementexit fontsizeunset">'.$delta.'</span>';
553 }
554 print '</td>';
555 }
556
557 // New Balance
558 if (!empty($arrayfields['cpl.new_solde']['checked'])) {
559 print '<td style="text-align: right;">'.price2num($holidaylogstatic->balance_new, 5).' '.$langs->trans('days').'</td>';
560 }
561
562 // Action column
563 if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
564 print '<td></td>';
565 }
566
567 print '</tr>';
568
569 $i++;
570 next($object->logs);
571}
572
573if ($log_holiday == '2') {
574 print '<tr>';
575 print '<td colspan="10"><span class="opacitymedium">'.$langs->trans('NoRecordFound').'</span></td>';
576 print '</tr>';
577}
578
579print '</table>';
580print '</div>';
581
582print '</form>';
583
584// End of page
585llxFooter();
586$db->close();
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
Definition card.php:67
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 standard extra fields.
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 user groups.
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:600
dol_get_last_day($year, $month=12, $gm=false)
Return GMT time for last day of a month or year.
Definition date.lib.php:619
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.
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 '.
dolGetButtonTitle($label, $helpText='', $iconClass='fa fa-file', $url='', $id='', $status=1, $params=array())
Function dolGetButtonTitle : this kind of buttons are used in title in list.
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...
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
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.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
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...
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
Definition member.php:79
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.