* finish task #2788.

This commit is contained in:
chenfeiCF
2016-11-14 14:05:10 +08:00
parent 68ebaf540e
commit 2035c1881b
3 changed files with 41 additions and 13 deletions
+2 -1
View File
@@ -914,7 +914,8 @@ class story extends control
public function tasks($storyID, $projectID = 0)
{
$this->loadModel('task');
$this->view->tasks = $this->task->getStoryTaskPairs($storyID, $projectID);
$this->view->tasks = $this->task->getStoryTasks($storyID, $projectID);
$this->view->users = $this->user->getPairs('noletter');
$this->display();
}
+36 -9
View File
@@ -1,11 +1,38 @@
<?php include '../../common/view/header.lite.html.php';?>
<table class='table'>
<caption><?php echo $lang->story->tasks;?></caption>
<?php
foreach($tasks as $task)
{
echo "<tr><td>$task</td></tr>";
}
?>
</table>
<div id='titlebar'>
<div class='heading'>
<span><?php echo html::icon($lang->icons['report']);?></span>
<small class='text-muted'> <?php echo $lang->story->tasks;?></small>
</div>
</div>
<div>
<form class='form-condensed' target='hiddenwin'>
<table class='table'>
<thead>
<tr class='text-center'>
<th class='w-p30'> <?php echo $lang->task->name;?></th>
<th class='w-pri'> <?php echo $lang->priAB;?></th>
<th class='w-status'><?php echo $lang->statusAB;?></th>
<th class='w-user'> <?php echo $lang->task->assignedToAB;?></th>
<th class='w-40px'> <?php echo $lang->task->estimate;?></th>
<th class='w-40px'> <?php echo $lang->task->consumed;?></th>
<th class='w-40px'> <?php echo $lang->task->left;?></th>
</tr>
</thead>
<tbody>
<?php foreach($tasks as $key => $task):?>
<tr class='text-center'>
<td class='text-left' title="<?php echo $task->name?>"><?php echo $task->name;?></td>
<td><span class='<?php echo 'pri' . zget($lang->task->priList, $task->pri, $task->pri)?>'><?php echo zget($lang->task->priList, $task->pri, $task->pri);?></span></td>
<td><?php echo $lang->task->statusList[$task->status];?></td>
<td><?php echo zget($users, $task->assignedTo, $task->assignedTo);?></td>
<td><?php echo $task->estimate;?></td>
<td><?php echo $task->consumed;?></td>
<td><?php echo $task->left;?></td>
</tr>
<?php endforeach;?>
</tbody>
</table>
</form>
</div>
<?php include '../../common/view/footer.lite.html.php';?>
+3 -3
View File
@@ -977,14 +977,14 @@ class taskModel extends model
* @access public
* @return array
*/
public function getStoryTaskPairs($storyID, $projectID = 0)
public function getStoryTasks($storyID, $projectID = 0)
{
return $this->dao->select('id, name')
return $this->dao->select('id, name, assignedTo, status, estimate, consumed, `left`')
->from(TABLE_TASK)
->where('story')->eq((int)$storyID)
->andWhere('deleted')->eq(0)
->beginIF($projectID)->andWhere('project')->eq($projectID)->fi()
->fetchPairs();
->fetchAll('id');
}
/**