* Adjust the cases of all products.

This commit is contained in:
hufangzhou
2021-03-24 14:14:08 +08:00
parent fbde724d27
commit e361864ea5
9 changed files with 46 additions and 35 deletions
+8 -8
View File
@@ -143,7 +143,7 @@ class testcaseModel extends model
$data[$i] = new stdclass();
$data[$i]->product = $productID;
if($this->config->systemMode == 'new' && $this->lang->navGroup->testcase == 'project') $data[$i]->project = $this->session->project;
if($this->config->systemMode == 'new' && $this->app->openApp == 'project') $data[$i]->project = $this->session->project;
$data[$i]->branch = $cases->branch[$i];
$data[$i]->module = $cases->module[$i];
$data[$i]->type = $cases->type[$i];
@@ -224,7 +224,7 @@ class testcaseModel extends model
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->lang->navGroup->testcase != 'qa')->andWhere('t1.project')->eq($this->session->project)->fi()
->beginIF($this->app->openApp = 'project')->andWhere('t1.project')->eq($this->session->project)->fi()
->beginIF($branch)->andWhere('t1.branch')->eq($branch)->fi()
->beginIF($moduleIdList)->andWhere('t1.module')->in($moduleIdList)->fi()
->beginIF($browseType == 'wait')->andWhere('t1.status')->eq($browseType)->fi()
@@ -330,7 +330,7 @@ class testcaseModel extends model
->leftJoin(TABLE_STORY)->alias('t2')->on('t1.story=t2.id')
->leftJoin(TABLE_SUITECASE)->alias('t3')->on('t1.id=t3.case')
->where('t1.product')->eq((int)$productID)
->beginIF($this->lang->navGroup->testcase != 'qa')->andWhere('t1.project')->eq($this->session->project)->fi()
->beginIF($this->app->openApp == 'project')->andWhere('t1.project')->eq($this->session->project)->fi()
->andWhere('t3.suite')->eq((int)$suiteID)
->beginIF($branch)->andWhere('t1.branch')->eq($branch)->fi()
->beginIF($moduleIdList)->andWhere('t1.module')->in($moduleIdList)->fi()
@@ -1201,7 +1201,7 @@ class testcaseModel extends model
}
else
{
if($this->config->systemMode == 'new' && $this->lang->navGroup->testcase != 'qa') $caseData->project = $this->session->project;
if($this->config->systemMode == 'new' && $this->app->openApp == 'project') $caseData->project = $this->session->project;
$caseData->version = 1;
$caseData->openedBy = $this->app->user->account;
$caseData->openedDate = $now;
@@ -1317,12 +1317,12 @@ class testcaseModel extends model
}
/* If under the project module, the cases is imported need linking to the project. */
if($this->lang->navGroup->testcase != 'qa')
if($this->app->openApp == 'project')
{
$lastOrder = (int)$this->dao->select('*')->from(TABLE_PROJECTCASE)->where('project')->eq($this->session->project)->orderBy('order_desc')->limit(1)->fetch('order');
$this->dao->insert(TABLE_PROJECTCASE)
->set('project')->eq($case->project)
->set('project')->eq($this->session->project)
->set('product')->eq($case->product)
->set('case')->eq($caseID)
->set('version')->eq($case->version)
@@ -1358,8 +1358,8 @@ class testcaseModel extends model
*/
public function buildSearchForm($productID, $products, $queryID, $actionURL)
{
$product = ($this->app->openApp == 'project' and empty($productID)) ? $products : array($productID => $products[$productID]);
$this->config->testcase->search['params']['product']['values'] = $product + array('all' => $this->lang->testcase->allProduct);
$product = ($this->app->openApp == 'project' and empty($productID)) ? $products : array($productID => $products[$productID]) + array('all' => $this->lang->testcase->allProduct);
$this->config->testcase->search['params']['product']['values'] = $product;
$module = $this->loadModel('tree')->getOptionMenu($productID, 'case', 0);
if(!$productID)