Merge branch 'sprint_220' into sprint/220
This commit is contained in:
+10
-8
@@ -299,14 +299,16 @@ $filter->execution->story->cookie['storyBranchParam'] = 'int';
|
||||
$filter->execution->story->cookie['executionStoryOrder'] = 'code';
|
||||
$filter->execution->export->cookie['checkedItem'] = 'reg::checked';
|
||||
|
||||
$filter->testcase->browse->cookie['caseModule'] = 'int';
|
||||
$filter->testcase->browse->cookie['caseSuite'] = 'int';
|
||||
$filter->testcase->browse->cookie['preBranch'] = 'reg::word';
|
||||
$filter->testcase->create->cookie['lastCaseModule'] = 'int';
|
||||
$filter->testcase->default->cookie['lastProduct'] = 'int';
|
||||
$filter->testcase->default->cookie['preProductID'] = 'int';
|
||||
$filter->testcase->export->cookie['checkedItem'] = 'reg::checked';
|
||||
$filter->testcase->groupcase->cookie['preBranch'] = 'reg::word';
|
||||
$filter->testcase->browse->cookie['caseModule'] = 'int';
|
||||
$filter->testcase->browse->cookie['caseSuite'] = 'int';
|
||||
$filter->testcase->browse->cookie['preBranch'] = 'reg::word';
|
||||
$filter->testcase->browse->cookie['showAutoCase'] = 'int';
|
||||
$filter->testcase->create->cookie['lastCaseModule'] = 'int';
|
||||
$filter->testcase->default->cookie['lastProduct'] = 'int';
|
||||
$filter->testcase->default->cookie['preProductID'] = 'int';
|
||||
$filter->testcase->export->cookie['checkedItem'] = 'reg::checked';
|
||||
$filter->testcase->groupcase->cookie['preBranch'] = 'reg::word';
|
||||
$filter->testcase->groupcase->cookie['showAutoCase'] = 'int';
|
||||
|
||||
$filter->testreport->default->cookie['lastProduct'] = 'int';
|
||||
$filter->testreport->default->cookie['lastProject'] = 'int';
|
||||
|
||||
@@ -1186,7 +1186,7 @@ class project extends control
|
||||
$extra = "$projectID,$browseType";
|
||||
$this->lang->modulePageNav = $this->product->select($products, $productID, 'project', 'testcase', $extra, $branch);
|
||||
|
||||
echo $this->fetch('testcase', 'browse', "productID=$productID&branch=$branch&browseType=$browseType¶m=$param&orderBy=$orderBy&recTotal=$orderBy&recPerPage=$recPerPage&pageID=$pageID&projectID=$projectID");
|
||||
echo $this->fetch('testcase', 'browse', "productID=$productID&branch=$branch&browseType=$browseType¶m=$param&caseType=&orderBy=$orderBy&recTotal=$orderBy&recPerPage=$recPerPage&pageID=$pageID&projectID=$projectID");
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -78,6 +78,7 @@ class testcase extends control
|
||||
* @param int|string $branch
|
||||
* @param string $browseType
|
||||
* @param int $param
|
||||
* @param string $caseType
|
||||
* @param string $orderBy
|
||||
* @param int $recTotal
|
||||
* @param int $recPerPage
|
||||
@@ -86,7 +87,7 @@ class testcase extends control
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function browse($productID = 0, $branch = '', $browseType = 'all', $param = 0, $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1, $projectID = 0)
|
||||
public function browse($productID = 0, $branch = '', $browseType = 'all', $param = 0, $caseType = '', $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1, $projectID = 0)
|
||||
{
|
||||
$this->loadModel('datatable');
|
||||
|
||||
@@ -142,11 +143,11 @@ class testcase extends control
|
||||
$sort = common::appendOrder($orderBy);
|
||||
|
||||
/* Get test cases. */
|
||||
$cases = $this->testcase->getTestCases($productID, $branch, $browseType, $browseType == 'bysearch' ? $queryID : $suiteID, $moduleID, $sort, $pager);
|
||||
$cases = $this->testcase->getTestCases($productID, $branch, $browseType, $browseType == 'bysearch' ? $queryID : $suiteID, $moduleID, $caseType, $sort, $pager);
|
||||
if(empty($cases) and $pageID > 1)
|
||||
{
|
||||
$pager = pager::init(0, $recPerPage, 1);
|
||||
$cases = $this->testcase->getTestCases($productID, $branch, $browseType, $browseType == 'bysearch' ? $queryID : $suiteID, $moduleID, $sort, $pager);
|
||||
$cases = $this->testcase->getTestCases($productID, $branch, $browseType, $browseType == 'bysearch' ? $queryID : $suiteID, $moduleID, $caseType, $sort, $pager);
|
||||
}
|
||||
|
||||
/* save session .*/
|
||||
@@ -216,6 +217,7 @@ class testcase extends control
|
||||
$this->view->orderBy = $orderBy;
|
||||
$this->view->browseType = $browseType;
|
||||
$this->view->param = $param;
|
||||
$this->view->caseType = $caseType;
|
||||
$this->view->cases = $cases;
|
||||
$this->view->branch = (!empty($product) and $product->type != 'normal') ? $branch : 0;
|
||||
$this->view->branchOption = $branchOption;
|
||||
@@ -234,11 +236,14 @@ class testcase extends control
|
||||
* Group case.
|
||||
*
|
||||
* @param int $productID
|
||||
* @param string $branch
|
||||
* @param string $groupBy
|
||||
* @param int $projectID
|
||||
* @param string $caseType
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function groupCase($productID = 0, $branch = '', $groupBy = 'story', $projectID = 0)
|
||||
public function groupCase($productID = 0, $branch = '', $groupBy = 'story', $projectID = 0, $caseType = '')
|
||||
{
|
||||
$groupBy = empty($groupBy) ? 'story' : $groupBy;
|
||||
$productID = $this->product->saveState($productID, $this->products);
|
||||
@@ -255,7 +260,7 @@ class testcase extends control
|
||||
|
||||
$this->session->set('caseList', $this->app->getURI(true), $this->app->tab);
|
||||
|
||||
$cases = $this->testcase->getModuleCases($productID, $branch, 0, $groupBy);
|
||||
$cases = $this->testcase->getModuleCases($productID, $branch, 0, '', 'no', $caseType, $groupBy);
|
||||
$this->loadModel('common')->saveQueryCondition($this->dao->get(), 'testcase', false);
|
||||
$cases = $this->loadModel('story')->checkNeedConfirm($cases);
|
||||
$cases = $this->testcase->appendData($cases);
|
||||
@@ -292,6 +297,7 @@ class testcase extends control
|
||||
$this->view->moduleID = 0;
|
||||
$this->view->branch = $branch;
|
||||
$this->view->product = $this->product->getByID($productID);
|
||||
$this->view->caseType = $caseType;
|
||||
$this->display();
|
||||
}
|
||||
|
||||
@@ -548,7 +554,7 @@ class testcase extends control
|
||||
$currentModule = $this->app->tab == 'project' ? 'project' : 'testcase';
|
||||
$currentMethod = $this->app->tab == 'project' ? 'testcase' : 'browse';
|
||||
$projectParam = $this->app->tab == 'project' ? "projectID={$this->session->project}&" : '';
|
||||
return print(js::locate($this->createLink($currentModule, $currentMethod, $projectParam . "productID=$productID&branch=$branch&browseType=all¶m=0&orderBy=id_desc"), 'parent'));
|
||||
return print(js::locate($this->createLink($currentModule, $currentMethod, $projectParam . "productID=$productID&branch=$branch&browseType=all¶m=0&caseType=&orderBy=id_desc"), 'parent'));
|
||||
}
|
||||
if(empty($this->products)) $this->locate($this->createLink('product', 'create'));
|
||||
|
||||
|
||||
@@ -31,5 +31,12 @@ $(function()
|
||||
$('#caseIdList').val(storyIdList);
|
||||
});
|
||||
});
|
||||
|
||||
$('input[name^="showAutoCase"]').click(function()
|
||||
{
|
||||
var showAutoCase = $(this).is(':checked') ? 1 : 0;
|
||||
$.cookie('showAutoCase', showAutoCase, {expires:config.cookieLife, path:config.webRoot});
|
||||
window.location.reload();
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
$(function()
|
||||
{
|
||||
$('input[name^="showAutoCase"]').click(function()
|
||||
{
|
||||
var showAutoCase = $(this).is(':checked') ? 1 : 0;
|
||||
$.cookie('showAutoCase', showAutoCase, {expires:config.cookieLife, path:config.webRoot});
|
||||
window.location.reload();
|
||||
});
|
||||
})
|
||||
|
||||
@@ -95,6 +95,9 @@ $lang->testcase->deleted = 'Deleted';
|
||||
$lang->testcase->browseUnits = 'Unit Test';
|
||||
$lang->testcase->suite = 'Test Suite';
|
||||
$lang->testcase->executionStatus = 'executionStatus';
|
||||
$lang->testcase->caseType = 'Case Type';
|
||||
$lang->testcase->allType = 'All Types';
|
||||
$lang->testcase->showAutoCase = 'Show Automated Test Cases';
|
||||
|
||||
$lang->case = $lang->testcase; // For dao checking using. Because 'case' is a php keywords, so the module name is testcase, table name is still case.
|
||||
|
||||
@@ -250,6 +253,7 @@ $lang->testcase->action->unlinkedfromproject = array('main' => '$date, 由 <st
|
||||
$lang->testcase->action->linked2execution = array('main' => '$date, 由 <strong>$actor</strong> 关联到' . $lang->executionCommon . ' <strong>$extra</strong>。');
|
||||
$lang->testcase->action->unlinkedfromexecution = array('main' => '$date, 由 <strong>$actor</strong> 从' . $lang->executionCommon . ' <strong>$extra</strong> 移除。');
|
||||
|
||||
$lang->testcase->featureBar['browse']['casetype'] = $lang->testcase->caseType;
|
||||
$lang->testcase->featureBar['browse']['all'] = $lang->testcase->allCases;
|
||||
$lang->testcase->featureBar['browse']['wait'] = 'Wartend';
|
||||
$lang->testcase->featureBar['browse']['needconfirm'] = $lang->testcase->needConfirm;
|
||||
@@ -257,4 +261,5 @@ $lang->testcase->featureBar['browse']['group'] = 'Group View';
|
||||
$lang->testcase->featureBar['browse']['suite'] = 'Suite';
|
||||
$lang->testcase->featureBar['browse']['zerocase'] = 'Zero Case Story';
|
||||
$lang->testcase->featureBar['browse']['browseunits'] = 'Unit Test';
|
||||
$lang->testcase->featureBar['browse']['autocase'] = $lang->testcase->showAutoCase;
|
||||
$lang->testcase->featureBar['groupcase'] = $lang->testcase->featureBar['browse'];
|
||||
|
||||
@@ -95,6 +95,9 @@ $lang->testcase->deleted = 'Deleted';
|
||||
$lang->testcase->browseUnits = 'Unit Test';
|
||||
$lang->testcase->suite = 'Test Suite';
|
||||
$lang->testcase->executionStatus = 'executionStatus';
|
||||
$lang->testcase->caseType = 'Case Type';
|
||||
$lang->testcase->allType = 'All Types';
|
||||
$lang->testcase->showAutoCase = 'Show Automated Test Cases';
|
||||
|
||||
$lang->case = $lang->testcase; // For dao checking using. Because 'case' is a php keywords, so the module name is testcase, table name is still case.
|
||||
|
||||
@@ -250,6 +253,7 @@ $lang->testcase->action->unlinkedfromproject = array('main' => '$date, 由 <st
|
||||
$lang->testcase->action->linked2execution = array('main' => '$date, 由 <strong>$actor</strong> 关联到' . $lang->executionCommon . ' <strong>$extra</strong>。');
|
||||
$lang->testcase->action->unlinkedfromexecution = array('main' => '$date, 由 <strong>$actor</strong> 从' . $lang->executionCommon . ' <strong>$extra</strong> 移除。');
|
||||
|
||||
$lang->testcase->featureBar['browse']['casetype'] = $lang->testcase->caseType;
|
||||
$lang->testcase->featureBar['browse']['all'] = $lang->testcase->allCases;
|
||||
$lang->testcase->featureBar['browse']['wait'] = 'Waiting';
|
||||
$lang->testcase->featureBar['browse']['needconfirm'] = $lang->testcase->needConfirm;
|
||||
@@ -257,4 +261,5 @@ $lang->testcase->featureBar['browse']['group'] = 'Group View';
|
||||
$lang->testcase->featureBar['browse']['suite'] = 'Suite';
|
||||
$lang->testcase->featureBar['browse']['zerocase'] = 'Zero Case Story';
|
||||
$lang->testcase->featureBar['browse']['browseunits'] = 'Unit Test';
|
||||
$lang->testcase->featureBar['browse']['autocase'] = $lang->testcase->showAutoCase;
|
||||
$lang->testcase->featureBar['groupcase'] = $lang->testcase->featureBar['browse'];
|
||||
|
||||
@@ -95,6 +95,9 @@ $lang->testcase->deleted = 'Deleted';
|
||||
$lang->testcase->browseUnits = 'Unit Test';
|
||||
$lang->testcase->suite = 'Test Suite';
|
||||
$lang->testcase->executionStatus = 'executionStatus';
|
||||
$lang->testcase->caseType = 'Case Type';
|
||||
$lang->testcase->allType = 'All Types';
|
||||
$lang->testcase->showAutoCase = 'Show Automated Test Cases';
|
||||
|
||||
$lang->case = $lang->testcase; // For dao checking using. Because 'case' is a php keywords, so the module name is testcase, table name is still case.
|
||||
|
||||
@@ -250,6 +253,7 @@ $lang->testcase->action->unlinkedfromproject = array('main' => '$date, 由 <st
|
||||
$lang->testcase->action->linked2execution = array('main' => '$date, 由 <strong>$actor</strong> 关联到' . $lang->executionCommon . ' <strong>$extra</strong>。');
|
||||
$lang->testcase->action->unlinkedfromexecution = array('main' => '$date, 由 <strong>$actor</strong> 从' . $lang->executionCommon . ' <strong>$extra</strong> 移除。');
|
||||
|
||||
$lang->testcase->featureBar['browse']['casetype'] = $lang->testcase->caseType;
|
||||
$lang->testcase->featureBar['browse']['all'] = $lang->testcase->allCases;
|
||||
$lang->testcase->featureBar['browse']['wait'] = 'En Attente';
|
||||
$lang->testcase->featureBar['browse']['needconfirm'] = $lang->testcase->needConfirm;
|
||||
@@ -257,4 +261,5 @@ $lang->testcase->featureBar['browse']['group'] = 'Group View';
|
||||
$lang->testcase->featureBar['browse']['suite'] = 'Suite';
|
||||
$lang->testcase->featureBar['browse']['zerocase'] = 'Zero Case Story';
|
||||
$lang->testcase->featureBar['browse']['browseunits'] = 'Unit Test';
|
||||
$lang->testcase->featureBar['browse']['autocase'] = $lang->testcase->showAutoCase;
|
||||
$lang->testcase->featureBar['groupcase'] = $lang->testcase->featureBar['browse'];
|
||||
|
||||
@@ -75,6 +75,9 @@ $lang->testcase->fromTesttask = 'Từ Yêu cầu Test';
|
||||
$lang->testcase->fromCaselib = 'Từ thư viện tình huống';
|
||||
$lang->testcase->deleted = 'Đã xóa';
|
||||
$lang->testcase->browseUnits = 'Unit Test';
|
||||
$lang->testcase->caseType = 'Case Type';
|
||||
$lang->testcase->allType = 'All Types';
|
||||
$lang->testcase->showAutoCase = 'Show Automated Test Cases';
|
||||
|
||||
$lang->case = $lang->testcase; // For dao checking using. Because 'case' is a php keywords, so the module name is testcase, table name is still case.
|
||||
|
||||
@@ -223,6 +226,7 @@ $lang->testcase->action->unlinkedfromproject = array('main' => '$date, 由 <st
|
||||
$lang->testcase->action->linked2execution = array('main' => '$date, 由 <strong>$actor</strong> 关联到' . $lang->executionCommon . ' <strong>$extra</strong>。');
|
||||
$lang->testcase->action->unlinkedfromexecution = array('main' => '$date, 由 <strong>$actor</strong> 从' . $lang->executionCommon . ' <strong>$extra</strong> 移除。');
|
||||
|
||||
$lang->testcase->featureBar['browse']['casetype'] = $lang->testcase->caseType;
|
||||
$lang->testcase->featureBar['browse']['all'] = $lang->testcase->allCases;
|
||||
$lang->testcase->featureBar['browse']['wait'] = 'Đang đợi';
|
||||
$lang->testcase->featureBar['browse']['needconfirm'] = $lang->testcase->needConfirm;
|
||||
@@ -230,4 +234,5 @@ $lang->testcase->featureBar['browse']['group'] = 'Group View';
|
||||
$lang->testcase->featureBar['browse']['suite'] = 'Suite';
|
||||
$lang->testcase->featureBar['browse']['zerocase'] = 'Zero Case Story';
|
||||
$lang->testcase->featureBar['browse']['browseunits'] = 'Unit Test';
|
||||
$lang->testcase->featureBar['browse']['autocase'] = $lang->testcase->showAutoCase;
|
||||
$lang->testcase->featureBar['groupcase'] = $lang->testcase->featureBar['browse'];
|
||||
|
||||
@@ -95,6 +95,9 @@ $lang->testcase->deleted = '是否删除';
|
||||
$lang->testcase->browseUnits = '单元测试';
|
||||
$lang->testcase->suite = '套件';
|
||||
$lang->testcase->executionStatus = '执行状态';
|
||||
$lang->testcase->caseType = '用例类型';
|
||||
$lang->testcase->allType = '所有类型';
|
||||
$lang->testcase->showAutoCase = '显示自动化用例';
|
||||
|
||||
$lang->case = $lang->testcase; // 用于DAO检查时使用。因为case是系统关键字,所以无法定义该模块为case,只能使用testcase,但表还是使用的case。
|
||||
|
||||
@@ -250,6 +253,7 @@ $lang->testcase->action->unlinkedfromproject = array('main' => '$date, 由 <st
|
||||
$lang->testcase->action->linked2execution = array('main' => '$date, 由 <strong>$actor</strong> 关联到' . $lang->executionCommon . ' <strong>$extra</strong>。');
|
||||
$lang->testcase->action->unlinkedfromexecution = array('main' => '$date, 由 <strong>$actor</strong> 从' . $lang->executionCommon . ' <strong>$extra</strong> 移除。');
|
||||
|
||||
$lang->testcase->featureBar['browse']['casetype'] = $lang->testcase->caseType;
|
||||
$lang->testcase->featureBar['browse']['all'] = $lang->testcase->allCases;
|
||||
$lang->testcase->featureBar['browse']['wait'] = '待评审';
|
||||
$lang->testcase->featureBar['browse']['needconfirm'] = $lang->testcase->needConfirm;
|
||||
@@ -257,4 +261,5 @@ $lang->testcase->featureBar['browse']['group'] = '分组查看';
|
||||
$lang->testcase->featureBar['browse']['suite'] = '套件';
|
||||
$lang->testcase->featureBar['browse']['zerocase'] = "零用例{$lang->SRCommon}";
|
||||
$lang->testcase->featureBar['browse']['browseunits'] = '单元测试';
|
||||
$lang->testcase->featureBar['browse']['autocase'] = $lang->testcase->showAutoCase;
|
||||
$lang->testcase->featureBar['groupcase'] = $lang->testcase->featureBar['browse'];
|
||||
|
||||
@@ -234,14 +234,15 @@ class testcaseModel extends model
|
||||
* @param int $productID
|
||||
* @param int|string $branch
|
||||
* @param int $moduleIdList
|
||||
* @param string $orderBy
|
||||
* @param object $pager
|
||||
* @param string $browseType
|
||||
* @param string $auto no|unit
|
||||
* @param string $caseType
|
||||
* @param string $orderBy
|
||||
* @param object $pager
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getModuleCases($productID, $branch = 0, $moduleIdList = 0, $orderBy = 'id_desc', $pager = null, $browseType = '', $auto = 'no')
|
||||
public function getModuleCases($productID, $branch = 0, $moduleIdList = 0, $browseType = '', $auto = 'no', $caseType = '', $orderBy = 'id_desc', $pager = null)
|
||||
{
|
||||
$stmt = $this->dao->select('t1.*, t2.title as storyTitle, t2.deleted as storyDeleted')->from(TABLE_CASE)->alias('t1')
|
||||
->leftJoin(TABLE_STORY)->alias('t2')->on('t1.story=t2.id');
|
||||
@@ -255,6 +256,8 @@ class testcaseModel extends model
|
||||
->beginIF($browseType == 'wait')->andWhere('t1.status')->eq($browseType)->fi()
|
||||
->beginIF($auto == 'unit')->andWhere('t1.auto')->eq('unit')->fi()
|
||||
->beginIF($auto != 'unit')->andWhere('t1.auto')->ne('unit')->fi()
|
||||
->beginIF(!$this->cookie->showAutoCase)->andWhere('t1.auto')->ne('auto')->fi()
|
||||
->beginIF($caseType)->andWhere('t1.type')->eq($caseType)->fi()
|
||||
->andWhere('t1.deleted')->eq('0')
|
||||
->orderBy($orderBy)
|
||||
->page($pager)
|
||||
@@ -267,14 +270,15 @@ class testcaseModel extends model
|
||||
* @param int $productID
|
||||
* @param int|string $branch
|
||||
* @param int $moduleIdList
|
||||
* @param string $orderBy
|
||||
* @param object $pager
|
||||
* @param string $browseType
|
||||
* @param string $auto no|unit
|
||||
* @param string $caseType
|
||||
* @param string $orderBy
|
||||
* @param object $pager
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getModuleProjectCases($productID, $branch = 0, $moduleIdList = 0, $orderBy = 'id_desc', $pager = null, $browseType = '', $auto = 'no')
|
||||
public function getModuleProjectCases($productID, $branch = 0, $moduleIdList = 0, $browseType = '', $auto = 'no', $caseType = '', $orderBy = 'id_desc', $pager = null)
|
||||
{
|
||||
$executions = $this->loadModel('execution')->getIdList($this->session->project);
|
||||
array_push($executions, $this->session->project);
|
||||
@@ -290,6 +294,8 @@ class testcaseModel extends model
|
||||
->beginIF($browseType == 'wait')->andWhere('t2.status')->eq($browseType)->fi()
|
||||
->beginIF($auto == 'unit')->andWhere('t2.auto')->eq('unit')->fi()
|
||||
->beginIF($auto != 'unit')->andWhere('t2.auto')->ne('unit')->fi()
|
||||
->beginIF(!$this->cookie->showAutoCase)->andWhere('t2.auto')->ne('auto')->fi()
|
||||
->beginIF($caseType)->andWhere('t2.type')->eq($caseType)->fi()
|
||||
->andWhere('t2.deleted')->eq('0')
|
||||
->orderBy($orderBy)
|
||||
->page($pager, 't1.case')
|
||||
@@ -394,6 +400,35 @@ class testcaseModel extends model
|
||||
->orderBy($orderBy)->page($pager)->fetchAll('id');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get cases by type.
|
||||
*
|
||||
* @param int $productID
|
||||
* @param int|string $branch
|
||||
* @param int $suiteID
|
||||
* @param array $moduleIdList
|
||||
* @param string $orderBy
|
||||
* @param object $pager
|
||||
* @param string $auto no|unit
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getByType($productID, $branch = 0, $type = '', $moduleIdList = 0, $orderBy = 'id_desc', $pager = null, $auto = 'no')
|
||||
{
|
||||
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($this->app->tab == 'project')->andWhere('t1.project')->eq($this->session->project)->fi()
|
||||
->beginIF($type)->andWhere('t1.type')->eq($type)->fi()
|
||||
->beginIF($branch !== 'all')->andWhere('t1.branch')->eq($branch)->fi()
|
||||
->beginIF($moduleIdList)->andWhere('t1.module')->in($moduleIdList)->fi()
|
||||
->beginIF($auto == 'unit')->andWhere('t1.auto')->eq('unit')->fi()
|
||||
->beginIF($auto != 'unit')->andWhere('t1.auto')->ne('unit')->fi()
|
||||
->andWhere('t1.deleted')->eq('0')
|
||||
->orderBy($orderBy)->page($pager)
|
||||
->fetchAll('id');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get case info by ID.
|
||||
*
|
||||
@@ -483,18 +518,20 @@ class testcaseModel extends model
|
||||
* @param string $browseType
|
||||
* @param int $queryID
|
||||
* @param int $moduleID
|
||||
* @param string $caseType
|
||||
* @param string $sort
|
||||
* @param object $pager
|
||||
* @param string $auto no|unit
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getTestCases($productID, $branch, $browseType, $queryID, $moduleID, $sort, $pager, $auto = 'no')
|
||||
public function getTestCases($productID, $branch, $browseType, $queryID, $moduleID, $caseType = '', $sort = 'id_desc', $pager = null, $auto = 'no')
|
||||
{
|
||||
/* Set modules and browse type. */
|
||||
$modules = $moduleID ? $this->loadModel('tree')->getAllChildId($moduleID) : '0';
|
||||
$browseType = ($browseType == 'bymodule' and $this->session->caseBrowseType and $this->session->caseBrowseType != 'bysearch') ? $this->session->caseBrowseType : $browseType;
|
||||
$group = $this->lang->navGroup->testcase;
|
||||
$auto = $this->cookie->showAutoCase ? 'auto' : $auto;
|
||||
|
||||
/* By module or all cases. */
|
||||
$cases = array();
|
||||
@@ -502,11 +539,11 @@ class testcaseModel extends model
|
||||
{
|
||||
if($this->app->tab == 'project')
|
||||
{
|
||||
$cases = $this->getModuleProjectCases($productID, $branch, $modules, $sort, $pager, $browseType, $auto);
|
||||
$cases = $this->getModuleProjectCases($productID, $branch, $modules, $browseType, $auto, $caseType, $sort, $pager);
|
||||
}
|
||||
else
|
||||
{
|
||||
$cases = $this->getModuleCases($productID, $branch, $modules, $sort, $pager, $browseType, $auto);
|
||||
$cases = $this->getModuleCases($productID, $branch, $modules, $browseType, $auto, $caseType, $sort, $pager);
|
||||
}
|
||||
}
|
||||
/* Cases need confirmed. */
|
||||
@@ -524,6 +561,8 @@ class testcaseModel extends model
|
||||
->beginIF($modules)->andWhere('t1.module')->in($modules)->fi()
|
||||
->beginIF($auto != 'unit')->andWhere('t1.auto')->ne('unit')->fi()
|
||||
->beginIF($auto == 'unit')->andWhere('t1.auto')->eq('unit')->fi()
|
||||
->beginIF(!$this->cookie->showAutoCase)->andWhere('t1.auto')->ne('auto')->fi()
|
||||
->beginIF($caseType)->andWhere('t1.type')->eq($caseType)->fi()
|
||||
->orderBy($sort)
|
||||
->page($pager, 't1.id')
|
||||
->fetchAll();
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
.btn-group a.btn-primary {border-right: 1px solid rgba(255,255,255,0.2);}
|
||||
.btn-group button.dropdown-toggle.btn-primary {padding:6px;}
|
||||
.body-modal #mainMenu>.btn-toolbar {width: auto;}
|
||||
#mainMenu .pull-left .checkbox-primary {margin-top: 5px;}
|
||||
</style>
|
||||
<div id='mainMenu' class='clearfix'>
|
||||
<?php if(!($this->app->rawMethod == 'groupcase')):?>
|
||||
@@ -47,6 +48,7 @@
|
||||
<?php
|
||||
if(isset($menuItem->hidden)) continue;
|
||||
$menuType = $menuItem->name;
|
||||
$caseType = isset($caseType) ? $caseType : '';
|
||||
if(!$config->testcase->needReview and empty($config->testcase->forceReview) and $menuType == 'wait') continue;
|
||||
if($hasBrowsePriv and $menuType == 'QUERY' and in_array($browseType, array('all', 'needconfirm', 'bysuite')))
|
||||
{
|
||||
@@ -54,9 +56,50 @@
|
||||
$isBySearch = $browseType == 'bysearch';
|
||||
include '../../common/view/querymenu.html.php';
|
||||
}
|
||||
elseif($hasBrowsePriv and $menuType == 'casetype')
|
||||
{
|
||||
if($this->moduleName == 'testtask' and $this->methodName == 'browseunits') continue;
|
||||
if($this->moduleName == 'story' and $this->methodName == 'zerocase') continue;
|
||||
if($browseType == 'bysuite') continue;
|
||||
|
||||
$lang->testcase->typeList[''] = $lang->testcase->allType;
|
||||
|
||||
$currentTypeName = zget($lang->testcase->typeList, $caseType, '');
|
||||
$currentLable = empty($currentTypeName) ? $lang->testcase->allType : $currentTypeName;
|
||||
if(!isset($param)) $param = 0;
|
||||
|
||||
echo "<div id='byTypeTab' class='btn-group'>";
|
||||
echo html::a('javascript:;', "<span class='text'>{$currentLable}</span>" . " <span class='caret'></span>", '', "class='btn btn-link' data-toggle='dropdown'");
|
||||
echo "<ul class='dropdown-menu' style='max-height:240px; overflow-y:auto'>";
|
||||
|
||||
foreach($lang->testcase->typeList as $type => $typeName)
|
||||
{
|
||||
echo '<li' . ($type == $caseType ? " class='active'" : '') . '>';
|
||||
if(isset($groupBy))
|
||||
{
|
||||
echo html::a($this->createLink('testcase', 'groupCase', "productID=$productID&branch=$branch&groupBy=story&projectID=$projectID&caseType=$type"), $typeName);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
echo html::a($this->createLink('testcase', 'browse', "productID=$productID&branch=$branch&browseType=$browseType¶m=$param&caseType=$type"), $typeName);
|
||||
}
|
||||
echo "</li>";
|
||||
}
|
||||
|
||||
echo '</ul></div>';
|
||||
}
|
||||
elseif($hasBrowsePriv and $menuType == 'autocase')
|
||||
{
|
||||
if($this->moduleName == 'testtask' and $this->methodName == 'browseunits') continue;
|
||||
if($this->moduleName == 'story' and $this->methodName == 'zerocase') continue;
|
||||
if($browseType == 'bysuite' or $browseType == 'bysearch') continue;
|
||||
|
||||
echo html::checkbox('showAutoCase', array('1' => $lang->testcase->showAutoCase), '', $this->cookie->showAutoCase ? 'checked=checked' : '');
|
||||
}
|
||||
elseif($hasBrowsePriv and ($menuType == 'all' or $menuType == 'needconfirm' or $menuType == 'wait'))
|
||||
{
|
||||
echo html::a($this->createLink($currentModule, $currentMethod, $projectParam . "productID=$productID&branch=$branch&browseType=$menuType"), "<span class='text'>{$menuItem->text}</span>", '', "class='btn btn-link' id='{$menuType}Tab' data-app='{$this->app->tab}'");
|
||||
echo html::a($this->createLink($currentModule, $currentMethod, $projectParam . "productID=$productID&branch=$branch&browseType=$menuType¶m=0&caseType=$caseType"), "<span class='text'>{$menuItem->text}</span>", '', "class='btn btn-link' id='{$menuType}Tab' data-app='{$this->app->tab}'");
|
||||
}
|
||||
elseif($hasBrowsePriv and $menuType == 'suite' and $this->app->tab == 'qa')
|
||||
{
|
||||
@@ -66,10 +109,10 @@
|
||||
|
||||
echo "<div id='bysuiteTab' class='btn-group'>";
|
||||
echo html::a('javascript:;', "<span class='text'>{$currentLable}</span>" . " <span class='caret'></span>", '', "class='btn btn-link' data-toggle='dropdown'");
|
||||
echo "<ul class='dropdown-menu' style='max-height:240px; overflow-y:auto'>";
|
||||
|
||||
if(empty($productID) or common::canModify('product', $product))
|
||||
{
|
||||
echo "<ul class='dropdown-menu' style='max-height:240px; overflow-y:auto'>";
|
||||
|
||||
if(empty($suiteList))
|
||||
{
|
||||
echo '<li>';
|
||||
@@ -102,7 +145,7 @@
|
||||
$projectID = $isProjectApp ? $this->session->project : 0;
|
||||
echo html::a($this->createLink('story', 'zeroCase', "productID=$productID&branch=$branch&orderBy=id_desc&projectID=$projectID"), "<span class='text'>{$lang->story->zeroCase}</span>", '', "class='btn btn-link' id='zerocaseTab' data-app='{$this->app->tab}'");
|
||||
}
|
||||
elseif($hasUnitPriv and $menuType == 'browseunits')
|
||||
elseif($hasUnitPriv and $menuType == 'browseunits' and !$caseType)
|
||||
{
|
||||
echo html::a($this->createLink('testtask', 'browseUnits', "productID=$productID&browseType=newest&orderBy=id_desc&recTotal=0&recPerPage=20&pageID=1&projectID=$projectID"), "<span class='text'>{$lang->testcase->browseUnits}</span>", '', "class='btn btn-link' id='browseunitsTab' data-app='{$this->app->tab}'");
|
||||
}
|
||||
|
||||
@@ -94,19 +94,20 @@ class testcaseTest
|
||||
/**
|
||||
* Test get cases of a module.
|
||||
*
|
||||
* @param int $productID
|
||||
* @param int $branch
|
||||
* @param int $moduleIdList
|
||||
* @param string $orderBy
|
||||
* @param object $pager
|
||||
* @param int $productID
|
||||
* @param int $branch
|
||||
* @param int $moduleIdList
|
||||
* @param string $browseType
|
||||
* @param string $auto
|
||||
* @param string $caseType
|
||||
* @param string $orderBy
|
||||
* @param object $pager
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getModuleCasesTest($productID, $branch = 0, $moduleIdList = 0, $orderBy = 'id_desc', $pager = null, $browseType = '', $auto = 'no')
|
||||
public function getModuleCasesTest($productID, $branch = 0, $moduleIdList = 0, $browseType = '', $auto = 'no', $caseType = '', $orderBy = 'id_desc', $pager = null)
|
||||
{
|
||||
$objects = $this->objectModel->getModuleCases($productID, $branch, $moduleIdList, $orderBy, $pager, $browseType, $auto);
|
||||
$objects = $this->objectModel->getModuleCases($productID, $branch, $moduleIdList, $browseType, $auto, $caseType, $orderBy, $pager);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
@@ -116,19 +117,20 @@ class testcaseTest
|
||||
/**
|
||||
* Test get project cases of a module.
|
||||
*
|
||||
* @param int $productID
|
||||
* @param int $branch
|
||||
* @param int $moduleIdList
|
||||
* @param string $orderBy
|
||||
* @param object $pager
|
||||
* @param int $productID
|
||||
* @param int $branch
|
||||
* @param int $moduleIdList
|
||||
* @param string $browseType
|
||||
* @param string $auto
|
||||
* @param string $caseType
|
||||
* @param string $orderBy
|
||||
* @param object $pager
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getModuleProjectCasesTest($productID, $branch = 0, $moduleIdList = 0, $orderBy = 'id_desc', $pager = null, $browseType = '', $auto = 'no')
|
||||
public function getModuleProjectCasesTest($productID, $branch = 0, $moduleIdList = 0, $browseType = '', $auto = 'no', $caseType = '', $orderBy = 'id_desc', $pager = null)
|
||||
{
|
||||
$objects = $this->objectModel->getModuleProjectCases($productID, $branch, $moduleIdList, $orderBy, $pager, $browseType, $auto);
|
||||
$objects = $this->objectModel->getModuleProjectCases($productID, $branch, $moduleIdList, $browseType, $auto, $caseType, $orderBy, $pager);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
@@ -221,7 +223,7 @@ class testcaseTest
|
||||
*/
|
||||
public function getTestCasesTest($productID, $browseType, $queryID, $auto = 'no')
|
||||
{
|
||||
$objects = $this->objectModel->getTestCases($productID, 0, $browseType, $queryID, $moduleID, 'id_desc', null, $auto);
|
||||
$objects = $this->objectModel->getTestCases($productID, 0, $browseType, $queryID, $moduleID, '', 'id_desc', null, $auto);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user