diff --git a/htdocs/fichinter/index.php b/htdocs/fichinter/index.php index 89f70a97f9a..2f8de5997fc 100644 --- a/htdocs/fichinter/index.php +++ b/htdocs/fichinter/index.php @@ -1,7 +1,7 @@ * Copyright (C) 2004-2008 Laurent Destailleur - * Copyright (C) 2005-2007 Regis Houssin + * Copyright (C) 2005-2008 Regis Houssin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -115,10 +115,11 @@ if ($result) print ''.$fichinter_static->LibStatut($objp->fk_statut,5).''; print "\n"; + $total += $objp->duree; $i++; } - print ''.$langs->trans("Total").''; + print ''.$langs->trans("Total").''; print ''.ConvertSecondToTime($total).''; print ''; diff --git a/htdocs/lib/date.lib.php b/htdocs/lib/date.lib.php index 955f8174980..c22abc267af 100644 --- a/htdocs/lib/date.lib.php +++ b/htdocs/lib/date.lib.php @@ -1,5 +1,6 @@ + * Copyright (C) 2005-2008 Regis Houssin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -43,8 +44,18 @@ function ConvertTime2Seconds($iHours=0,$iMinutes=0,$iSeconds=0) * \return sTime Temps formaté */ function ConvertSecondToTime($iSecond,$format='all'){ + global $langs; + if ($format == 'all'){ - $sTime=date("H",$iSecond)-1; + if ($iSecond > 86400) + { + $sDay=date("d",$iSecond)-1; + $dayTranslate = $langs->trans("Day"); + if ($iSecond >= 172800) $dayTranslate = $langs->trans("Days"); + } + $sTime=''; + if ($sDay) $sTime.=$sDay.' '.$dayTranslate.' '; + $sTime.=date("H",$iSecond)-1; $sTime.='h'.date("i",$iSecond); }else if ($format == 'hour'){ $sTime=date("H",$iSecond)-1;