diff --git a/htdocs/holiday/list.php b/htdocs/holiday/list.php index 953f5eabb2f..0ecdcb2dd69 100644 --- a/htdocs/holiday/list.php +++ b/htdocs/holiday/list.php @@ -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 ''; $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 ''; if (!$i) { @@ -887,6 +889,20 @@ if ($resql) { $i++; } + + if (!empty($arrayfields['duration']['checked'])) { + print ''; + foreach ($arrayfields as $key => $val) { + if (!empty($val['checked'])) { + if ($key == 'duration') { + print ''.$totalduration.' '.$langs->trans('DurationDays').''; + } else { + print ''; + } + } + } + print ''; + } } // Si il n'y a pas d'enregistrement suite à une recherche