dolibarr  16.0.5
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 require '../main.inc.php';
28 
29 // Security check (access forbidden for external user too)
30 if (empty($user->rights->holiday->define_holiday) || $user->socid > 0) {
32 }
33 
34 require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
35 require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
36 require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
37 require_once DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php';
38 
39 $action = GETPOST('action', 'aZ09') ?GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ...
40 $massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists)
41 $show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ?
42 $confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation
43 $cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button
44 $toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list
45 $contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'myobjectlist'; // To manage different context of search
46 $backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page
47 $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
48 
49 $search_id = GETPOST('search_id', 'alphanohtml');
50 $search_month = GETPOST('search_month', 'int');
51 $search_year = GETPOST('search_year', 'int');
52 $search_employee = GETPOST('search_employee', 'int');
53 $search_validator = GETPOST('search_validator', 'int');
54 $search_description = GETPOST('search_description', 'alphanohtml');
55 $search_type = GETPOST('search_type', 'int');
56 $search_prev_solde = GETPOST('search_prev_solde', 'alphanohtml');
57 $search_new_solde = GETPOST('search_new_solde', 'alphanohtml');
58 
59 // Load variable for pagination
60 $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
61 $sortfield = GETPOST('sortfield', 'aZ09comma');
62 $sortorder = GETPOST('sortorder', 'aZ09comma');
63 $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
64 if (empty($page) || $page == -1 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha') || (empty($toselect) && $massaction === '0')) {
65  $page = 0;
66 } // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action
67 $offset = $limit * $page;
68 $pageprev = $page - 1;
69 $pagenext = $page + 1;
70 if (!$sortfield) {
71  $sortfield = "cpl.rowid";
72 }
73 if (!$sortorder) {
74  $sortorder = "DESC";
75 }
76 
77 // Si l'utilisateur n'a pas le droit de lire cette page
78 if (!$user->rights->holiday->readall) {
80 }
81 
82 // Load translation files required by the page
83 $langs->loadLangs(array('users', 'other', 'holiday'));
84 
85 // Initialize technical objects
86 $object = new Holiday($db);
87 $extrafields = new ExtraFields($db);
88 //$diroutputmassaction = $conf->mymodule->dir_output . '/temp/massgeneration/'.$user->id;
89 $hookmanager->initHooks(array('leavemovementlist')); // Note that conf->hooks_modules contains array
90 
91 $arrayfields = array();
92 $arrayofmassactions = array();
93 
94 if (empty($conf->holiday->enabled)) {
95  llxHeader('', $langs->trans('CPTitreMenu'));
96  print '<div class="tabBar">';
97  print '<span style="color: #FF0000;">'.$langs->trans('NotActiveModCP').'</span>';
98  print '</div>';
99  llxFooter();
100  exit();
101 }
102 
103 
104 /*
105  * Actions
106  */
107 
108 if (GETPOST('cancel', 'alpha')) {
109  $action = 'list'; $massaction = '';
110 }
111 if (!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
117 if ($reshook < 0) {
118  setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
119 }
120 
121 if (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');
184 llxHeader('', $title);
185 
186 $sqlwhere = '';
187 
188 if (!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 
200 if (!empty($search_id) && $search_id > 0) {
201  $sqlwhere .= natural_search('rowid', $search_id, 1);
202 }
203 if (!empty($search_validator) && $search_validator > 0) {
204  $sqlwhere .= natural_search('fk_user_action', $search_validator, 1);
205 }
206 if (!empty($search_employee) && $search_employee > 0) {
207  $sqlwhere .= natural_search('fk_user_update', $search_employee, 1);
208 }
209 if (!empty($search_description)) {
210  $sqlwhere .= natural_search('type_action', $search_description);
211 }
212 if (!empty($search_type) && $search_type > 0) {
213  $sqlwhere .= natural_search('fk_type', $search_type, 1);
214 }
215 if (!empty($search_prev_solde)) {
216  $sqlwhere .= natural_search('prev_solde', $search_prev_solde, 1);
217 }
218 if (!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 = '';
229 if (empty($conf->global->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 = '';
244 if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
245  $param .= '&contextpage='.urlencode($contextpage);
246 }
247 if ($limit > 0 && $limit != $conf->liste_limit) {
248  $param .= '&limit='.urlencode($limit);
249 }
250 if (!empty($search_id)) {
251  $param .= '&search_statut='.urlencode($search_statut);
252 }
253 if (!empty($search_month) && $search_month > 0) {
254  $param .= '&search_month='.urlencode($search_month);
255 }
256 if (!empty($search_year) && $search_year > 0) {
257  $param .= '&search_year='.urlencode($search_year);
258 }
259 if (!empty($search_validator) && $search_validator > 0) {
260  $param .= '&search_validator='.urlencode($search_validator);
261 }
262 if (!empty($search_employee) && $search_employee > 0) {
263  $param .= '&search_employee='.urlencode($search_employee);
264 }
265 if (!empty($search_description)) {
266  $param .= '&search_description='.urlencode($search_description);
267 }
268 if (!empty($search_type) && $search_type > 0) {
269  $param .= '&search_type='.urlencode($search_type);
270 }
271 if (!empty($search_prev_solde)) {
272  $param .= '&search_prev_solde='.urlencode($search_prev_solde);
273 }
274 if (!empty($search_new_solde)) {
275  $param .= '&search_new_solde='.urlencode($search_new_solde);
276 }
277 
278 print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
279 if ($optioncss != '') {
280  print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
281 }
282 print '<input type="hidden" name="token" value="'.newToken().'">';
283 print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
284 print '<input type="hidden" name="action" value="list">';
285 print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
286 print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
287 print '<input type="hidden" name="page" value="'.$page.'">';
288 print '<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=request', '', $user->rights->holiday->write);
291 print_barre_liste($langs->trans('LogCP'), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_hrm', 0, $newcardbutton, '', $limit, 0, 0, 1);
292 
293 print '<div class="info">'.$langs->trans('LastUpdateCP').': ';
294 
295 $lastUpdate = $object->getConfCP('lastUpdate');
296 if ($lastUpdate) {
297  $monthLastUpdate = $lastUpdate[4].$lastUpdate[5];
298  $yearLastUpdate = $lastUpdate[0].$lastUpdate[1].$lastUpdate[2].$lastUpdate[3];
299  print '<strong>'.dol_print_date($db->jdate($object->getConfCP('lastUpdate')), 'dayhour', 'tzuser').'</strong>';
300  print '<br>';
301  print $langs->trans("MonthOfLastMonthlyUpdate").': <strong>'.$yearLastUpdate.'-'.$monthLastUpdate.'</strong>';
302 } else {
303  print $langs->trans('None');
304 }
305 print '</div>';
306 print '<br>';
307 
308 $moreforfilter = '';
309 $morefilter = '';
310 $disabled = 0;
311 $include = '';
312 
313 $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
314 $selectedfields = '';
315 $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
316 $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
317 
318 print '<div class="div-table-responsive">';
319 print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'" id="tablelines3">';
320 
321 print '<tr class="liste_titre_filter">';
322 
323 // Filter Id
324 if (!empty($arrayfields['cpl.rowid']['checked'])) {
325  print '<td class="liste_titre"><input type="text" class="maxwidth50" name="search_id" value="'.$search_id.'"></td>';
326 }
327 
328 // Filter: Date
329 if (!empty($arrayfields['cpl.date_action']['checked'])) {
330  print '<td class="liste_titre center">';
331  print '<input class="flat valignmiddle maxwidth25" type="text" maxlength="2" name="search_month" value="'.dol_escape_htmltag($search_month).'">';
332  print $formother->selectyear($search_year, 'search_year', 1, 10, 5, 0, 0, '', 'valignmiddle width75', true);
333  print '</td>';
334 }
335 
336 // Filter: Validator
337 if (!empty($arrayfields['cpl.fk_user_action']['checked'])) {
338  $validator = new UserGroup($db);
339  $excludefilter = $user->admin ? '' : 'u.rowid <> '.$user->id;
340  $valideurobjects = $validator->listUsersForGroup($excludefilter);
341  $valideurarray = array();
342 
343  foreach ($valideurobjects as $val) {
344  $valideurarray[$val->id] = $val->id;
345  }
346 
347  print '<td class="liste_titre">';
348  print $form->select_dolusers($search_validator, "search_validator", 1, "", 0, $valideurarray, '', 0, 0, 0, $morefilter, 0, '', 'maxwidth200');
349  print '</td>';
350 }
351 
352 // Filter: User
353 if (!empty($arrayfields['cpl.fk_user_update']['checked'])) {
354  print '<td class="liste_titre">';
355  print $form->select_dolusers($search_employee, "search_employee", 1, "", $disabled, $include, '', 0, 0, 0, $morefilter, 0, '', 'maxwidth200');
356  print '</td>';
357 }
358 
359 // Filter: Description
360 if (!empty($arrayfields['cpl.type_action']['checked'])) {
361  print '<td class="liste_titre">';
362  print '<input type="text" class="maxwidth50" name="search_description" value="'.$search_description.'">';
363  print '</td>';
364 }
365 
366 // Filter: Type
367 if (!empty($arrayfields['cpl.fk_type']['checked'])) {
368  foreach ($alltypeleaves as $key => $val) {
369  $labeltoshow = ($langs->trans($val['code']) != $val['code'] ? $langs->trans($val['code']) : $val['label']);
370  $arraytypeleaves[$val['rowid']] = $labeltoshow;
371  }
372 
373  print '<td class="liste_titre">';
374  print $form->selectarray('search_type', $arraytypeleaves, $search_type, 1, 0, 0, '', 0, 0, 0, '', '', 1);
375  print '</td>';
376 }
377 
378 // Filter: Previous balance
379 if (!empty($arrayfields['cpl.prev_solde']['checked'])) {
380  print '<td class="liste_titre right">';
381  print '<input type="text" class="maxwidth50" name="search_prev_solde" value="'.$search_prev_solde.'">';
382  print '</td>';
383 }
384 
385 // Filter: Variation (only placeholder)
386 if (!empty($arrayfields['variation']['checked'])) {
387  print '<td class="liste_titre"></td>';
388 }
389 
390 // Filter: New Balance
391 if (!empty($arrayfields['cpl.new_solde']['checked'])) {
392  print '<td class="liste_titre right">';
393  print '<input type="text" class="maxwidth50" name="search_new_solde" value="'.$search_new_solde.'">';
394  print '</td>';
395 }
396 
397 // Action column
398 print '<td class="liste_titre maxwidthsearch">';
399 $searchpicto = $form->showFilterButtons();
400 print $searchpicto;
401 print '</td>';
402 print '</tr>';
403 
404 print '<tr class="liste_titre">';
405 if (!empty($arrayfields['cpl.rowid']['checked'])) {
406  print_liste_field_titre($arrayfields['cpl.rowid']['label'], $_SERVER["PHP_SELF"], 'cpl.rowid', '', '', '', $sortfield, $sortorder);
407 }
408 if (!empty($arrayfields['cpl.date_action']['checked'])) {
409  print_liste_field_titre($arrayfields['cpl.date_action']['label'], $_SERVER["PHP_SELF"], 'date_action', '', '', '', $sortfield, $sortorder, 'center ');
410 }
411 if (!empty($arrayfields['cpl.fk_user_action']['checked'])) {
412  print_liste_field_titre($arrayfields['cpl.fk_user_action']['label'], $_SERVER["PHP_SELF"], 'fk_user_action', '', '', '', $sortfield, $sortorder);
413 }
414 if (!empty($arrayfields['cpl.fk_user_update']['checked'])) {
415  print_liste_field_titre($arrayfields['cpl.fk_user_update']['label'], $_SERVER["PHP_SELF"], 'fk_user_update', '', '', '', $sortfield, $sortorder);
416 }
417 if (!empty($arrayfields['cpl.type_action']['checked'])) {
418  print_liste_field_titre($arrayfields['cpl.type_action']['label'], $_SERVER["PHP_SELF"], 'type_action', '', '', '', $sortfield, $sortorder);
419 }
420 if (!empty($arrayfields['cpl.fk_type']['checked'])) {
421  print_liste_field_titre($arrayfields['cpl.fk_type']['label'], $_SERVER["PHP_SELF"], 'fk_type', '', '', '', $sortfield, $sortorder);
422 }
423 if (!empty($arrayfields['cpl.prev_solde']['checked'])) {
424  print_liste_field_titre($arrayfields['cpl.prev_solde']['label'], $_SERVER["PHP_SELF"], 'prev_solde', '', '', '', $sortfield, $sortorder, 'right ');
425 }
426 if (!empty($arrayfields['variation']['checked'])) {
427  print_liste_field_titre($arrayfields['variation']['label'], $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'right ');
428 }
429 if (!empty($arrayfields['cpl.new_solde']['checked'])) {
430  print_liste_field_titre($arrayfields['cpl.new_solde']['label'], $_SERVER["PHP_SELF"], 'new_solde', '', '', '', $sortfield, $sortorder, 'right ');
431 }
432 print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ');
433 print '</tr>';
434 
435 
436 $j = 0;
437 while ($j < ($page * $limit)) {
438  $obj = next($object->logs);
439  $j++;
440 }
441 
442 $i = 0;
443 while ($i < min($num, $limit)) {
444  //TODO: $obj = $db->fetch_object($resql);
445  $obj = current($object->logs);
446  if (empty($obj)) {
447  break;
448  }
449 
450  $holidaylogstatic->id = $obj['rowid'];
451  $holidaylogstatic->date = $obj['date_action'];
452  $holidaylogstatic->validator = $obj['fk_user_action'];
453  $holidaylogstatic->employee = $obj['fk_user_update'];
454  $holidaylogstatic->description = $obj['type_action'];
455  $holidaylogstatic->type = $obj['fk_type'];
456  $holidaylogstatic->balance_previous = $obj['prev_solde'];
457  $holidaylogstatic->balance_new = $obj['new_solde'];
458 
459  print '<tr class="oddeven">';
460 
461  // Id
462  if (!empty($arrayfields['cpl.rowid']['checked'])) {
463  print '<td>'.$holidaylogstatic->id.'</td>';
464  }
465 
466  // Date
467  if (!empty($arrayfields['cpl.date_action']['checked'])) {
468  print '<td style="text-align: center">'.$holidaylogstatic->date.'</td>';
469  }
470 
471  // Validator
472  if (!empty($arrayfields['cpl.fk_user_action']['checked'])) {
473  $user_action = new User($db);
474  $user_action->fetch($holidaylogstatic->validator);
475  print '<td>'.$user_action->getNomUrl(-1).'</td>';
476  }
477 
478  // Emloyee
479  if (!empty($arrayfields['cpl.fk_user_update']['checked'])) {
480  $user_update = new User($db);
481  $user_update->fetch($holidaylogstatic->employee);
482  print '<td>'.$user_update->getNomUrl(-1).'</td>';
483  }
484 
485  // Description
486  if (!empty($arrayfields['cpl.type_action']['checked'])) {
487  print '<td class="tdoverflowmax400" title="'.dol_escape_htmltag($holidaylogstatic->description).'">'.dol_escape_htmltag($holidaylogstatic->description).'</td>';
488  }
489 
490  // Type
491  if (!empty($arrayfields['cpl.fk_type']['checked'])) {
492  $label = '';
493  if (!empty($alltypeleaves[$holidaylogstatic->type])) {
494  if ($alltypeleaves[$holidaylogstatic->type]['code'] && $langs->trans($alltypeleaves[$holidaylogstatic->type]['code']) != $alltypeleaves[$holidaylogstatic->type]['code']) {
495  $label = $langs->trans($alltypeleaves[$holidaylogstatic->type]['code']);
496  } else {
497  $label = $alltypeleaves[$holidaylogstatic->type]['label'];
498  }
499  }
500 
501  print '<td>';
502  print $label ? $label : $holidaylogstatic->type;
503  print '</td>';
504  }
505 
506  // Previous balance
507  if (!empty($arrayfields['cpl.prev_solde']['checked'])) {
508  print '<td style="text-align: right;">'.price2num($holidaylogstatic->balance_previous, 5).' '.$langs->trans('days').'</td>';
509  }
510 
511  // Variation
512  if (!empty($arrayfields['variation']['checked'])) {
513  $delta = price2num($holidaylogstatic->balance_new - $holidaylogstatic->balance_previous, 5);
514  print '<td style="text-align: right;">';
515  if ($delta > 0) {
516  print '<span class="stockmovemententry fontsizeunset">+'.$delta.'</span>';
517  } else {
518  print '<span class="stockmovementexit fontsizeunset">'.$delta.'</span>';
519  }
520  print '</td>';
521  }
522 
523  // New Balance
524  if (!empty($arrayfields['cpl.new_solde']['checked'])) {
525  print '<td style="text-align: right;">'.price2num($holidaylogstatic->balance_new, 5).' '.$langs->trans('days').'</td>';
526  }
527 
528  // Buttons
529  print '<td></td>';
530 
531  print '</tr>';
532 
533  $i++;
534  next($object->logs);
535 }
536 
537 if ($log_holiday == '2') {
538  print '<tr class="opacitymedium">';
539  print '<td colspan="10" class="opacitymedium">'.$langs->trans('NoRecordFound').'</td>';
540  print '</tr>';
541 }
542 
543 print '</table>';
544 print '</div>';
545 
546 print '</form>';
547 
548 // End of page
549 llxFooter();
550 $db->close();
dol_escape_htmltag
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0)
Returns text escaped for inclusion in HTML alt or title tags, or into values of HTML input fields.
Definition: functions.lib.php:1468
llxFooter
llxFooter()
Empty footer.
Definition: wrapper.php:73
getTitleFieldOfList
getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $disablesortlink=0, $tooltip='', $forcenowrapcolumntitle=0)
Get title line of an array.
Definition: functions.lib.php:5049
GETPOST
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
Definition: functions.lib.php:484
UserGroup
Class to manage user groups.
Definition: usergroup.class.php:39
$form
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
Definition: card.php:142
FormOther
Classe permettant la generation de composants html autre Only common components are here.
Definition: html.formother.class.php:39
price2num
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
Definition: functions.lib.php:5661
Holiday
Class of the module paid holiday.
Definition: holiday.class.php:34
dolGetButtonTitle
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.
Definition: functions.lib.php:10605
print_barre_liste
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.
Definition: functions.lib.php:5257
dol_get_first_day
dol_get_first_day($year, $month=1, $gm=false)
Return GMT time for first day of a month or year.
Definition: date.lib.php:551
dol_get_last_day
dol_get_last_day($year, $month=12, $gm=false)
Return GMT time for last day of a month or year.
Definition: date.lib.php:570
User
Class to manage Dolibarr users.
Definition: user.class.php:44
GETPOSTISSET
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
Definition: functions.lib.php:386
print_liste_field_titre
print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
Definition: functions.lib.php:5026
natural_search
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...
Definition: functions.lib.php:9420
ExtraFields
Class to manage standard extra fields.
Definition: extrafields.class.php:39
Form
Class to manage generation of HTML components Only common components must be here.
Definition: html.form.class.php:52
setEventMessages
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='')
Set event messages in dol_events session object.
Definition: functions.lib.php:8137
accessforbidden
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program Calling this function terminate execution ...
Definition: security.lib.php:933
llxHeader
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOCSRFCHECK')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
Definition: wrapper.php:59