Merge pull request #19466 from st31ny/sumup_holidays
NEW: Show sum of holidays in holiday list
This commit is contained in:
commit
e65ab75ddf
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user