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