dolibarr 20.0.2
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 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');
184llxHeader('', $title);
185
186$sqlwhere = '';
187
188if (!empty($search_year) && $search_year > 0) {
189 if (!empty($search_month) && $search_month > 0) {
190 $from_date = dol_get_first_day($search_year, $search_month, 1);
191 $to_date = dol_get_last_day($search_year, $search_month, 1);
192 } else {
193 $from_date = dol_get_first_day($search_year, 1, 1);
194 $to_date = dol_get_last_day($search_year, 12, 1);
195 }
196
197 $sqlwhere .= "AND date_action BETWEEN '".$db->idate($from_date)."' AND '".$db->idate($to_date)."'";
198}
199
200if (!empty($search_id) && $search_id > 0) {
201 $sqlwhere .= natural_search('rowid', $search_id, 1);
202}
203if (!empty($search_validator) && $search_validator > 0) {
204 $sqlwhere .= natural_search('fk_user_action', $search_validator, 1);
205}
206if (!empty($search_employee) && $search_employee > 0) {
207 $sqlwhere .= natural_search('fk_user_update', $search_employee, 1);
208}
209if (!empty($search_description)) {
210 $sqlwhere .= natural_search('type_action', $search_description);
211}
212if (!empty($search_type) && $search_type > 0) {
213 $sqlwhere .= natural_search('fk_type', $search_type, 1);
214}
215if (!empty($search_prev_solde)) {
216 $sqlwhere .= natural_search('prev_solde', $search_prev_solde, 1);
217}
218if (!empty($search_new_solde)) {
219 $sqlwhere .= natural_search('new_solde', $search_new_solde, 1);
220}
221
222$sqlorder = $db->order($sortfield, $sortorder);
223
224// Recent changes are more important than old changes
225$log_holiday = $object->fetchLog($sqlorder, $sqlwhere); // Load $object->logs
226
227// Count total nb of records
228$nbtotalofrecords = '';
229if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
230 //TODO: $result = $db->query($sql);
231 //TODO: $nbtotalofrecords = $db->num_rows($result);
232 $nbtotalofrecords = is_array($object->logs) ? count($object->logs) : 0;
233
234 if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
235 $page = 0;
236 $offset = 0;
237 }
238}
239
240// TODO: $num = $db->num_rows($resql);
241$num = is_array($object->logs) ? count($object->logs) : 0;
242
243$param = '';
244if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
245 $param .= '&contextpage='.urlencode($contextpage);
246}
247if ($limit > 0 && $limit != $conf->liste_limit) {
248 $param .= '&limit='.((int) $limit);
249}
250if (!empty($search_id)) {
251 $param .= '&search_status='.urlencode($search_status);
252}
253if (!empty($search_month) && $search_month > 0) {
254 $param .= '&search_month='.urlencode((string) ($search_month));
255}
256if (!empty($search_year) && $search_year > 0) {
257 $param .= '&search_year='.urlencode((string) ($search_year));
258}
259if (!empty($search_validator) && $search_validator > 0) {
260 $param .= '&search_validator='.urlencode((string) ($search_validator));
261}
262if (!empty($search_employee) && $search_employee > 0) {
263 $param .= '&search_employee='.urlencode((string) ($search_employee));
264}
265if (!empty($search_description)) {
266 $param .= '&search_description='.urlencode($search_description);
267}
268if (!empty($search_type) && $search_type > 0) {
269 $param .= '&search_type='.urlencode((string) ($search_type));
270}
271if (!empty($search_prev_solde)) {
272 $param .= '&search_prev_solde='.urlencode($search_prev_solde);
273}
274if (!empty($search_new_solde)) {
275 $param .= '&search_new_solde='.urlencode($search_new_solde);
276}
277
278print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
279if ($optioncss != '') {
280 print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
281}
282print '<input type="hidden" name="token" value="'.newToken().'">';
283print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
284print '<input type="hidden" name="action" value="list">';
285print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
286print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
287print '<input type="hidden" name="page" value="'.$page.'">';
288print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
289
290$newcardbutton = dolGetButtonTitle($langs->trans('MenuAddCP'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/holiday/card.php?action=create', '', $user->hasRight('holiday', 'write'));
291// @phan-suppress-next-line PhanPluginSuspiciousParamOrder
292print_barre_liste($langs->trans('LogCP'), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_hrm', 0, $newcardbutton, '', $limit, 0, 0, 1);
293
294print '<div class="info">'.$langs->trans('LastUpdateCP').': ';
295
296$lastUpdate = $object->getConfCP('lastUpdate');
297if ($lastUpdate) {
298 $monthLastUpdate = $lastUpdate[4].$lastUpdate[5];
299 $yearLastUpdate = $lastUpdate[0].$lastUpdate[1].$lastUpdate[2].$lastUpdate[3];
300 print '<strong>'.dol_print_date($db->jdate($object->getConfCP('lastUpdate')), 'dayhour', 'tzuser').'</strong>';
301 print '<br>';
302 print $langs->trans("MonthOfLastMonthlyUpdate").': <strong>'.$yearLastUpdate.'-'.$monthLastUpdate.'</strong>';
303} else {
304 print $langs->trans('None');
305}
306print '</div>';
307print '<br>';
308
309$moreforfilter = '';
310$morefilter = '';
311$disabled = 0;
312$include = '';
313
314$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
315$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup
316$selectedfields = ($mode != 'kanban' ? $htmlofselectarray : '');
317$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
318
319print '<div class="div-table-responsive">';
320print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'" id="tablelines3">';
321
322print '<tr class="liste_titre_filter">';
323
324// Action column
325if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
326 print '<td class="liste_titre maxwidthsearch">';
327 $searchpicto = $form->showFilterButtons();
328 print $searchpicto;
329 print '</td>';
330}
331
332// Filter Id
333if (!empty($arrayfields['cpl.rowid']['checked'])) {
334 print '<td class="liste_titre"><input type="text" class="maxwidth50" name="search_id" value="'.$search_id.'"></td>';
335}
336
337// Filter: Date
338if (!empty($arrayfields['cpl.date_action']['checked'])) {
339 print '<td class="liste_titre center">';
340 print '<input class="flat valignmiddle maxwidth25" type="text" maxlength="2" name="search_month" value="'.dol_escape_htmltag($search_month ? (string) $search_month : '').'">';
341 print $formother->selectyear($search_year, 'search_year', 1, 10, 5, 0, 0, '', 'valignmiddle width75', true);
342 print '</td>';
343}
344
345// Filter: Validator
346if (!empty($arrayfields['cpl.fk_user_action']['checked'])) {
347 $validator = new UserGroup($db);
348 $excludefilter = $user->admin ? '' : 'u.rowid <> '.((int) $user->id);
349 $valideurobjects = $validator->listUsersForGroup($excludefilter, 1);
350 $valideurarray = array();
351 foreach ($valideurobjects as $val) {
352 $valideurarray[$val] = $val;
353 }
354
355 print '<td class="liste_titre">';
356 print $form->select_dolusers($search_validator, "search_validator", 1, "", 0, $valideurarray, '', 0, 0, 0, $morefilter, 0, '', 'maxwidth200');
357 print '</td>';
358}
359
360// Filter: User
361if (!empty($arrayfields['cpl.fk_user_update']['checked'])) {
362 print '<td class="liste_titre">';
363 print $form->select_dolusers($search_employee, "search_employee", 1, "", $disabled, $include, '', 0, 0, 0, $morefilter, 0, '', 'maxwidth200');
364 print '</td>';
365}
366
367// Filter: Description
368if (!empty($arrayfields['cpl.type_action']['checked'])) {
369 print '<td class="liste_titre">';
370 print '<input type="text" class="maxwidth50" name="search_description" value="'.$search_description.'">';
371 print '</td>';
372}
373
374// Filter: Type
375if (!empty($arrayfields['cpl.fk_type']['checked'])) {
376 $arraytypeleaves = array();
377 foreach ($alltypeleaves as $key => $val) {
378 $labeltoshow = ($langs->trans($val['code']) != $val['code'] ? $langs->trans($val['code']) : $val['label']);
379 $arraytypeleaves[$val['rowid']] = $labeltoshow;
380 }
381
382 print '<td class="liste_titre">';
383 print $form->selectarray('search_type', $arraytypeleaves, $search_type, 1, 0, 0, '', 0, 0, 0, '', '', 1);
384 print '</td>';
385}
386
387// Filter: Previous balance
388if (!empty($arrayfields['cpl.prev_solde']['checked'])) {
389 print '<td class="liste_titre right">';
390 print '<input type="text" class="maxwidth50" name="search_prev_solde" value="'.$search_prev_solde.'">';
391 print '</td>';
392}
393
394// Filter: Variation (only placeholder)
395if (!empty($arrayfields['variation']['checked'])) {
396 print '<td class="liste_titre"></td>';
397}
398
399// Filter: New Balance
400if (!empty($arrayfields['cpl.new_solde']['checked'])) {
401 print '<td class="liste_titre right">';
402 print '<input type="text" class="maxwidth50" name="search_new_solde" value="'.$search_new_solde.'">';
403 print '</td>';
404}
405
406// Action column
407if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
408 print '<td class="liste_titre maxwidthsearch">';
409 $searchpicto = $form->showFilterButtons();
410 print $searchpicto;
411 print '</td>';
412}
413print '</tr>';
414
415print '<tr class="liste_titre">';
416// Action column
417if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
418 print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ');
419}
420if (!empty($arrayfields['cpl.rowid']['checked'])) {
421 print_liste_field_titre($arrayfields['cpl.rowid']['label'], $_SERVER["PHP_SELF"], 'cpl.rowid', '', '', '', $sortfield, $sortorder);
422}
423if (!empty($arrayfields['cpl.date_action']['checked'])) {
424 print_liste_field_titre($arrayfields['cpl.date_action']['label'], $_SERVER["PHP_SELF"], 'date_action', '', '', '', $sortfield, $sortorder, 'center ');
425}
426if (!empty($arrayfields['cpl.fk_user_action']['checked'])) {
427 print_liste_field_titre($arrayfields['cpl.fk_user_action']['label'], $_SERVER["PHP_SELF"], 'fk_user_action', '', '', '', $sortfield, $sortorder);
428}
429if (!empty($arrayfields['cpl.fk_user_update']['checked'])) {
430 print_liste_field_titre($arrayfields['cpl.fk_user_update']['label'], $_SERVER["PHP_SELF"], 'fk_user_update', '', '', '', $sortfield, $sortorder);
431}
432if (!empty($arrayfields['cpl.type_action']['checked'])) {
433 print_liste_field_titre($arrayfields['cpl.type_action']['label'], $_SERVER["PHP_SELF"], 'type_action', '', '', '', $sortfield, $sortorder);
434}
435if (!empty($arrayfields['cpl.fk_type']['checked'])) {
436 print_liste_field_titre($arrayfields['cpl.fk_type']['label'], $_SERVER["PHP_SELF"], 'fk_type', '', '', '', $sortfield, $sortorder);
437}
438if (!empty($arrayfields['cpl.prev_solde']['checked'])) {
439 print_liste_field_titre($arrayfields['cpl.prev_solde']['label'], $_SERVER["PHP_SELF"], 'prev_solde', '', '', '', $sortfield, $sortorder, 'right ');
440}
441if (!empty($arrayfields['variation']['checked'])) {
442 print_liste_field_titre($arrayfields['variation']['label'], $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'right ');
443}
444if (!empty($arrayfields['cpl.new_solde']['checked'])) {
445 print_liste_field_titre($arrayfields['cpl.new_solde']['label'], $_SERVER["PHP_SELF"], 'new_solde', '', '', '', $sortfield, $sortorder, 'right ');
446}
447// Action column
448if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
449 print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ');
450}
451print '</tr>';
452
453
454$j = 0;
455while ($j < ($page * $limit)) {
456 $obj = next($object->logs);
457 $j++;
458}
459
460$i = 0;
461while ($i < min($num, $limit)) {
462 //TODO: $obj = $db->fetch_object($resql);
463 $obj = current($object->logs);
464 if (empty($obj)) {
465 break;
466 }
467
468 $holidaylogstatic->id = $obj['rowid'];
469 $holidaylogstatic->date = $obj['date_action'];
470 $holidaylogstatic->validator = $obj['fk_user_action'];
471 $holidaylogstatic->employee = $obj['fk_user_update'];
472 $holidaylogstatic->description = $obj['type_action'];
473 $holidaylogstatic->type = $obj['fk_type'];
474 $holidaylogstatic->balance_previous = $obj['prev_solde'];
475 $holidaylogstatic->balance_new = $obj['new_solde'];
476
477 print '<tr class="oddeven">';
478
479 // Action column
480 if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
481 print '<td></td>';
482 }
483
484 // Id
485 if (!empty($arrayfields['cpl.rowid']['checked'])) {
486 print '<td>'.$holidaylogstatic->id.'</td>';
487 }
488
489 // Date
490 if (!empty($arrayfields['cpl.date_action']['checked'])) {
491 print '<td style="text-align: center">'.$holidaylogstatic->date.'</td>';
492 }
493
494 // Validator
495 if (!empty($arrayfields['cpl.fk_user_action']['checked'])) {
496 $user_action = new User($db);
497 $user_action->fetch($holidaylogstatic->validator);
498 print '<td>'.$user_action->getNomUrl(-1).'</td>';
499 }
500
501 // Emloyee
502 if (!empty($arrayfields['cpl.fk_user_update']['checked'])) {
503 $user_update = new User($db);
504 $user_update->fetch($holidaylogstatic->employee);
505 print '<td>'.$user_update->getNomUrl(-1).'</td>';
506 }
507
508 // Description
509 if (!empty($arrayfields['cpl.type_action']['checked'])) {
510 print '<td class="tdoverflowmax400" title="'.dol_escape_htmltag($holidaylogstatic->description).'">'.dol_escape_htmltag($holidaylogstatic->description).'</td>';
511 }
512
513 // Type
514 if (!empty($arrayfields['cpl.fk_type']['checked'])) {
515 $label = '';
516 if (!empty($alltypeleaves[$holidaylogstatic->type])) {
517 if ($alltypeleaves[$holidaylogstatic->type]['code'] && $langs->trans($alltypeleaves[$holidaylogstatic->type]['code']) != $alltypeleaves[$holidaylogstatic->type]['code']) {
518 $label = $langs->trans($alltypeleaves[$holidaylogstatic->type]['code']);
519 } else {
520 $label = $alltypeleaves[$holidaylogstatic->type]['label'];
521 }
522 }
523
524 print '<td>';
525 print $label ? $label : $holidaylogstatic->type;
526 print '</td>';
527 }
528
529 // Previous balance
530 if (!empty($arrayfields['cpl.prev_solde']['checked'])) {
531 print '<td style="text-align: right;">'.price2num($holidaylogstatic->balance_previous, 5).' '.$langs->trans('days').'</td>';
532 }
533
534 // Variation
535 if (!empty($arrayfields['variation']['checked'])) {
536 $delta = price2num($holidaylogstatic->balance_new - $holidaylogstatic->balance_previous, 5);
537 print '<td style="text-align: right;">';
538 if ($delta > 0) {
539 print '<span class="stockmovemententry fontsizeunset">+'.$delta.'</span>';
540 } else {
541 print '<span class="stockmovementexit fontsizeunset">'.$delta.'</span>';
542 }
543 print '</td>';
544 }
545
546 // New Balance
547 if (!empty($arrayfields['cpl.new_solde']['checked'])) {
548 print '<td style="text-align: right;">'.price2num($holidaylogstatic->balance_new, 5).' '.$langs->trans('days').'</td>';
549 }
550
551 // Action column
552 if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
553 print '<td></td>';
554 }
555
556 print '</tr>';
557
558 $i++;
559 next($object->logs);
560}
561
562if ($log_holiday == '2') {
563 print '<tr>';
564 print '<td colspan="10"><span class="opacitymedium">'.$langs->trans('NoRecordFound').'</span></td>';
565 print '</tr>';
566}
567
568print '</table>';
569print '</div>';
570
571print '</form>';
572
573// End of page
574llxFooter();
575$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()
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.
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
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.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
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.