* add task, bug, case counts of story to datatable.

This commit is contained in:
chenfeiCF
2016-11-22 11:24:25 +08:00
parent 54419ad74b
commit 995d4653cc
9 changed files with 52 additions and 6 deletions
+1 -1
View File
@@ -1222,7 +1222,7 @@ class bugModel extends model
*/
public function getStoryBugs($storyID)
{
return $this->dao->select('id, title, type, status, assignedTo, resolvedBy, resolution')
return $this->dao->select('id, title, pri, type, status, assignedTo, resolvedBy, resolution')
->from(TABLE_BUG)
->where('story')->eq((int)$storyID)
->andWhere('deleted')->eq(0)
+10
View File
@@ -123,6 +123,16 @@ class datatableModel extends model
{
echo $this->lang->actions;
}
elseif($id == 'progess')
{
$this->app->loadLang('task');
echo $this->lang->task->progess;
}
elseif($id == 'taskCount' or $id == 'bugCount' or $id == 'caseCount')
{
$this->app->loadLang('story');
echo $this->lang->story->$id;
}
else
{
common::printOrderLink($id, $orderBy, $vars, $col->title);
+1 -1
View File
@@ -23,7 +23,7 @@ extract($widths);
<tbody>
<?php foreach($stories as $story):?>
<tr class='text-center' data-id='<?php echo $story->id?>'>
<?php foreach($setting as $key => $value) $this->story->printCell($value, $story, $users, $branches, $storyStages, $modulePairs);?>
<?php foreach($setting as $key => $value) $this->story->printCell($value, $story, $users, $branches, $storyStages, $modulePairs, $storyTasks, $storyBugs, $storyCases);?>
</tr>
<?php endforeach;?>
</tbody>
+15
View File
@@ -89,6 +89,21 @@ $config->story->datatable->fieldList['stage']['fixed'] = 'no';
$config->story->datatable->fieldList['stage']['width'] = '90';
$config->story->datatable->fieldList['stage']['required'] = 'no';
$config->story->datatable->fieldList['taskCount']['title'] = 'taskCount';
$config->story->datatable->fieldList['taskCount']['fixed'] = 'no';
$config->story->datatable->fieldList['taskCount']['width'] = '90';
$config->story->datatable->fieldList['taskCount']['required'] = 'no';
$config->story->datatable->fieldList['bugCount']['title'] = 'bugCount';
$config->story->datatable->fieldList['bugCount']['fixed'] = 'no';
$config->story->datatable->fieldList['bugCount']['width'] = '90';
$config->story->datatable->fieldList['bugCount']['required'] = 'no';
$config->story->datatable->fieldList['caseCount']['title'] = 'caseCount';
$config->story->datatable->fieldList['caseCount']['fixed'] = 'no';
$config->story->datatable->fieldList['caseCount']['width'] = '90';
$config->story->datatable->fieldList['caseCount']['required'] = 'no';
$config->story->datatable->fieldList['openedBy']['title'] = 'openedByAB';
$config->story->datatable->fieldList['openedBy']['fixed'] = 'no';
$config->story->datatable->fieldList['openedBy']['width'] = '80';
+3 -2
View File
@@ -947,8 +947,9 @@ class story extends control
public function cases($storyID)
{
$this->loadModel('testcase');
$this->view->cases = $this->testcase->getStoryCases($storyID);
$this->view->users = $this->user->getPairs('noletter');
$this->view->cases = $this->testcase->getStoryCases($storyID);
$this->view->users = $this->user->getPairs('noletter');
$this->view->resultList = array('' => '') + $this->lang->testcase->resultList;
$this->display();
}
+2
View File
@@ -24,6 +24,8 @@ $lang->story->delete = "Delete";
$lang->story->view = "Story Details";
$lang->story->tasks = "Linked Task";
$lang->story->taskCount = 'Tasks';
$lang->story->bugCount = 'Bugs';
$lang->story->caseCount = 'Testcases';
$lang->story->taskCountAB = 'Tasks';
$lang->story->bugCountAB = 'Bugs';
$lang->story->caseCountAB = 'Cases';
+2
View File
@@ -24,6 +24,8 @@ $lang->story->delete = "删除";
$lang->story->view = "需求详情";
$lang->story->tasks = "相关任务";
$lang->story->taskCount = '任务数';
$lang->story->bugCount = 'Bug数';
$lang->story->caseCount = '用例数';
$lang->story->taskCountAB = '任';
$lang->story->bugCountAB = 'Bug';
$lang->story->caseCountAB = '用';
+17 -1
View File
@@ -2155,10 +2155,14 @@ class storyModel extends model
* @param array $users
* @param array $branches
* @param array $storyStages
* @param array $modulePairs
* @param array $storyTasks
* @param array $storyBugs
* @param array $storyCases
* @access public
* @return void
*/
public function printCell($col, $story, $users, $branches, $storyStages, $modulePairs = array())
public function printCell($col, $story, $users, $branches, $storyStages, $modulePairs = array(), $storyTasks, $storyBugs, $storyCases)
{
$storyLink = helper::createLink('story', 'view', "storyID=$story->id");
$account = $this->app->user->account;
@@ -2217,6 +2221,18 @@ class storyModel extends model
echo "</div>";
}
break;
case 'taskCount':
$tasksLink = helper::createLink('story', 'tasks', "storyID=$story->id");
$storyTasks[$story->id] > 0 ? print(html::a($tasksLink, $storyTasks[$story->id], '', 'class="iframe"')) : print(0);
break;
case 'bugCount':
$bugsLink = helper::createLink('story', 'bugs', "storyID=$story->id");
$storyBugs[$story->id] > 0 ? print(html::a($bugsLink, $storyBugs[$story->id], '', 'class="iframe"')) : print(0);
break;
case 'caseCount':
$casesLink = helper::createLink('story', 'cases', "storyID=$story->id");
$storyCases[$story->id] > 0 ? print(html::a($casesLink, $storyCases[$story->id], '', 'class="iframe"')) : print(0);
break;
case 'openedBy':
echo zget($users, $story->openedBy, $story->openedBy);
break;
+1 -1
View File
@@ -391,7 +391,7 @@ class testcaseModel extends model
*/
public function getStoryCases($storyID)
{
return $this->dao->select('id, title, type, status, lastRunner, lastRunDate, lastRunResult')
return $this->dao->select('id, title, pri, type, status, lastRunner, lastRunDate, lastRunResult')
->from(TABLE_CASE)
->where('story')->eq((int)$storyID)
->andWhere('deleted')->eq(0)