NEW: Show sum of holidays in holiday list

Show a footer in the holidays list with the sum of all holidays
currently visible.
This commit is contained in:
Maximilian Stein 2021-11-16 19:09:14 +01:00
parent be68173240
commit c33205d564

View File

@ -736,6 +736,7 @@ if ($resql) {
$i = 0;
$totalarray = array();
$totalarray['nbfield'] = 0;
$totalduration = 0;
while ($i < min($num, $limit)) {
$obj = $db->fetch_object($resql);
@ -805,6 +806,7 @@ if ($resql) {
if (!empty($arrayfields['duration']['checked'])) {
print '<td class="right">';
$nbopenedday = num_open_day($db->jdate($obj->date_debut, 1), $db->jdate($obj->date_fin, 1), 0, 1, $obj->halfday); // user jdate(..., 1) because num_open_day need UTC dates
$totalduration += $nbopenedday;
print $nbopenedday.' '.$langs->trans('DurationDays');
print '</td>';
if (!$i) {
@ -887,6 +889,20 @@ if ($resql) {
$i++;
}
if (!empty($arrayfields['duration']['checked'])) {
print '<tr class="liste_titre">';
foreach ($arrayfields as $key => $val) {
if (!empty($val['checked'])) {
if($key == 'duration') {
print '<td class="right">'.$totalduration.' '.$langs->trans('DurationDays').'</td>';
} else {
print '<td/>';
}
}
}
print '</tr>';
}
}
// Si il n'y a pas d'enregistrement suite à une recherche