From 4d48034ad1f779956340d49ef7c32a92f71b7471 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Sun, 16 Mar 2014 09:49:53 +0100 Subject: [PATCH] Fix --- htdocs/core/lib/project.lib.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index a35ae1afafb..39c8cd80dd0 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -223,6 +223,7 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t $numlines=count($lines); $total=0; + $total_planned=0; for ($i = 0 ; $i < $numlines ; $i++) { @@ -391,6 +392,8 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t if ($lines[$i]->id) projectLinesa($inc, $lines[$i]->id, $lines, $level, $var, $showproject, $taskrole, $projectsListId, $addordertick); $level--; $total += $lines[$i]->duration; + $total_planned += $lines[$i]->planned_workload; + // TODO fix totals in recursive calls } } else @@ -407,10 +410,12 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t print ''; print ''; print ''; - print ''; + print ''.convertSecondToTime($total_planned, 'allhourmin').''; print ''; print ''.convertSecondToTime($total, 'allhourmin').''; - print ''; + print ''; + if($total_planned) print round(100 * $total / $total_planned,2).' %'; + print ''; if ($addordertick) print ''; print ''; }