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