* ajusted ui of testtask/view.

This commit is contained in:
Catouse
2014-07-31 14:27:43 +08:00
parent bcff1260e1
commit afeaa9de37
7 changed files with 150 additions and 12 deletions
+6 -6
View File
@@ -11,12 +11,12 @@ $(function() { sortTable(); } );
function sortTable()
{
$('.tablesorter').tablesorter(
{
saveSort: true,
widgets: ['zebra', 'saveSort'],
widgetZebra: {css: ['odd', 'even'] }
}
);
{
saveSort: true,
widgets: ['zebra', 'saveSort'],
widgetZebra: {css: ['odd', 'even'] }
});
$('.tablesorter tbody tr').hover(
function(){$(this).addClass('hoover')},
function(){$(this).removeClass('hoover')}
+13
View File
@@ -180,6 +180,16 @@ class testtask extends control
$task = $this->testtask->getById($taskID, true);
if(!$task) die(js::error($this->lang->notFound) . js::locate('back'));
$productID = $task->product;
$buildID = $task->build;
$build = $this->loadModel('build')->getByID($buildID);
$stories = $this->dao->select('*')->from(TABLE_STORY)->where('id')->in($build->stories)->fetchAll();
$this->loadModel('common')->saveQueryCondition($this->dao->get(), 'story');
$bugs = $this->dao->select('*')->from(TABLE_BUG)->where('id')->in($build->bugs)->fetchAll();
$this->loadModel('common')->saveQueryCondition($this->dao->get(), 'bug');
$this->testtask->setMenu($this->products, $productID);
$this->view->title = "TASK #$task->id $task->name/" . $this->products[$productID];
@@ -191,6 +201,9 @@ class testtask extends control
$this->view->task = $task;
$this->view->users = $this->loadModel('user')->getPairs('noclosed|noletter');
$this->view->actions = $this->loadModel('action')->getList('testtask', $taskID);
$this->view->build = $build;
$this->view->stories = $stories;
$this->view->bugs = $bugs;
$this->display();
}
+1
View File
@@ -0,0 +1 @@
#caseList tbody tr > td:first-child {padding-left: 10px;}
+16
View File
@@ -0,0 +1,16 @@
$(function()
{
$('.loadAjax').each(function()
{
var $this = $(this);
$this.load($this.data('url'), function()
{
$('#caseList').tablesorter(
{
saveSort: true,
widgets: ['zebra', 'saveSort'],
widgetZebra: {css: ['odd', 'even'] }
}).find('a.iframe').modalTrigger();
});
});
});
+4
View File
@@ -51,6 +51,8 @@ $lang->testtask->lastRunAccount = "Run";
$lang->testtask->lastRunTime = 'Time';
$lang->testtask->lastRunResult = 'Result';
$lang->testtask->report = 'Report';
$lang->testtask->stories = 'Stories';
$lang->testtask->bugs = 'Bugs';
$lang->testtask->legendDesc = 'Desc';
$lang->testtask->legendReport = 'Report';
@@ -96,3 +98,5 @@ $lang->testtask->mail->create = new stdclass();
$lang->testtask->mail->edit = new stdclass();
$lang->testtask->mail->create->title = "%s created testtask #%s:%s";
$lang->testtask->mail->edit->title = "%s finished testtask #%s:%s";
$lang->testtask->testScope = 'Test scope';
+4
View File
@@ -51,6 +51,8 @@ $lang->testtask->lastRunAccount = '执行人';
$lang->testtask->lastRunTime = '执行时间';
$lang->testtask->lastRunResult = '结果';
$lang->testtask->report = '测试总结';
$lang->testtask->stories = '相关需求';
$lang->testtask->bugs = '相关Bug';
$lang->testtask->legendDesc = '任务描述';
$lang->testtask->legendReport = '测试总结';
@@ -96,3 +98,5 @@ $lang->testtask->mail->create = new stdclass();
$lang->testtask->mail->edit = new stdclass();
$lang->testtask->mail->create->title = "%s创建了测试任务 #%s:%s";
$lang->testtask->mail->edit->title = "%s编辑了测试任务 #%s:%s";
$lang->testtask->testScope = '测试范畴';
+106 -6
View File
@@ -12,6 +12,7 @@
?>
<?php include '../../common/view/header.html.php';?>
<?php include '../../common/view/kindeditor.html.php';?>
<?php include '../../common/view/tablesorter.html.php';?>
<div id='titlebar'>
<div class='heading'>
<span class='prefix' title='TESTTASK'><?php echo html::icon($lang->icons['testtask']);?> <strong><?php echo $task->id;?></strong></span>
@@ -54,10 +55,101 @@
<div class='row-table'>
<div class='col-main'>
<div class='main'>
<fieldset>
<legend><?php echo $lang->testtask->legendDesc;?></legend>
<div class='article-content'><?php echo $task->desc;?></div>
</fieldset>
<div class='tabs'>
<ul class='nav nav-tabs'>
<li class='active'><a href='#desc' data-toggle='tab'><?php echo $lang->testtask->legendDesc;?></a></li>
<li><a href='#testScope' data-toggle='tab'><?php echo $lang->testtask->testScope;?></a></li>
<li><a href='#cases' data-toggle='tab'><?php echo $lang->testtask->cases;?></a></li>
<li><a href='#results' data-toggle='tab'><?php echo $lang->testtask->results;?></a></li>
</ul>
<div class='tab-content'>
<div class='tab-pane active' id='desc'>
<div class='article-content'><?php echo $task->desc;?></div>
</div>
<div class='tab-pane' id='testScope'>
<?php $countStories = count($stories); $countBugs = count($bugs); ?>
<table class='table table-hover table-condensed tablesorter mgb-20'>
<caption class='text-left'><i class='icon-lightbulb'></i> <strong><?php echo $lang->testtask->stories;?></strong> <span class='text-muted'><?php echo sprintf($lang->build->finishStories, $countStories);?></span></caption>
<?php if($countStories > 0):?>
<thead>
<tr>
<th class='w-id'><?php echo $lang->idAB;?></th>
<th class='w-pri'><?php echo $lang->priAB;?></th>
<th><?php echo $lang->story->title;?></th>
<th class='w-user'><?php echo $lang->openedByAB;?></th>
<th class='w-hour'><?php echo $lang->story->estimateAB;?></th>
<th class='w-hour'><?php echo $lang->statusAB;?></th>
<th class='w-100px'><?php echo $lang->story->stageAB;?></th>
</tr>
</thead>
<?php foreach($stories as $storyID => $story):?>
<?php $storyLink = $this->createLink('story', 'view', "storyID=$story->id", '', true);?>
<tr class='text-center'>
<td><?php echo sprintf('%03d', $story->id);?></td>
<td><span class='<?php echo 'pri' . zget($lang->story->priList, $story->pri, $story->pri);?>'><?php echo zget($lang->story->priList, $story->pri, $story->pri);?></span></td>
<td class='text-left nobr'><?php echo html::a($storyLink,$story->title, '', "class='preview'");?></td>
<td><?php echo $users[$story->openedBy];?></td>
<td><?php echo $story->estimate;?></td>
<td class='<?php echo $story->status;?>'><?php echo $lang->story->statusList[$story->status];?></td>
<td><?php echo $lang->story->stageList[$story->stage];?></td>
</tr>
<?php endforeach;?>
<?php endif;?>
</table>
<table class='table table-hover table-condensed tablesorter'>
<caption class='text-left'><i class='icon-bug'></i><strong><?php echo $lang->testtask->bugs;?></strong> <span class='text-muted'><?php echo sprintf($lang->build->resolvedBugs, $countBugs)?></span></caption>
<thead>
<tr>
<th class='w-id'><?php echo $lang->idAB;?></th>
<th><?php echo $lang->bug->title;?></th>
<th class='w-100px'><?php echo $lang->bug->status;?></th>
<th class='w-user'><?php echo $lang->openedByAB;?></th>
<th class='w-date'><?php echo $lang->bug->openedDateAB;?></th>
<th class='w-user'><?php echo $lang->bug->resolvedByAB;?></th>
<th class='w-100px'><?php echo $lang->bug->resolvedDateAB;?></th>
</tr>
</thead>
<?php foreach($bugs as $bug):?>
<?php $bugLink = $this->createLink('bug', 'view', "bugID=$bug->id", '', true);?>
<tr class='text-center'>
<td><?php echo sprintf('%03d', $bug->id);?></td>
<td class='text-left nobr'><?php echo html::a($bugLink, $bug->title, '', "class='preview'");?></td>
<td><?php echo $lang->bug->statusList[$bug->status];?></td>
<td><?php echo $users[$bug->openedBy];?></td>
<td><?php echo substr($bug->openedDate, 5, 11)?></td>
<td><?php echo $users[$bug->resolvedBy];?></td>
<td><?php echo substr($bug->resolvedDate, 5, 11)?></td>
</tr>
<?php endforeach;?>
</table>
</div>
<div class='tab-pane' id='cases'>
<table class='table table-condensed table-hover table-striped table-fixed' id='caseList'>
<thead>
<tr class='colhead'>
<th class='w-id'><nobr><?php echo $lang->idAB;?></nobr></th>
<th class='w-pri'> <?php echo $lang->priAB;?></th>
<th> <?php echo $lang->testcase->title;?></th>
<th class='w-type'> <?php echo $lang->testcase->type;?></th>
<th class='w-user'> <?php echo $lang->testtask->assignedTo;?></th>
<th class='w-user'> <?php echo $lang->testtask->lastRunAccount;?></th>
<th class='w-100px'> <?php echo $lang->testtask->lastRunTime;?></th>
<th class='w-80px'> <?php echo $lang->testtask->lastRunResult;?></th>
<th class='w-status'> <?php echo $lang->statusAB;?></th>
<th class='w-100px {sorter: false}'><?php echo $lang->actions;?></th>
</tr>
</thead>
<tbody class='loadAjax' id='casesList' data-url='<?php echo $this->createLink('testtask', 'cases', "taskID=$task->id&browseType=all&param=0&orderBy=id_desc&recTotal=0&recPerPage=1000&pageID=1");?> #caseList tbody tr'>
<tr><td colspan='10' class='text-center'><i class='icon-spin icon-spinner'></i></td></tr>
</tbody>
</table>
</div>
<div class='tab-pane' id='results'>
</div>
</div>
</div>
</div>
<div class='main'>
<fieldset>
<legend><?php echo $lang->testtask->legendReport;?></legend>
<div class='article-content'><?php echo $task->report;?></div>
@@ -72,13 +164,21 @@
<legend><?php echo $lang->testtask->legendBasicInfo;?></legend>
<table class='table table-data table-condensed table-borderless table-fixed'>
<tr>
<th class='w-60px'><?php echo $lang->testtask->project;?></th>
<th class='w-70px'><?php echo $lang->testtask->project;?></th>
<td><?php echo html::a($this->createLink('project', 'story', "projectID=$task->project"), $task->projectName);?></td>
</tr>
<tr>
<th><?php echo $lang->testtask->build;?></th>
<td><?php $task->build == 'trunk' ? print('Trunk') : print(html::a($this->createLink('build', 'view', "buildID=$task->build"), $task->buildName));?></td>
</tr>
</tr>
<tr>
<th><?php echo $lang->build->scmPath;?></th>
<td style='word-break:break-all;'><?php strpos($build->scmPath, 'http') === 0 ? printf(html::a($build->scmPath)) : printf($build->scmPath);?></td>
</tr>
<tr>
<th><?php echo $lang->build->filePath;?></th>
<td style='word-break:break-all;'><?php strpos($build->filePath, 'http') === 0 ? printf(html::a($build->filePath)) : printf($build->filePath);?></td>
</tr>
<tr>
<th><?php echo $lang->testtask->owner;?></th>
<td><?php echo $users[$task->owner];?></td>