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