diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index efcfeca61dd..77ac518c384 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -371,12 +371,13 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t $numlines=count($lines); // We declare counter as global because we want to edit them into recursive call - global $total_projectlinesa_spent,$total_projectlinesa_planned,$total_projectlinesa_spent_if_planned,$total_projectlinesa_tobill,$total_projectlinesa_billed; + global $total_projectlinesa_spent,$total_projectlinesa_planned,$total_projectlinesa_spent_if_planned,$total_projectlinesa_declared_if_planned,$total_projectlinesa_tobill,$total_projectlinesa_billed; if ($level == 0) { $total_projectlinesa_spent=0; $total_projectlinesa_planned=0; $total_projectlinesa_spent_if_planned=0; + $total_projectlinesa_declared_if_planned=0; $total_projectlinesa_tobill=0; $total_projectlinesa_billed=0; } @@ -624,6 +625,7 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t $total_projectlinesa_spent += $lines[$i]->duration; $total_projectlinesa_planned += $lines[$i]->planned_workload; if ($lines[$i]->planned_workload) $total_projectlinesa_spent_if_planned += $lines[$i]->duration; + if ($lines[$i]->planned_workload) $total_projectlinesa_declared_if_planned += $lines[$i]->planned_workload * $lines[$i]->progress / 100; } } else @@ -652,7 +654,9 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t print ''; if ($total_projectlinesa_planned) print round(100 * $total_projectlinesa_spent / $total_projectlinesa_planned, 2).' %'; print ''; - print ''; + print ''; + if ($total_projectlinesa_planned) print round(100 * $total_projectlinesa_declared_if_planned / $total_projectlinesa_planned, 2).' %'; + print ''; if ($showbilltime) { print ''; diff --git a/htdocs/projet/tasks/list.php b/htdocs/projet/tasks/list.php index b97710ba7b6..a6b8c583da2 100644 --- a/htdocs/projet/tasks/list.php +++ b/htdocs/projet/tasks/list.php @@ -773,7 +773,7 @@ while ($i < min($num, $limit)) } print ''; if (! $i) $totalarray['nbfield']++; - if (! $i) $totalarray['totalprogress_calculated']=$totalarray['nbfield']; + if (! $i) $totalarray['totalprogress_calculatedfield']=$totalarray['nbfield']; } // Declared progress if (! empty($arrayfields['t.progress']['checked'])) @@ -785,6 +785,8 @@ while ($i < min($num, $limit)) } print ''; if (! $i) $totalarray['nbfield']++; + if (! $i) $totalarray['totalprogress_declaredfield']=$totalarray['nbfield']; + $totalarray['totaldurationdeclared'] += $obj->planned_workload * $obj->progress / 100; } // Time not billed if (! empty($arrayfields['t.tobill']['checked'])) @@ -883,6 +885,7 @@ if (isset($totalarray['totaldurationeffectivefield']) || isset($totalarray['tota elseif ($totalarray['totalplannedworkloadfield'] == $i) print ''.convertSecondToTime($totalarray['totalplannedworkload'], $plannedworkloadoutputformat).''; elseif ($totalarray['totaldurationeffectivefield'] == $i) print ''.convertSecondToTime($totalarray['totaldurationeffective'], $timespentoutputformat).''; elseif ($totalarray['totalprogress_calculatedfield'] == $i) print ''.($totalarray['totalplannedworkload'] > 0 ? round(100 * $totalarray['totaldurationeffective'] / $totalarray['totalplannedworkload'], 2).' %' : '').''; + elseif ($totalarray['totalprogress_declaredfield'] == $i) print ''.($totalarray['totalplannedworkload'] > 0 ? round(100 * $totalarray['totaldurationdeclared'] / $totalarray['totalplannedworkload'], 2).' %' : '').''; elseif ($totalarray['totaltobillfield'] == $i) print ''.convertSecondToTime($totalarray['totaltobill'], $plannedworkloadoutputformat).''; elseif ($totalarray['totalbilledfield'] == $i) print ''.convertSecondToTime($totalarray['totalbilled'], $plannedworkloadoutputformat).''; else print '';