diff --git a/module/story/view/tasks.html.php b/module/story/view/tasks.html.php index 5822d635ab..4e254fd20e 100644 --- a/module/story/view/tasks.html.php +++ b/module/story/view/tasks.html.php @@ -1,4 +1,7 @@ - +
icons['report']);?> @@ -10,7 +13,7 @@ - + @@ -18,6 +21,7 @@ + @@ -31,6 +35,7 @@ + diff --git a/module/task/model.php b/module/task/model.php index f2b7de368c..6f1a8ec2f7 100644 --- a/module/task/model.php +++ b/module/task/model.php @@ -989,12 +989,31 @@ class taskModel extends model */ public function getStoryTasks($storyID, $projectID = 0) { - return $this->dao->select('id, name, assignedTo, pri, status, estimate, consumed, `left`') + $tasks = $this->dao->select('id, name, assignedTo, pri, status, estimate, consumed, `left`') ->from(TABLE_TASK) ->where('story')->eq((int)$storyID) ->andWhere('deleted')->eq(0) ->beginIF($projectID)->andWhere('project')->eq($projectID)->fi() ->fetchAll('id'); + + foreach($tasks as $task) + { + /* Compute task progess. */ + if($task->consumed == 0 and $task->left == 0) + { + $task->progess = 0; + } + elseif($task->consumed != 0 and $task->left == 0) + { + $task->progess = 100; + } + else + { + $task->progess = round($task->consumed / ($task->consumed + $task->left), 2) * 100; + } + } + + return $tasks; } /**
idAB;?> idAB;?> task->name;?> priAB;?> statusAB;?> task->estimateAB;?> task->consumedAB;?> task->leftAB;?> task->progess;?>
estimate;?> consumed;?> left;?>