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