* finish task #6053.
This commit is contained in:
@@ -631,14 +631,12 @@ $lang->resource->testreport->create = 'create';
|
||||
$lang->resource->testreport->view = 'view';
|
||||
$lang->resource->testreport->delete = 'delete';
|
||||
$lang->resource->testreport->edit = 'edit';
|
||||
$lang->resource->testreport->selectTask = 'selectTask';
|
||||
|
||||
$lang->testreport->methodOrder[0] = 'browse';
|
||||
$lang->testreport->methodOrder[5] = 'create';
|
||||
$lang->testreport->methodOrder[10] = 'view';
|
||||
$lang->testreport->methodOrder[15] = 'delete';
|
||||
$lang->testreport->methodOrder[20] = 'edit';
|
||||
$lang->testreport->methodOrder[25] = 'selectTask';
|
||||
|
||||
$lang->resource->testsuite = new stdclass();
|
||||
$lang->resource->testsuite->index = 'index';
|
||||
|
||||
@@ -111,32 +111,6 @@ class testreport extends control
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Select a testtask for reporttask.
|
||||
*
|
||||
* @param int $objectID
|
||||
* @param string $objectType
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function selectTask($productID)
|
||||
{
|
||||
if($_POST)
|
||||
{
|
||||
$taskID = $this->post->testtask;
|
||||
die(js::locate(inlink('create', "objectID=$taskID&objectType=testtask"), 'parent'));
|
||||
}
|
||||
|
||||
$taskPairs = array();
|
||||
$scopeAndStatus[0] = 'local';
|
||||
$scopeAndStatus[1] = 'totalStatus';
|
||||
$tasks = $this->testtask->getProductTasks($productID, 0, 'id_desc', null, $scopeAndStatus);
|
||||
foreach($tasks as $task) $taskPairs[$task->id] = $task->name;
|
||||
|
||||
$this->view->taskPairs = $taskPairs;
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create report.
|
||||
*
|
||||
@@ -146,7 +120,7 @@ class testreport extends control
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function create($objectID, $objectType = 'testtask', $extra = '')
|
||||
public function create($objectID = 0, $objectType = 'testtask', $extra = '')
|
||||
{
|
||||
if($_POST)
|
||||
{
|
||||
@@ -156,6 +130,21 @@ class testreport extends control
|
||||
die(js::locate(inlink('view', "reportID=$reportID"), 'parent'));
|
||||
}
|
||||
|
||||
if($objectType == 'testtask' and empty($objectID) and $extra)
|
||||
{
|
||||
$productID = $extra;
|
||||
$taskPairs = array();
|
||||
$scopeAndStatus[0] = 'local';
|
||||
$scopeAndStatus[1] = 'totalStatus';
|
||||
$tasks = $this->testtask->getProductTasks($productID, 0, 'id_desc', null, $scopeAndStatus);
|
||||
foreach($tasks as $task) $taskPairs[$task->id] = $task->name;
|
||||
if(empty($taskPairs)) die(js::alert($this->lang->testreport->noTestTask) . js::locate('back'));
|
||||
|
||||
$this->view->taskPairs = $taskPairs;
|
||||
die($this->display('testreport', 'selectTask'));
|
||||
}
|
||||
|
||||
if(empty($objectID)) die(js::alert($this->lang->testreport->noObjectID) . js::locate('back'));
|
||||
if($objectType == 'testtask')
|
||||
{
|
||||
$task = $this->testtask->getById($objectID);
|
||||
|
||||
@@ -66,7 +66,9 @@ $lang->testreport->foundBugTip = "Bugs generated in this build and generated
|
||||
$lang->testreport->legacyBugTip = "Active bugs, or solved bugs that are not in the test period.";
|
||||
$lang->testreport->fromCaseBugTip = "Bugs generated due to the failed case run in the test period.";
|
||||
$lang->testreport->errorTrunk = "You cannot create a Testing report for the trunk. Please modify the linked build!";
|
||||
$lang->testreport->moreProduct = "Testing reports can only be generated for the same product.";
|
||||
$lang->testreport->noTestTask = "该{$lang->productCommon}下还没有测试单,不能创建报告。请切换到有测试单的{$lang->productCommon},再创建。";
|
||||
$lang->testreport->noObjectID = "没有选定测试单或{$lang->projectCommon},无法创建测试报告!";
|
||||
$lang->testreport->moreProduct = "Testing reports can only be generated for the same {$lang->productCommon}.";
|
||||
|
||||
$lang->testreport->bugSummary = <<<EOD
|
||||
Total <strong>%s</strong> Bugs reported <a data-toggle='tooltip' class='text-warning' title='{$lang->testreport->foundBugTip}'><i class='icon-help'></i></a>,
|
||||
|
||||
@@ -66,7 +66,9 @@ $lang->testreport->foundBugTip = "影响版本在测试轮次内,并且创
|
||||
$lang->testreport->legacyBugTip = "Bug状态是激活,或Bug的解决时间在测试结束时间之后。";
|
||||
$lang->testreport->fromCaseBugTip = "测试时间范围内,用例执行失败后创建的Bug。";
|
||||
$lang->testreport->errorTrunk = "主干版本不能创建测试报告,请修改关联版本!";
|
||||
$lang->testreport->moreProduct = "只能对同一个产品生成测试报告。";
|
||||
$lang->testreport->noTestTask = "该{$lang->productCommon}下还没有测试单,不能创建报告。请切换到有测试单的{$lang->productCommon},再创建。";
|
||||
$lang->testreport->noObjectID = "没有选定测试单或{$lang->projectCommon},无法创建测试报告!";
|
||||
$lang->testreport->moreProduct = "只能对同一个{$lang->productCommon}生成测试报告。";
|
||||
|
||||
$lang->testreport->bugSummary = <<<EOD
|
||||
共发现<strong>%s</strong>个Bug <a data-toggle='tooltip' class='text-warning' title='{$lang->testreport->foundBugTip}'><i class='icon-help'></i></a>,
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
</span>
|
||||
</div>
|
||||
<div class='pull-right btn-toolbar'>
|
||||
<?php if($objectType == 'product') common::printLink('testreport', 'selectTask', "productID=$objectID", "<i class='icon icon-plus'></i>" . $lang->testreport->create, '', "class='btn btn-primary iframe' data-width=40%", '', true);?>
|
||||
<?php if($objectType == 'product') common::printLink('testreport', 'create', "objectID=0&objectType=testtask&productID=$objectID", "<i class='icon icon-plus'></i>" . $lang->testreport->create, '', "class='btn btn-primary'");?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
|
||||
@@ -10,24 +10,33 @@
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.lite.html.php';?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<div id='mainContent' class='main-content'>
|
||||
<div class='center-block'>
|
||||
<div class='main-header'>
|
||||
<h2><?php echo $lang->testreport->selectTask;?></h2>
|
||||
</div>
|
||||
<form method='post'>
|
||||
<table class='table table-form'>
|
||||
<tr>
|
||||
<th><?php echo $lang->testtask->common;?></th>
|
||||
<td><?php echo html::select('testtask', $taskPairs, '', "class='form-control chosen'");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th></th>
|
||||
<td colspan='2'><?php echo html::submitButton();?></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<table class='table table-form'>
|
||||
<tr>
|
||||
<th><?php echo $lang->testtask->common;?></th>
|
||||
<td><?php echo html::select('testtask', $taskPairs, '', "class='form-control chosen'");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th></th>
|
||||
<td colspan='2'><?php echo html::commonButton($lang->testreport->create, "onclick=locateToCreate(this)", 'btn btn-wide btn-primary') . ' ' . html::backButton();?></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<?php include '../../common/view/footer.lite.html.php';?>
|
||||
<script>
|
||||
function locateToCreate(obj)
|
||||
{
|
||||
var taskID = $(obj).closest('table').find('#testtask').val();
|
||||
if(taskID)
|
||||
{
|
||||
location.href = createLink('testreport', 'create', 'objectID=' + taskID + '&objectType=testtask');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
|
||||
Reference in New Issue
Block a user