Merge branch 'master' into 'sprint/master_zhouxudong_17994'

# Conflicts:
#   module/bug/model.php
#   module/task/model.php
This commit is contained in:
王怡栋
2022-04-13 07:52:03 +00:00
343 changed files with 7321 additions and 1434 deletions
+8 -1
View File
@@ -1085,7 +1085,14 @@ class testtask extends control
$response['result'] = 'success';
$response['message'] = '';
$testRun = $this->dao->select('task,`case`')->from(TABLE_TESTRUN)->where('id')->eq((int)$rowID)->fetch();
$testRun = $this->dao->select('t1.task,t1.`case`,t2.story')->from(TABLE_TESTRUN)->alias('t1')
->leftJoin(TABLE_CASE)->alias('t2')->on('t1.case=t2.id')
->where('t1.id')->eq((int)$rowID)
->fetch();
$linkedProject = $this->dao->select('project')->from(TABLE_PROJECTSTORY)->where('story')->eq($testRun->story)->fetchPairs('project');
$this->dao->delete()->from(TABLE_PROJECTCASE)->where('`case`')->eq($testRun->case)->andWhere('project')->notin($linkedProject)->exec();
$this->dao->delete()->from(TABLE_TESTRUN)->where('id')->eq((int)$rowID)->exec();
if(dao::isError())
{
+1 -1
View File
@@ -67,7 +67,7 @@ function createBug(obj)
}
else
{
window.open(link, '_parent');
window.open(link, '_blank');
}
config.onlybody = onlybody;
+19 -3
View File
@@ -883,18 +883,18 @@ class testtaskModel extends model
/* When the cases linked the testtask, the cases link to the project. */
if($this->app->tab != 'qa')
{
$projectID = $this->app->tab == 'project' ? $this->session->project : $this->session->execution;
$lastOrder = (int)$this->dao->select('*')->from(TABLE_PROJECTCASE)->where('project')->eq($projectID)->orderBy('order_desc')->limit(1)->fetch('order');
$project = $this->app->tab == 'project' ? $this->session->project : $this->session->execution;
$data = new stdclass();
$data->project = $project;
$data->project = $projectID;
$data->product = $this->session->product;
$data->case = $caseID;
$data->version = 1;
$data->order = ++ $lastOrder;
$this->dao->replace(TABLE_PROJECTCASE)->data($data)->exec();
$this->loadModel('action')->create('case', $caseID, 'linked2testtask', '', $taskID);
}
$this->loadModel('action')->create('case', $caseID, 'linked2testtask', '', $taskID);
}
}
@@ -1076,6 +1076,22 @@ class testtaskModel extends model
return $testRun;
}
/**
* Get testtasks by case id list.
*
* @param string|array $caseIDList
* @access public
* @return array
*/
public function getGroupByCases($caseIDList)
{
return $this->dao->select('t1.case, t2.*, t3.branch')->from(TABLE_TESTRUN)->alias('t1')
->leftJoin(TABLE_TESTTASK)->alias('t2')->on('t1.task=t2.id')
->leftJoin(TABLE_BUILD)->alias('t3')->on('t2.build = t3.id')
->where('t1.case')->in($caseIDList)
->fetchGroup('case', 'id');
}
/**
* Create test result
*