* finishe the module of testtask.

This commit is contained in:
wangchunsheng
2010-02-01 08:57:59 +00:00
parent 8c69805b06
commit 1657fab6fa
16 changed files with 368 additions and 50 deletions
+2 -3
View File
@@ -63,7 +63,6 @@ define('TABLE_ACTION', $config->db->prefix . 'action');
define('TABLE_BUG', $config->db->prefix . 'bug');
define('TABLE_BUILD', $config->db->prefix . 'build');
define('TABLE_CASE', $config->db->prefix . 'case');
define('TABLE_CASERESULT', $config->db->prefix . 'caseResult');
define('TABLE_CASESTEP', $config->db->prefix . 'caseStep');
define('TABLE_COMPANY', $config->db->prefix . 'company');
define('TABLE_CONFIG', $config->db->prefix . 'config');
@@ -76,12 +75,10 @@ define('TABLE_USER', $config->db->prefix . 'user');
define('TABLE_GROUP', $config->db->prefix . 'group');
define('TABLE_USERGROUP', $config->db->prefix . 'userGroup');
define('TABLE_GROUPPRIV', $config->db->prefix . 'groupPriv');
define('TABLE_TASKCASE', $config->db->prefix . 'taskCase');
define('TABLE_PRODUCT', $config->db->prefix . 'product');
define('TABLE_PRODUCTPLAN', $config->db->prefix . 'productPlan');
define('TABLE_RELEASE', $config->db->prefix . 'release');
define('TABLE_RELEATION', $config->db->prefix . 'releation');
define('TABLE_RESULTSTEP', $config->db->prefix . 'resultStep');
define('TABLE_PROJECT', $config->db->prefix . 'project');
define('TABLE_TEAM', $config->db->prefix . 'team');
define('TABLE_STORY', $config->db->prefix . 'story');
@@ -89,6 +86,8 @@ define('TABLE_PROJECTSTORY', $config->db->prefix . 'projectStory');
define('TABLE_TASK', $config->db->prefix . 'task');
define('TABLE_TASKESTIMATE', $config->db->prefix . 'taskEstimate');
define('TABLE_TESTTASK', $config->db->prefix . 'testTask');
define('TABLE_TESTRUN', $config->db->prefix . 'testRun');
define('TABLE_TESTRESULT', $config->db->prefix . 'testResult');
define('TABLE_PROJECTPRODUCT', $config->db->prefix . 'projectProduct');
define('TABLE_TODO', $config->db->prefix . 'todo');
define('TABLE_BURN', $config->db->prefix . 'burn');
+25
View File
@@ -0,0 +1,25 @@
<?php
$clientTheme = $this->app->getClientTheme();
$webRoot = $this->app->getWebRoot();
$jsRoot = $webRoot . "js/";
$themeRoot = $webRoot . "theme/";
?>
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dli'>
<html xmlns='http://www.w3.org/1999/xhtml'>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
<?php
if(!isset($header)) $header = new stdClass();
$header = (object)$header;
if(isset($header->title)) echo "<title>$header->title - $lang->zentaoMS</title>\n";
if(isset($header->keyword)) echo "<meta name='keywords' content='$header->keyword'>\n";
if(isset($header->desc)) echo "<meta name='description' content='$header->desc'>\n";
?>
<?php echo js::exportConfigVars();?>
<script src="<?php echo $jsRoot;?>jquery/lib.js" type="text/javascript"></script>
<script src="<?php echo $jsRoot;?>my.js" type="text/javascript"></script>
<link rel='stylesheet' href='<?php echo $clientTheme . 'yui.css';?>' type='text/css' media='screen' />
<link rel='stylesheet' href='<?php echo $clientTheme . 'style.css';?>' type='text/css' media='screen' />
<script type="text/javascript">loadFixedCSS();</script>
</head>
<body>
+1
View File
@@ -47,6 +47,7 @@ $lang->feature = '未来';
$lang->year = '年';
$lang->downArrow = '↓';
$lang->goback = '返回';
$lang->selectAll = '全选';
/* 主导航菜单。*/
$lang->menu->index = '首页|index|index';
+11
View File
@@ -144,6 +144,17 @@ $lang->resource->testcase->create = 'create';
$lang->resource->testcase->view = 'view';
$lang->resource->testcase->edit = 'edit';
$lang->resource->testtask->index = 'index';
$lang->resource->testtask->browse = 'browse';
$lang->resource->testtask->view = 'view';
$lang->resource->testtask->edit = 'edit';
$lang->resource->testtask->delete = 'delete';
$lang->resource->testtask->batchAssign = 'batchAssign';
$lang->resource->testtask->linkcase = 'linkCase';
$lang->resource->testtask->unlinkcase = 'unlinkCase';
$lang->resource->testtask->runcase = 'runCase';
$lang->resource->testtask->results = 'results';
$lang->resource->company->index = 'index';
$lang->resource->company->browse = 'browse';
$lang->resource->company->create = 'create';
-2
View File
@@ -3,7 +3,6 @@ global $lang;
$config->testcase->search['module'] = 'testcase';
$config->testcase->search['fields']['id'] = $lang->testcase->id;
$config->testcase->search['fields']['title'] = $lang->testcase->title;
$config->testcase->search['fields']['steps'] = $lang->testcase->steps;
$config->testcase->search['fields']['openedBy'] = $lang->testcase->openedBy;
$config->testcase->search['fields']['lastEditedBy'] = $lang->testcase->lastEditedBy;
$config->testcase->search['fields']['status'] = $lang->testcase->status;
@@ -13,7 +12,6 @@ $config->testcase->search['fields']['openedDate'] = $lang->testcase->openedD
$config->testcase->search['fields']['lastEditedDate'] = $lang->testcase->lastEditedDate;
$config->testcase->search['params']['title'] = array('operator' => 'include', 'control' => 'input', 'values' => '');
$config->testcase->search['params']['steps'] = array('operator' => 'include', 'control' => 'input', 'values' => '');
$config->testcase->search['params']['openedBy'] = array('operator' => '=', 'control' => 'select', 'values' => 'users');
$config->testcase->search['params']['lastEditedBy'] = array('operator' => '=', 'control' => 'select', 'values' => 'users');
$config->testcase->search['params']['status'] = array('operator' => '=', 'control' => 'select', 'values' => $lang->testcase->statusList);
+9 -2
View File
@@ -1,6 +1,6 @@
<?php
/**
* The testtestcase module zh-cn file of ZenTaoMS.
* The testcase module zh-cn file of ZenTaoMS.
*
* ZenTaoMS is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -17,7 +17,7 @@
*
* @copyright Copyright: 2009 Chunsheng Wang
* @author Chunsheng Wang <wwccss@263.net>
* @package testtestcase
* @package testcase
* @version $Id$
* @link http://www.zentao.cn
*/
@@ -40,6 +40,8 @@ $lang->testcase->field1 = '字段一';
$lang->testcase->field2 = '字段二';
$lang->testcase->feidl3 = '字段三';
$lang->testcase->version = '用例版本';
$lang->testcase->result = '测试结果';
$lang->testcase->real = '实际情况';
$lang->case = $lang->testcase; // 用于DAO检查时使用。因为case是系统关键字,所以无法定义该模块为case,只能使用testcase,但表还是使用的case。
$lang->testcase->stepID = '编号';
@@ -102,5 +104,10 @@ $lang->testcase->statusList[''] = '';
$lang->testcase->statusList['normal'] = '正常';
$lang->testcase->statusList['blocked'] = 'Blocked';
$lang->testcase->resultList['n/a'] = 'N/A';
$lang->testcase->resultList['pass'] = '通过';
$lang->testcase->resultList['fail'] = '失败';
$lang->testcase->resultList['blocked'] = '阻塞';
$lang->testcase->buttonEdit = '编辑';
$lang->testcase->buttonToList = '返回';
+2 -2
View File
@@ -4,7 +4,7 @@ $app->loadLang('testcase');
$config->testcase->search['module'] = 'testcase';
$config->testcase->search['fields']['id'] = $lang->testcase->id;
$config->testcase->search['fields']['title'] = $lang->testcase->title;
$config->testcase->search['fields']['steps'] = $lang->testcase->steps;
$config->testcase->search['fields']['module'] = $lang->testcase->module;
$config->testcase->search['fields']['openedBy'] = $lang->testcase->openedBy;
$config->testcase->search['fields']['lastEditedBy'] = $lang->testcase->lastEditedBy;
$config->testcase->search['fields']['status'] = $lang->testcase->status;
@@ -14,7 +14,7 @@ $config->testcase->search['fields']['openedDate'] = $lang->testcase->openedD
$config->testcase->search['fields']['lastEditedDate'] = $lang->testcase->lastEditedDate;
$config->testcase->search['params']['title'] = array('operator' => 'include', 'control' => 'input', 'values' => '');
$config->testcase->search['params']['steps'] = array('operator' => 'include', 'control' => 'input', 'values' => '');
$config->testcase->search['params']['module'] = array('operator' => '=', 'control' => 'select', 'values' => '');
$config->testcase->search['params']['openedBy'] = array('operator' => '=', 'control' => 'select', 'values' => 'users');
$config->testcase->search['params']['lastEditedBy'] = array('operator' => '=', 'control' => 'select', 'values' => 'users');
$config->testcase->search['params']['status'] = array('operator' => '=', 'control' => 'select', 'values' => $lang->testcase->statusList);
+51 -8
View File
@@ -102,9 +102,9 @@ class testtask extends control
$this->view->position[] = $this->lang->testtask->view;
/* 赋值。*/
$this->view->task = $task;
$this->view->users = $this->loadModel('user')->getPairs('noletter');
$this->view->cases = $this->testtask->getCases($taskID);
$this->view->task = $task;
$this->view->users = $this->loadModel('user')->getPairs('noclosed');
$this->view->runs = $this->testtask->getRuns($taskID);
$this->display();
}
@@ -163,14 +163,15 @@ class testtask extends control
$this->locate(inlink('view', "taskID=$taskID"));
}
/* 构造搜索表单。*/
$this->config->testcase->search['actionURL'] = inlink('linkcase', "taskID=$taskID");
$this->view->searchForm = $this->fetch('search', 'buildForm', $this->config->testcase->search);
/* 获得task信息。*/
$task = $this->testtask->getById($taskID);
$productID = common::saveProductState($task->product, key($this->products));
/* 构造搜索表单。*/
$this->config->testcase->search['params']['module']['values'] = $this->loadModel('tree')->getOptionMenu($productID, $viewType = 'case');
$this->config->testcase->search['actionURL'] = inlink('linkcase', "taskID=$taskID");
$this->view->searchForm = $this->fetch('search', 'buildForm', $this->config->testcase->search);
/* 设置菜单。*/
$this->testtask->setMenu($this->products, $productID);
@@ -181,10 +182,52 @@ class testtask extends control
/* 获得用例列表。*/
if($this->session->testcaseQuery == false) $this->session->set('testcaseQuery', ' 1 = 1');
$this->view->cases = $this->dao->select('*')->from(TABLE_CASE)->where($this->session->testcaseQuery)->andWhere('product')->eq($productID)->orderBy('id desc')->fetchAll();
$linkedCases = $this->dao->select('`case`')->from(TABLE_TESTRUN)->where('task')->eq($taskID)->fetchPairs('case');
$this->view->cases = $this->dao->select('*')->from(TABLE_CASE)->where($this->session->testcaseQuery)->andWhere('product')->eq($productID)->andWhere('id')->notIN($linkedCases)->orderBy('id desc')->fetchAll();
$this->view->users = $this->loadModel('user')->getPairs('noletter');
$this->display();
}
/* 移除用例。*/
public function unlinkCase($rowID)
{
$this->dao->delete()->from(TABLE_TESTRUN)->where('id')->eq((int)$rowID)->exec();
die(js::reload('parent'));
}
/* 执行用例。*/
public function runCase($runID)
{
if(!empty($_POST))
{
$this->testtask->createResult($runID);
if(dao::isError()) die(js::error(dao::getError()));
echo js::reload('parent');
die(js::closeWindow());
}
$this->view->run = $this->testtask->getRunById($runID);
die($this->display());
}
/* 查看结果列表。*/
public function results($runID)
{
$this->view->run = $this->testtask->getRunById($runID);
$this->view->results = $this->testtask->getRunResults($runID);
die($this->display());
}
/* 批量指派。*/
public function batchAssign($taskID)
{
$this->dao->update(TABLE_TASKCASE)
->set('assignedTo')->eq($this->post->assignedTo)
->where('task')->eq((int)$taskID)
->andWhere('`case`')->in($this->post->cases)
->exec();
die(js::reload('parent'));
}
}
+15 -6
View File
@@ -29,7 +29,11 @@ $lang->testtask->name = '测试任务名称';
$lang->testtask->begin = '开始日期';
$lang->testtask->end = '结束日期';
$lang->testtask->desc = '任务描述';
$lang->testtask->status = '测试任务状态';
$lang->testtask->status = '状态';
$lang->testtask->assignedTo = '指派给';
$lang->testtask->linkVersion = '关联(版本)';
$lang->testtask->lastRun = '最后执行';
$lang->testtask->lastResult = '最终结果';
$lang->testtask->common = '测试任务';
$lang->testtask->index = "测试任务首页";
@@ -39,12 +43,17 @@ $lang->testtask->view = "测试任务详情";
$lang->testtask->edit = "编辑测试任务";
$lang->testtask->browse = "测试任务列表";
$lang->testtask->linkCase = "关联用例";
$lang->testtask->unlinkCase = "移除用例";
$lang->testtask->executeCase = "执行用例";
$lang->testtask->unlinkCase = "移除";
$lang->testtask->batchAssign = "批量指派";
$lang->testtask->runCase = "执行";
$lang->testtask->results = "结果";
$lang->testtask->createBug = "创建Bug";
$lang->testtask->assign = '指派';
$lang->testtask->statusList['wait'] = '未开始';
$lang->testtask->statusList['doing'] = '进行中';
$lang->testtask->statusList['done'] = '已完成';
$lang->testtask->statusList['wait'] = '未开始';
$lang->testtask->statusList['doing'] = '进行中';
$lang->testtask->statusList['done'] = '已完成';
$lang->testtask->statusList['blocked'] = '被阻塞';
$lang->testtask->unlinkedCases = '未关联用例列表';
$lang->testtask->linkedCases = '已关联用例列表';
+71 -5
View File
@@ -91,17 +91,83 @@ class testtaskModel extends model
$row->task = $taskID;
$row->case = $caseID;
$row->version = $this->post->versions[$key];
$row->assignedTo = $this->app->user->account;
$this->dao->replace(TABLE_TASKCASE)->data($row)->exec();
$row->assignedTo = '';
$row->status = 'wait';
$this->dao->replace(TABLE_TESTRUN)->data($row)->exec();
}
}
/* 获得任务的用例列表。*/
public function getCases($taskID)
/* 获得任务的执行用例列表。*/
public function getRuns($taskID)
{
return $this->dao->select('t2.*,t1.*')->from(TABLE_TASKCASE)->alias('t1')
return $this->dao->select('t2.*,t1.*')->from(TABLE_TESTRUN)->alias('t1')
->leftJoin(TABLE_CASE)->alias('t2')->on('t1.case = t2.id')
->where('t1.task')->eq((int)$taskID)
->fetchAll();
}
/* 获得某一个testrun的信息。*/
public function getRunById($runID)
{
$testRun = $this->dao->findById($runID)->from(TABLE_TESTRUN)->fetch();
$testRun->case = $this->loadModel('testcase')->getById($testRun->case, $testRun->version);
return $testRun;
}
/* 创建测试结果。*/
public function createResult($runID)
{
/* 计算case的结果。*/
$caseResult = 'pass';
foreach($this->post->steps as $stepID => $stepResult)
{
if($stepResult != 'pass' and $stepResult != 'n/a')
{
$caseResult = $stepResult;
break;
}
}
/* 合并步骤的实际输出结果。*/
foreach($this->post->steps as $stepID =>$stepResult)
{
$step['result'] = $stepResult;
$step['real'] = $this->post->reals[$stepID];
$stepResults[$stepID] = $step;
}
$now = date('Y-m-d H:i:s');
$result = fixer::input('post')
->add('run', $runID)
->add('caseResult', $caseResult)
->setForce('stepResults', serialize($stepResults))
->add('date', $now)
->remove('steps')
->remove('reals')
->get();
$this->dao->insert(TABLE_TESTRESULT)->data($result)->autoCheck()->exec();
if(!dao::isError())
{
$runStatus = $caseResult == 'blocked' ? 'blocked' : 'done';
$this->dao->update(TABLE_TESTRUN)
->set('lastResult')->eq($caseResult)
->set('status')->eq($runStatus)
->set('lastRun')->eq($now)
->where('id')->eq($runID)
->exec();
}
}
/* 获得执行结果。*/
public function getRunResults($runID)
{
$results = $this->dao->select('*')->from(TABLE_TESTRESULT)->where('run')->eq($runID)->orderBy('id desc')->fetchAll('id');
if(!$results) return array();
foreach($results as $resultID => $result)
{
$result->stepResults = unserialize($result->stepResults);
$results[$resultID] = $result;
}
return $results;
}
}
+1 -1
View File
@@ -18,7 +18,7 @@
* @copyright Copyright: 2009 Chunsheng Wang
* @author Chunsheng Wang <wwccss@263.net>
* @package testtask
* @version $Id: browse.html.php 271 2010-01-09 03:37:02Z wwccss $
* @version $Id$
* @link http://www.zentao.cn
*/
?>
+16 -4
View File
@@ -25,6 +25,15 @@
<?php include '../../common/header.html.php';?>
<?php include '../../common/colorize.html.php';?>
<?php include '../../common/tablesorter.html.php';?>
<script language="Javascript">
function checkall(checker)
{
$('input').each(function()
{
$(this).attr("checked", checker.checked)
});
}
</script>
<div class='yui-d0'>
<?php echo $searchForm;?>
<form method='post'>
@@ -38,7 +47,7 @@
<th><?php echo $lang->testcase->type;?></th>
<th><?php echo $lang->testcase->openedBy;?></th>
<th><?php echo $lang->testcase->status;?></th>
<th><?php echo $lang->testtask->linkCase . '/' . $lang->testcase->version;?></th>
<th class='w-50px'><nobr><?php echo $lang->testtask->linkVersion;?></nobr></th>
</tr>
</thead>
<tbody>
@@ -59,14 +68,17 @@
<td><?php echo $lang->testcase->typeList[$case->type];?></td>
<td><?php echo $users[$case->openedBy];?></td>
<td><?php echo $lang->testcase->statusList[$case->status];?></td>
<td>
<td class='a-left'><nobr>
<input type='checkbox' name='cases[]' value='<?php echo $case->id;?>' />
<?php echo html::select('versions[]', array_combine(range($case->version, 1), range($case->version, 1)), '', 'style=width:50px');?>
<?php echo html::select('versions[]', array_combine(range($case->version, 1), range($case->version, 1)), '', 'style=width:50px');?></nobr>
</td>
</tr>
</tbody>
<?php endforeach;?>
<tr><td colspan='7' class='a-center'><?php echo html::submitButton();?></td></tr>
<tr class='a-center'>
<td colspan='6'><?php echo html::submitButton();?></td>
<td class='a-left'><input type='checkbox' onclick='checkall(this);'><?php echo $lang->selectAll;?></td>
</tr>
</table>
</form>
</div>
+51
View File
@@ -0,0 +1,51 @@
<?php
/**
* The runrun view file of testtask of ZenTaoMS.
*
* ZenTaoMS is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* ZenTaoMS is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with ZenTaoMS. If not, see <http://www.gnu.org/licenses/>.
*
* @copyright Copyright: 2009 Chunsheng Wang
* @author Chunsheng Wang <wwccss@263.net>
* @package testtask
* @version $Id$
* @link http://www.zentao.cn
*/
?>
<?php include '../../common/header.lite.html.php';?>
<div class='yui-d0'>
<h1>CASE#<?php echo $run->case->id. $lang->colon . $run->case->title;?></h1>
<?php foreach($results as $result):?>
<table class='table-1 bd-1px'>
<caption>RESULT#<?php echo $result->id . ' ' . $result->date . " <span class='$result->caseResult'>" . $lang->testcase->resultList[$result->caseResult] . '</span>';?></caption>
<tr>
<th class='w-30px'><?php echo $lang->testcase->stepID;?></th>
<th class='w-p40'><?php echo $lang->testcase->stepDesc;?></th>
<th class='w-p20'><?php echo $lang->testcase->stepExpect;?></th>
<th><?php echo $lang->testcase->result;?></th>
<th class='w-p20'><?php echo $lang->testcase->real;?></th>
</tr>
<?php foreach($run->case->steps as $key => $step):?>
<?php $stepResult = (object)$result->stepResults[$step->id];?>
<tr>
<th><?php echo $key + 1;?></th>
<td><?php echo nl2br($step->desc);?></td>
<td><?php echo nl2br($step->expect);?></td>
<td class='<?php echo $stepResult->result;?> a-center'><?php echo $lang->testcase->resultList[$stepResult->result];?></td>
<td><?php echo $stepResult->real;?></td>
</tr>
<?php if($stepResult->result == 'blocked' or $stepResult->result == 'fail') break;?>
<?php endforeach;?>
</table>
<?php endforeach;?>
</div>
+57
View File
@@ -0,0 +1,57 @@
<?php
/**
* The runrun view file of testtask of ZenTaoMS.
*
* ZenTaoMS is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* ZenTaoMS is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with ZenTaoMS. If not, see <http://www.gnu.org/licenses/>.
*
* @copyright Copyright: 2009 Chunsheng Wang
* @author Chunsheng Wang <wwccss@263.net>
* @package testtask
* @version $Id$
* @link http://www.zentao.cn
*/
?>
<?php include '../../common/header.lite.html.php';?>
<div class='yui-d0'>
<form method='post'>
<table class='table-1 bd-1px'>
<caption>CASE#<?php echo $run->case->id. $lang->colon . $run->case->title;?></caption>
<tr>
<th class='w-30px'><?php echo $lang->testcase->stepID;?></th>
<th class='w-p40'><?php echo $lang->testcase->stepDesc;?></th>
<th class='w-p20'><?php echo $lang->testcase->stepExpect;?></th>
<th class='w-100px'><?php echo $lang->testcase->result;?></th>
<th><?php echo $lang->testcase->real;?></th>
</tr>
<?php foreach($run->case->steps as $key => $step):?>
<tr>
<th><?php echo $key + 1;?></th>
<td><?php echo nl2br($step->desc);?></td>
<td><?php echo nl2br($step->expect);?></td>
<td class='a-center'><?php echo html::select("steps[$step->id]", $lang->testcase->resultList, '');?></td>
<td><?php echo html::textarea("reals[$step->id]", '', "rows=3 class='area-1'");?></td>
</tr>
<?php endforeach;?>
<tr class='a-center'>
<td colspan='5'>
<?php
echo html::submitButton();
echo html::hidden('case', $run->case->id);
echo html::hidden('version', $run->case->version);
?>
</td>
</tr>
</table>
</form>
</div>
+53 -17
View File
@@ -18,12 +18,28 @@
* @copyright Copyright: 2009 Chunsheng Wang
* @author Chunsheng Wang <wwccss@263.net>
* @package case
* @version $Id: view.html.php 355 2010-01-29 06:59:40Z wwccss $
* @version $Id$
* @link http://www.zentao.cn
*/
?>
<?php include '../../common/header.html.php';?>
<?php include '../../common/colorize.html.php';?>
<?php include '../../common/tablesorter.html.php';?>
<?php include '../../common/colorbox.html.php';?>
<script language='javascript'>
$(document).ready(function()
{
$("a.iframe").colorbox({width:900, height:600, iframe:true, transition:'none'});
});
function checkall(checker)
{
$('input').each(function()
{
$(this).attr("checked", checker.checked)
});
}
</script>
<div class='yui-d0'>
<table class='table-1'>
<caption><?php echo $lang->testtask->view;?></caption>
@@ -33,7 +49,7 @@
</tr>
<tr>
<th class='rowhead'><?php echo $lang->testtask->build;?></th>
<td><?php echo $task->buildName;?></td>
<td><?php $task->buildName ? print($task->buildName) : print($task->build);?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->testtask->begin;?></th>
@@ -56,38 +72,58 @@
<td><?php echo nl2br($task->desc);?>
</tr>
</table>
<form method='post' action='<?php echo inlink('batchAssign', "task=$task->id");?>' target='hiddenwin'>
<table class='table-1 colored tablesorter'>
<caption><?php echo $lang->testtask->linkedCases;?></caption>
<caption>
<div class='f-left'><?php echo $lang->testtask->linkedCases;?></div>
<div class='f-right'><?php common::printLink('testtask', 'linkcase', "taskID=$task->id", $lang->testtask->linkCase);?></div>
</caption>
<thead>
<tr>
<th><?php echo $lang->testcase->id;?></th>
<th class='w-20px'><nobr><?php echo $lang->testcase->id;?></nobr></th>
<th><?php echo $lang->testcase->pri;?></th>
<th><?php echo $lang->testcase->title;?></th>
<th class='w-p40'><?php echo $lang->testcase->title;?></th>
<th><?php echo $lang->testcase->type;?></th>
<th><?php echo $lang->testcase->openedBy;?></th>
<th><?php echo $lang->testcase->status;?></th>
<th><?php echo $lang->testtask->assignedTo;?></th>
<th><?php echo $lang->testtask->lastRun;?></th>
<th><?php echo $lang->testtask->lastResult;?></th>
<th><?php echo $lang->testtask->status;?></th>
<th><?php echo $lang->action;?></th>
</tr>
</thead>
<tbody>
<?php foreach($cases as $case):?>
<?php foreach($runs as $run):?>
<tr class='a-center'>
<td><?php echo html::a($this->createLink('testcase', 'view', "testcaseID=$case->id"), sprintf('%03d', $case->id));?></td>
<td><?php echo $case->pri?></td>
<td width='50%' class='a-left'><?php echo html::a($this->createLink('testcase', 'view', "caseID=$case->id&version=$case->version"), $case->title, '_blank');?>
<td class='a-left'><?php echo "<input type='checkbox' name='cases[]' value='$run->case' /> "; printf('%03d', $run->case);?></td>
<td><?php echo $run->pri?></td>
<td class='a-left nobr'><?php echo html::a($this->createLink('testcase', 'view', "caseID=$run->case&version=$run->version"), $run->title, '_blank');?>
</td>
<td><?php echo $lang->testcase->typeList[$case->type];?></td>
<td><?php echo $users[$case->openedBy];?></td>
<td><?php echo $lang->testcase->statusList[$case->status];?></td>
<td><?php echo $lang->testcase->typeList[$run->type];?></td>
<td><?php echo $users[$run->assignedTo];?></td>
<td><?php if(substr($run->lastRun, 0, 4) != '0000') echo date('y-m-d H:i', strtotime($run->lastRun));?></td>
<td class='<?php echo $run->lastResult;?>'><?php if($run->lastResult) echo $lang->testcase->resultList[$run->lastResult];?></td>
<td class='<?php echo $run->status;?>'><?php echo $lang->testtask->statusList[$run->status];?></td>
<td>
<?php
common::printLink('testtask', 'unlinkcase', "id=$case->id", $lang->testtask->unlinkCase, 'hiddenwin');
common::printLink('testtask', 'executecase', "taskID=$task->id&caseid=$case->id", $lang->testtask->executeCase);
common::printLink('testtask', 'runcase', "id=$run->id", $lang->testtask->runCase, '', 'class="iframe"');
common::printLink('testtask', 'results', "id=$run->id", $lang->testtask->results, '', 'class="iframe"');
//common::printLink('bug', 'create', "id=$run->id", $lang->testtask->createBug);
common::printLink('testtask', 'unlinkcase', "id=$run->id", $lang->testtask->unlinkCase, 'hiddenwin');
?>
</td>
</tr>
<?php endforeach;?>
<tr>
<td><nobr><?php echo "<input type='checkbox' onclick='checkall(this);'> " . $lang->selectAll;?></nobr></td>
<td colspan='9'>
<?php
echo html::select('assignedTo', $users);
echo html::submitButton($lang->testtask->assign);
?>
</td>
</tr>
</tbody>
<?php endforeach;?>
</table>
</form>
</div>
<?php include '../../common/footer.html.php';?>
+3
View File
@@ -235,3 +235,6 @@ caption {border:1px solid #e4e4e4; background:#efefef; margin:0; padding:5
.done {color:darkgreen}
.wait {color:#9F9F5F}
.doing {color:red}
.pass {color:darkgreen}
.blocked {color:yellow}
.fail {color:red}