* finish task #1939.
This commit is contained in:
@@ -222,7 +222,7 @@ $lang->testcase->menu = new stdclass();
|
||||
$lang->testcase->menu->product = '%s';
|
||||
$lang->testcase->menu->bug = array('link' => 'Bug|bug|browse|productID=%s');
|
||||
$lang->testcase->menu->testcase = array('link' => 'Case|testcase|browse|productID=%s', 'alias' => 'view,create,batchcreate,edit,batchedit,showimport,groupcase', 'subModule' => 'tree');
|
||||
$lang->testcase->menu->testtask = array('link' => 'Build|testtask|browse|productID=%s', 'alias' => 'view,create,edit,linkcase,cases,start,close,batchrun');
|
||||
$lang->testcase->menu->testtask = array('link' => 'Build|testtask|browse|productID=%s', 'alias' => 'view,create,edit,linkcase,cases,start,close,batchrun,groupcase');
|
||||
|
||||
$lang->testtask = new stdclass();
|
||||
$lang->testtask->menu = $lang->testcase->menu;
|
||||
|
||||
@@ -222,7 +222,7 @@ $lang->testcase->menu = new stdclass();
|
||||
$lang->testcase->menu->product = '%s';
|
||||
$lang->testcase->menu->bug = array('link' => 'Bug|bug|browse|productID=%s');
|
||||
$lang->testcase->menu->testcase = array('link' => '用例|testcase|browse|productID=%s', 'alias' => 'view,create,batchcreate,edit,batchedit,showimport,groupcase', 'subModule' => 'tree');
|
||||
$lang->testcase->menu->testtask = array('link' => '版本|testtask|browse|productID=%s', 'alias' => 'view,create,edit,linkcase,cases,start,close,batchrun');
|
||||
$lang->testcase->menu->testtask = array('link' => '版本|testtask|browse|productID=%s', 'alias' => 'view,create,edit,linkcase,cases,start,close,batchrun,groupcase');
|
||||
|
||||
$lang->testtask = new stdclass();
|
||||
$lang->testtask->menu = $lang->testcase->menu;
|
||||
|
||||
@@ -313,6 +313,49 @@ class testtask extends control
|
||||
$this->display();
|
||||
}
|
||||
|
||||
public function groupCase($taskID, $groupBy = 'story')
|
||||
{
|
||||
/* Save the session. */
|
||||
$this->app->loadLang('testcase');
|
||||
$this->session->set('caseList', $this->app->getURI(true));
|
||||
|
||||
/* Get task and product info, set menu. */
|
||||
$groupBy = empty($groupBy) ? 'story' : $groupBy;
|
||||
$task = $this->testtask->getById($taskID);
|
||||
if(!$task) die(js::error($this->lang->notFound) . js::locate('back'));
|
||||
$productID = $task->product;
|
||||
$this->testtask->setMenu($this->products, $productID);
|
||||
|
||||
$runs = $this->testtask->getRuns($taskID, 0, $groupBy);
|
||||
$this->loadModel('common')->saveQueryCondition($this->dao->get(), 'testcase', false);
|
||||
|
||||
$groupCases = array();
|
||||
$groupByList = array();
|
||||
foreach($runs as $run)
|
||||
{
|
||||
if($groupBy == 'story')
|
||||
{
|
||||
$groupCases[$run->story][] = $run;
|
||||
$groupByList[$run->story] = $run->storyTitle;
|
||||
}
|
||||
}
|
||||
|
||||
$this->view->title = $this->products[$productID] . $this->lang->colon . $this->lang->testtask->cases;
|
||||
$this->view->position[] = html::a($this->createLink('testtask', 'browse', "productID=$productID"), $this->products[$productID]);
|
||||
$this->view->position[] = $this->lang->testtask->common;
|
||||
$this->view->position[] = $this->lang->testtask->cases;
|
||||
|
||||
$this->view->users = $this->loadModel('user')->getPairs('noletter');
|
||||
$this->view->productID = $productID;
|
||||
$this->view->task = $task;
|
||||
$this->view->taskID = $taskID;
|
||||
$this->view->browseType = 'group';
|
||||
$this->view->groupBy = $groupBy;
|
||||
$this->view->groupByList = $groupByList;
|
||||
$this->view->cases = $groupCases;
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Edit a test task.
|
||||
*
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
$(document).ready(function()
|
||||
{
|
||||
$('#' + browseType + 'Tab').addClass('active');
|
||||
});
|
||||
@@ -240,8 +240,9 @@ class testtaskModel extends model
|
||||
{
|
||||
$orderBy = strpos($orderBy, 'assignedTo') !== false ? ('t1.' . $orderBy) : ('t2.' . $orderBy);
|
||||
|
||||
return $this->dao->select('t2.*,t1.*,t2.version as caseVersion')->from(TABLE_TESTRUN)->alias('t1')
|
||||
return $this->dao->select('t2.*,t1.*,t2.version as caseVersion,t3.title as storyTitle')->from(TABLE_TESTRUN)->alias('t1')
|
||||
->leftJoin(TABLE_CASE)->alias('t2')->on('t1.case = t2.id')
|
||||
->leftJoin(TABLE_STORY)->alias('t3')->on('t2.story = t3.id')
|
||||
->where('t1.task')->eq((int)$taskID)
|
||||
->beginIF($moduleID)->andWhere('t2.module')->in($moduleID)->fi()
|
||||
->orderBy($orderBy)
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
<?php include $this->app->getModuleRoot() . 'common/view/dropmenu.html.php';?>
|
||||
<div id='featurebar'>
|
||||
<div class='heading'><?php echo html::icon($lang->icons['usecase']);?></div>
|
||||
<nav class='nav'>
|
||||
<?php
|
||||
echo "<li id='allTab'>" . html::a($this->inlink('cases', "taskID=$taskID&browseType=all¶m=0"), $lang->testtask->allCases) . "</li>";
|
||||
echo "<li id='assignedtomeTab'>" . html::a($this->inlink('cases', "taskID=$taskID&browseType=assignedtome¶m=0"), $lang->testtask->assignedToMe) . "</li>";
|
||||
|
||||
echo "<li id='groupTab' class='dropdown'>";
|
||||
$groupBy = isset($groupBy) ? $groupBy : '';
|
||||
$current = zget($lang->testcase->groups, isset($groupBy) ? $groupBy : '', '');
|
||||
if(empty($current)) $current = $lang->testcase->groups[''];
|
||||
echo html::a('javascript:;', $current . " <span class='caret'></span>", '', "data-toggle='dropdown'");
|
||||
echo "<ul class='dropdown-menu'>";
|
||||
foreach ($lang->testcase->groups as $key => $value)
|
||||
{
|
||||
if($key == '') continue;
|
||||
echo '<li' . ($key == $groupBy ? " class='active'" : '') . '>';
|
||||
echo html::a($this->inlink('groupCase', "taskID=$taskID&groupBy=$key"), $value);
|
||||
}
|
||||
echo '</ul></li>';
|
||||
|
||||
|
||||
if($this->methodName == 'cases') echo "<li id='bysearchTab'><a href='#'><i class='icon-search icon'></i> {$lang->testcase->bySearch}</a></li> ";
|
||||
?>
|
||||
</nav>
|
||||
<div class='actions'>
|
||||
<?php
|
||||
echo "<div class='btn-group'>";
|
||||
common::printIcon('testtask', 'linkCase', "taskID=$task->id", '', 'button', 'link');
|
||||
common::printIcon('testcase', 'export', "productID=$productID&orderBy=`case`_desc&taskID=$task->id", '', 'button', '', '', 'iframe');
|
||||
echo '</div>';
|
||||
echo "<div class='btn-group'>";
|
||||
common::printRPN($this->session->testtaskList, '');
|
||||
echo '</div>';
|
||||
?>
|
||||
</div>
|
||||
<div id='querybox' class='<?php if($browseType =='bysearch') echo 'show';?>'></div>
|
||||
</div>
|
||||
|
||||
<?php foreach(glob(dirname(dirname(__FILE__)) . "/ext/view/featurebar.*.html.hook.php") as $fileName) include_once $fileName; ?>
|
||||
@@ -13,33 +13,12 @@
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<?php include '../../common/view/treeview.html.php';?>
|
||||
<?php include '../../common/view/colorize.html.php';?>
|
||||
<?php include './caseheader.html.php';?>
|
||||
<?php js::set('confirmUnlink', $lang->testtask->confirmUnlinkCase)?>
|
||||
<script language="Javascript">
|
||||
var browseType = '<?php echo $browseType;?>';
|
||||
var moduleID = '<?php echo $moduleID;?>';
|
||||
</script>
|
||||
<div id='featurebar'>
|
||||
<div class='heading'><?php echo html::icon($lang->icons['usecase']);?></div>
|
||||
<nav class='nav'>
|
||||
<?php
|
||||
echo "<li id='allTab'>" . html::a($this->inlink('cases', "taskID=$taskID&browseType=all¶m=0"), $lang->testtask->allCases) . "</li>";
|
||||
echo "<li id='assignedtomeTab'>" . html::a($this->inlink('cases', "taskID=$taskID&browseType=assignedtome¶m=0"), $lang->testtask->assignedToMe) . "</li>";
|
||||
echo "<li id='bysearchTab'><a href='#'><i class='icon-search icon'></i> {$lang->testcase->bySearch}</a></li> ";
|
||||
?>
|
||||
</nav>
|
||||
<div class='actions'>
|
||||
<?php
|
||||
echo "<div class='btn-group'>";
|
||||
common::printIcon('testtask', 'linkCase', "taskID=$task->id", '', 'button', 'link');
|
||||
common::printIcon('testcase', 'export', "productID=$productID&orderBy=`case`_desc&taskID=$task->id", '', 'button', '', '', 'iframe');
|
||||
echo '</div>';
|
||||
echo "<div class='btn-group'>";
|
||||
common::printRPN($this->session->testtaskList, '');
|
||||
echo '</div>';
|
||||
?>
|
||||
</div>
|
||||
<div id='querybox' class='<?php if($browseType =='bysearch') echo 'show';?>'></div>
|
||||
</div>
|
||||
<div class='side' id='casesbox'>
|
||||
<a class='side-handle' data-id='testtaskTree'><i class='icon-caret-left'></i></a>
|
||||
<div class='side-body'>
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
/**
|
||||
* The case group view file of testcase module of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2013 青岛易软天创网络科技有限公司 (QingDao Nature Easy Soft Network Technology Co,LTD www.cnezsoft.com)
|
||||
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
|
||||
* @author Yidong Wang <yidong@cnezsoft.com>
|
||||
* @package testcase
|
||||
* @version $Id$
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<?php include '../../common/view/treetable.html.php';?>
|
||||
<?php include './caseheader.html.php';?>
|
||||
<?php js::set('browseType', $browseType);?>
|
||||
<table class='table table-fixed' id='treetable'>
|
||||
<thead>
|
||||
<tr>
|
||||
<th class='w-50px'></th>
|
||||
<th><?php echo $lang->testcase->title;?></th>
|
||||
<th class='w-pri'> <?php echo $lang->priAB;?></th>
|
||||
<th class='w-80px'> <?php echo $lang->typeAB;?></th>
|
||||
<th class='w-user'> <?php echo $lang->testtask->assignedTo;?></th>
|
||||
<th class='w-80px'> <?php echo $lang->testtask->lastRunAccount;?></th>
|
||||
<th class='w-120px'><?php echo $lang->testtask->lastRunTime;?></th>
|
||||
<th class='w-80px'> <?php echo $lang->testtask->lastRunResult;?></th>
|
||||
<th class='w-80px'> <?php echo $lang->testtask->status;?></th>
|
||||
<th class='w-60px'> <?php echo $lang->actions;?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<?php $i = 0;?>
|
||||
<?php foreach($cases as $groupKey => $groupTasks):?>
|
||||
<?php $groupClass = ($i % 2 == 0) ? 'even' : 'highlight-warning'; $i ++;?>
|
||||
<tr id='node-<?php echo $groupKey;?>' class='actie-disabled group-title'>
|
||||
<td class='text-right <?php echo $groupClass;?> text-left large strong group-name'><?php echo $groupKey;?></td>
|
||||
<td colspan='9' class='text-left'><?php if($groupByList) echo $groupByList[$groupKey];?></td>
|
||||
</tr>
|
||||
<?php foreach($groupTasks as $case):?>
|
||||
<?php $caseLink = $this->createLink('case','view',"caseID=$case->id"); ?>
|
||||
<tr id='<?php echo $case->id;?>' class='a-center child-of-node-<?php echo $groupKey;?>'>
|
||||
<td class='<?php echo $groupClass;?>'></td>
|
||||
<td class='text-left'> <?php echo $case->id . $lang->colon; if(!common::printLink('testcase', 'view', "case=$case->id", $case->title)) echo $case->title;?></td>
|
||||
<td><span class='<?php echo 'pri' . $case->pri?>'><?php echo $case->pri;?></span></td>
|
||||
<td><?php echo $lang->case->typeList[$case->type];?></td>
|
||||
<td><?php echo $users[$case->assignedTo];?></td>
|
||||
<td><?php echo $users[$case->lastRunner];?></td>
|
||||
<td><?php if(!helper::isZeroDate($case->lastRunDate)) echo date(DT_MONTHTIME1, strtotime($case->lastRunDate));?></td>
|
||||
<td class='<?php echo $case->lastRunResult;?>'><?php if($case->lastRunResult) echo $lang->testcase->resultList[$case->lastRunResult];?></td>
|
||||
<td class='<?php echo $case->status;?>'><?php echo ($case->version < $case->caseVersion) ? "<span class='warning'>{$lang->testcase->changed}</span>" : $lang->testtask->statusList[$case->status];?></td>
|
||||
<td>
|
||||
<?php common::printIcon('testcase', 'edit', "caseID=$case->id", '', 'list');?>
|
||||
<?php common::printIcon('testcase', 'delete', "caseID=$case->id", '', 'list', '', 'hiddenwin');?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
<?php endforeach;?>
|
||||
</table>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
Reference in New Issue
Block a user