* Fix task bug

This commit is contained in:
滔哥
2017-12-05 22:00:47 +08:00
parent 8663227af1
commit 95040eb64f
+4 -3
View File
@@ -1834,18 +1834,19 @@ class projectModel extends model
{
$taskSum = $statusWait = $statusDone = $statusDoing = $statusClosed = $statusCancel = $statusPause = 0;
$totalEstimate = $totalConsumed = $totalLeft = 0.0;
foreach($tasks as $task)
{
if(!empty($task->parent)) continue;
$totalEstimate += $task->estimate;
$totalConsumed += $task->consumed;
$totalLeft += (($task->status == 'cancel' or $task->closedReason == 'cancel') ? 0 : $task->left);
$statusVar = 'status' . ucfirst($task->status);
$$statusVar ++;
if(!empty($task->children)) $taskSum += count($task->children);
$taskSum ++;
}
return sprintf($this->lang->project->taskSummary, count($tasks), $statusWait, $statusDoing, $totalEstimate, round($totalConsumed, 1), $totalLeft);
return sprintf($this->lang->project->taskSummary, $taskSum, $statusWait, $statusDoing, $totalEstimate, round($totalConsumed, 1), $totalLeft);
}
/**