diff --git a/module/product/view/browse.html.php b/module/product/view/browse.html.php index 5344eed959..77c806c409 100644 --- a/module/product/view/browse.html.php +++ b/module/product/view/browse.html.php @@ -109,7 +109,7 @@ ?>
| idAB;?> | +idAB;?> | task->name;?> | priAB;?> | statusAB;?> | @@ -18,6 +21,7 @@task->estimateAB;?> | task->consumedAB;?> | task->leftAB;?> | +task->progess;?> | estimate;?> | consumed;?> | left;?> | +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; } /** diff --git a/www/theme/default/style.css b/www/theme/default/style.css index 6ff42c5c6e..42c137e7f6 100644 --- a/www/theme/default/style.css +++ b/www/theme/default/style.css @@ -117,7 +117,7 @@ hr.small {margin: 10px 0} .table caption {padding: 8px 20px; border: 1px solid #DDD; border-bottom: 0; background: #fafafa;} .table.table-condensed caption {padding: 6px 15px;} -.table td.td-has-control {padding: 2px 4px;} +.table td.td-has-control {padding: 2px 4px; background-color: white!important} /* Datepicker */ .datepicker-wrapper {position: relative; cursor: pointer;} |
|---|