* Finish task #59482.

This commit is contained in:
liumengyi
2022-07-06 16:18:44 +08:00
parent ada3b47db7
commit 73fe07dd49
4 changed files with 161 additions and 93 deletions
+25 -4
View File
@@ -1043,6 +1043,7 @@ class execution extends control
*
* @param int $executionID
* @param string $type
* @param int $moduleID
* @param string $orderBy
* @param int $recTotal
* @param int $recPerPage
@@ -1050,28 +1051,44 @@ class execution extends control
* @access public
* @return void
*/
public function testcase($executionID = 0, $type = 'all', $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
public function testcase($executionID = 0, $productID = 0, $type = 'all', $moduleID = 0, $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
{
$this->loadModel('testcase');
$this->loadModel('testtask');
$this->loadModel('tree');
$this->commonAction($executionID);
$uri = $this->app->getURI(true);
$this->session->set('caseList', $uri, 'execution');
$this->session->set('bugList', $uri, 'execution');
$products = $this->product->getProducts($executionID);
$productID = key($products); // Get the first product for creating testcase.
$products = array('0' => $this->lang->product->all) + $this->product->getProducts($executionID, 'all', '', false);
$extra = $executionID;
$this->lang->modulePageNav = $this->product->select($products, $productID, 'execution', 'testcase', $extra, 0, 0, '', false);
/* Load pager. */
$this->app->loadClass('pager', $static = true);
$pager = pager::init($recTotal, $recPerPage, $pageID);
$cases = $this->loadModel('testcase')->getExecutionCases($executionID, $orderBy, $pager, $type);
$cases = $this->loadModel('testcase')->getExecutionCases($executionID, $productID, $moduleID, $orderBy, $pager, $type);
$this->loadModel('common')->saveQueryCondition($this->dao->get(), 'testcase', false);
$cases = $this->testcase->appendData($cases, 'case');
$cases = $this->loadModel('story')->checkNeedConfirm($cases);
$modules = $this->tree->getAllModulePairs('case');
/* Get module tree.*/
if($executionID and empty($productID))
{
$moduleTree = $this->tree->getCaseTreeMenu($executionID, $productID, 0, array('treeModel', 'createCaseLink'));
}
else
{
$moduleTree = $this->tree->getTreeMenu($productID, 'case', 0, array('treeModel', 'createCaseLink'), array('executionID' => $executionID, 'productID' => $productID), 'all');
}
$tree = $moduleID ? $this->tree->getByID($moduleID) : '';
$this->view->title = $this->lang->execution->testcase;
$this->view->executionID = $executionID;
$this->view->productID = $productID;
@@ -1081,6 +1098,10 @@ class execution extends control
$this->view->type = $type;
$this->view->users = $this->loadModel('user')->getPairs('noletter');
$this->view->execution = $this->execution->getByID($executionID);
$this->view->moduleTree = $moduleTree;
$this->view->modules = $modules;
$this->view->moduleID = $moduleID;
$this->view->moduleName = $moduleID ? $tree->name : $this->lang->tree->all;
$this->display();
}