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