* code for task #1939.
This commit is contained in:
@@ -213,7 +213,7 @@ $lang->bug->menu = new stdclass();
|
||||
|
||||
$lang->bug->menu->product = '%s';
|
||||
$lang->bug->menu->bug = array('link' => 'Bug|bug|browse|productID=%s', 'alias' => 'view,create,batchcreate,edit,resolve,close,activate,report,batchedit,confirmbug,assignto', 'subModule' => 'tree');
|
||||
$lang->bug->menu->testcase = array('link' => 'Case|testcase|browse|productID=%s', 'alias' => 'view,create,edit');
|
||||
$lang->bug->menu->testcase = array('link' => 'Case|testcase|browse|productID=%s');
|
||||
$lang->bug->menu->testtask = array('link' => 'Build|testtask|browse|productID=%s');
|
||||
|
||||
$lang->testcase = new stdclass();
|
||||
@@ -221,7 +221,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', 'subModule' => 'tree');
|
||||
$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->testtask = new stdclass();
|
||||
|
||||
@@ -213,7 +213,7 @@ $lang->bug->menu = new stdclass();
|
||||
|
||||
$lang->bug->menu->product = '%s';
|
||||
$lang->bug->menu->bug = array('link' => 'Bug|bug|browse|productID=%s', 'alias' => 'view,create,batchcreate,edit,resolve,close,activate,report,batchedit,confirmbug,assignto', 'subModule' => 'tree');
|
||||
$lang->bug->menu->testcase = array('link' => '用例|testcase|browse|productID=%s', 'alias' => 'view,create,edit');
|
||||
$lang->bug->menu->testcase = array('link' => '用例|testcase|browse|productID=%s');
|
||||
$lang->bug->menu->testtask = array('link' => '版本|testtask|browse|productID=%s');
|
||||
|
||||
$lang->testcase = new stdclass();
|
||||
@@ -221,7 +221,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', 'subModule' => 'tree');
|
||||
$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->testtask = new stdclass();
|
||||
|
||||
@@ -134,7 +134,7 @@ class testcase extends control
|
||||
}
|
||||
|
||||
/* save session .*/
|
||||
$this->loadModel('common')->saveQueryCondition($this->dao->get(), 'testcase', $browseType == 'needconfirm' ? false : true);
|
||||
$this->loadModel('common')->saveQueryCondition($this->dao->get(), 'testcase', $browseType != 'bysearch' ? false : true);
|
||||
|
||||
/* Build the search form. */
|
||||
$this->config->testcase->search['params']['product']['values']= array($productID => $this->products[$productID], 'all' => $this->lang->testcase->allProduct);
|
||||
@@ -160,6 +160,51 @@ class testcase extends control
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Group case.
|
||||
*
|
||||
* @param int $productID
|
||||
* @param string $groupBy
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function groupCase($productID = 0, $groupBy = 'stroy')
|
||||
{
|
||||
$groupBy = empty($groupBy) ? 'stroy' : $groupBy;
|
||||
$productID = $this->product->saveState($productID, $this->products);
|
||||
|
||||
$this->app->loadLang('testtask');
|
||||
|
||||
$this->testcase->setMenu($this->products, $productID);
|
||||
$this->session->set('caseList', $this->app->getURI(true));
|
||||
|
||||
$cases = $this->testcase->getModuleCases($productID, 0, $groupBy);
|
||||
$this->loadModel('common')->saveQueryCondition($this->dao->get(), 'testcase', false);
|
||||
|
||||
$groupCases = array();
|
||||
$groupByList = array();
|
||||
foreach($cases as $case)
|
||||
{
|
||||
if($groupBy == 'story')
|
||||
{
|
||||
$groupCases[$case->story][] = $case;
|
||||
$groupByList[$case->story] = $case->storyTitle;
|
||||
}
|
||||
}
|
||||
|
||||
$this->view->title = $this->products[$productID] . $this->lang->colon . $this->lang->testcase->common;
|
||||
$this->view->position[] = html::a($this->createLink('testcase', 'groupTask', "productID=$productID&groupBy=$groupBy"), $this->products[$productID]);
|
||||
$this->view->position[] = $this->lang->testcase->common;
|
||||
$this->view->productID = $productID;
|
||||
$this->view->productName = $this->products[$productID];
|
||||
$this->view->users = $this->user->getPairs('noletter');
|
||||
$this->view->browseType = 'group';
|
||||
$this->view->groupBy = $groupBy;
|
||||
$this->view->groupByList = $groupByList;
|
||||
$this->view->cases = $groupCases;
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a test case.
|
||||
*
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
$(document).ready(function()
|
||||
{
|
||||
$('#' + browseType + 'Tab').addClass('active');
|
||||
});
|
||||
@@ -135,6 +135,9 @@ $lang->testcase->stageList['system'] = 'System testing';
|
||||
$lang->testcase->stageList['smoke'] = 'Smoking testing';
|
||||
$lang->testcase->stageList['bvt'] = 'BVT testing';
|
||||
|
||||
$lang->testcase->groups[''] = 'Group view';
|
||||
$lang->testcase->groups['story'] = 'Group by story';
|
||||
|
||||
$lang->testcase->statusList[''] = '';
|
||||
$lang->testcase->statusList['normal'] = 'Normal';
|
||||
$lang->testcase->statusList['blocked'] = 'Blocked';
|
||||
|
||||
@@ -135,6 +135,9 @@ $lang->testcase->stageList['system'] = '系统测试阶段';
|
||||
$lang->testcase->stageList['smoke'] = '冒烟测试阶段';
|
||||
$lang->testcase->stageList['bvt'] = '版本验证阶段';
|
||||
|
||||
$lang->testcase->groups[''] = '分组查看';
|
||||
$lang->testcase->groups['story'] = '需求分组';
|
||||
|
||||
$lang->testcase->statusList[''] = '';
|
||||
$lang->testcase->statusList['normal'] = '正常';
|
||||
$lang->testcase->statusList['blocked'] = '被阻塞';
|
||||
|
||||
@@ -144,11 +144,12 @@ class testcaseModel extends model
|
||||
*/
|
||||
public function getModuleCases($productID, $moduleIds = 0, $orderBy = 'id_desc', $pager = null)
|
||||
{
|
||||
return $this->dao->select('*')->from(TABLE_CASE)
|
||||
->where('product')->eq((int)$productID)
|
||||
->beginIF($moduleIds)->andWhere('module')->in($moduleIds)->fi()
|
||||
->andWhere('deleted')->eq('0')
|
||||
->orderBy($orderBy)->page($pager)->fetchAll();
|
||||
return $this->dao->select('t1.*, t2.title as storyTitle')->from(TABLE_CASE)->alias('t1')
|
||||
->leftJoin(TABLE_STORY)->alias('t2')->on('t1.story=t2.id')
|
||||
->where('t1.product')->eq((int)$productID)
|
||||
->beginIF($moduleIds)->andWhere('t1.module')->in($moduleIds)->fi()
|
||||
->andWhere('t1.deleted')->eq('0')
|
||||
->orderBy($orderBy)->page($pager)->fetchAll('id');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -14,46 +14,11 @@
|
||||
include '../../common/view/header.html.php';
|
||||
include '../../common/view/datepicker.html.php';
|
||||
include '../../common/view/treeview.html.php';
|
||||
include './caseheader.html.php';
|
||||
js::set('browseType', $browseType);
|
||||
js::set('moduleID' , $moduleID);
|
||||
js::set('confirmDelete', $lang->testcase->confirmDelete);
|
||||
?>
|
||||
<div id='featurebar'>
|
||||
<ul class='nav'>
|
||||
<?php
|
||||
echo "<li id='allTab'>" . html::a($this->createLink('testcase', 'browse', "productid=$productID&browseType=all¶m=0&orderBy=$orderBy&recTotal=0&recPerPage=200"), $lang->testcase->allCases) . "</li>";
|
||||
echo "<li id='needconfirmTab'>" . html::a($this->createLink('testcase', 'browse', "productid=$productID&browseType=needconfirm¶m=0"), $lang->testcase->needConfirm) . "</li>";
|
||||
echo "<li id='bysearchTab' onclick=\"browseBySearch('$browseType')\"><a href='#'><i class='icon-search icon'></i> {$lang->testcase->bySearch}</a></li> ";
|
||||
?>
|
||||
</ul>
|
||||
<div class='actions'>
|
||||
<div class='btn-group'>
|
||||
<div class='btn-group'>
|
||||
<button type='button' class='btn btn-default dropdown-toggle' data-toggle='dropdown'>
|
||||
<i class='icon-download-alt'></i> <?php echo $lang->export ?>
|
||||
<span class='caret'></span>
|
||||
</button>
|
||||
<ul class='dropdown-menu' id='exportActionMenu'>
|
||||
<?php
|
||||
$misc = common::hasPriv('testcase', 'export') ? "class='export'" : "class=disabled";
|
||||
$link = common::hasPriv('testcase', 'export') ? $this->createLink('testcase', 'export', "productID=$productID&orderBy=$orderBy") : '#';
|
||||
echo "<li>" . html::a($link, $lang->testcase->export, '', $misc) . "</li>";
|
||||
|
||||
$misc = common::hasPriv('testcase', 'exportTemplet') ? "class='export'" : "class=disabled";
|
||||
$link = common::hasPriv('testcase', 'exportTemplet') ? $this->createLink('testcase', 'exportTemplet', "productID=$productID") : '#';
|
||||
echo "<li>" . html::a($link, $lang->testcase->exportTemplet, '', $misc) . "</li>";
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
<?php
|
||||
common::printIcon('testcase', 'import', "productID=$productID", '', 'button', '', '', 'export cboxElement iframe');
|
||||
common::printIcon('testcase', 'batchCreate', "productID=$productID&moduleID=$moduleID");
|
||||
common::printIcon('testcase', 'create', "productID=$productID&moduleID=$moduleID");
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div id='querybox' class='<?php if($browseType =='bysearch') echo 'show';?>'></div>
|
||||
</div>
|
||||
<div class='side' id='treebox'>
|
||||
<a class='side-handle' data-id='testcaseTree'><i class='icon-caret-left'></i></a>
|
||||
<div class='side-body'>
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
<?php include $this->app->getModuleRoot() . 'common/view/dropmenu.html.php';?>
|
||||
<div id='featurebar'>
|
||||
<ul class='nav'>
|
||||
<?php
|
||||
echo "<li id='allTab'>" . html::a($this->createLink('testcase', 'browse', "productid=$productID&browseType=all"), $lang->testcase->allCases) . "</li>";
|
||||
echo "<li id='needconfirmTab'>" . html::a($this->createLink('testcase', 'browse', "productid=$productID&browseType=needconfirm"), $lang->testcase->needConfirm) . "</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->createLink('testcase', 'groupCase', "productID=$productID&groupBy=$key"), $value);
|
||||
}
|
||||
echo '</ul></li>';
|
||||
|
||||
|
||||
if($this->methodName == 'browse') echo "<li id='bysearchTab'><a href='#'><i class='icon-search icon'></i> {$lang->testcase->bySearch}</a></li> ";
|
||||
?>
|
||||
</ul>
|
||||
<div class='actions'>
|
||||
<div class='btn-group'>
|
||||
<div class='btn-group'>
|
||||
<button type='button' class='btn btn-default dropdown-toggle' data-toggle='dropdown'>
|
||||
<i class='icon-download-alt'></i> <?php echo $lang->export ?>
|
||||
<span class='caret'></span>
|
||||
</button>
|
||||
<ul class='dropdown-menu' id='exportActionMenu'>
|
||||
<?php
|
||||
$misc = common::hasPriv('testcase', 'export') ? "class='export'" : "class=disabled";
|
||||
$link = common::hasPriv('testcase', 'export') ? $this->createLink('testcase', 'export', "productID=$productID&orderBy=$orderBy") : '#';
|
||||
echo "<li>" . html::a($link, $lang->testcase->export, '', $misc) . "</li>";
|
||||
|
||||
$misc = common::hasPriv('testcase', 'exportTemplet') ? "class='export'" : "class=disabled";
|
||||
$link = common::hasPriv('testcase', 'exportTemplet') ? $this->createLink('testcase', 'exportTemplet', "productID=$productID") : '#';
|
||||
echo "<li>" . html::a($link, $lang->testcase->exportTemplet, '', $misc) . "</li>";
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
<?php
|
||||
common::printIcon('testcase', 'import', "productID=$productID", '', 'button', '', '', 'export cboxElement iframe');
|
||||
common::printIcon('testcase', 'batchCreate', "productID=$productID");
|
||||
common::printIcon('testcase', 'create', "productID=$productID");
|
||||
?>
|
||||
</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; ?>
|
||||
@@ -0,0 +1,57 @@
|
||||
<?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-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->testcase->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='8' 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->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 if(isset($run)) echo $run->status;?>'><?php echo $lang->testcase->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