* Finish task #71585,#71586,#71587.

This commit is contained in:
daitingting
2022-10-10 05:46:31 +00:00
parent c2289a381c
commit f8259297b7
9 changed files with 51 additions and 26 deletions
+12 -5
View File
@@ -230,10 +230,12 @@ class testtask extends control
return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $link));
}
$this->loadModel('project');
/* Set menu. */
if($this->app->tab == 'project')
{
$this->loadModel('project')->setMenu($projectID);
$this->project->setMenu($projectID);
}
elseif($this->app->tab == 'execution')
{
@@ -246,7 +248,7 @@ class testtask extends control
/* Create testtask from testtask of test.*/
$productID = $productID ? $productID : key($this->products);
$executions = empty($productID) ? array() : $this->loadModel('product')->getExecutionPairsByProduct($productID, '', 'id_desc', $projectID);
$executions = empty($productID) ? array() : $this->loadModel('product')->getExecutionPairsByProduct($productID, '', 'id_desc', $projectID, 'multiple');
$builds = empty($productID) ? array() : $this->loadModel('build')->getBuildPairs($productID, 'all', 'notrunk');
$execution = $this->loadModel('execution')->getByID($executionID);
@@ -255,12 +257,14 @@ class testtask extends control
/* Set menu. */
$productID = $this->product->saveState($productID, $this->products);
$project = $this->project->getByID($projectID);
if($project && !$project->multiple) $this->view->noMultipleExecutionID = $this->loadModel('execution')->getNoMultipleID($project->id);
$this->view->title = $this->products[$productID] . $this->lang->colon . $this->lang->testtask->create;
$this->view->position[] = html::a($this->createLink('testtask', 'browse', "productID=$productID"), $this->products[$productID]);
$this->view->position[] = $this->lang->testtask->common;
$this->view->position[] = $this->lang->testtask->create;
$this->view->productID = $productID;
$this->view->product = $this->product->getByID($productID);
$this->view->projectID = $projectID;
$this->view->executionID = $executionID;
@@ -774,10 +778,12 @@ class testtask extends control
return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $link));
}
$this->loadModel('project');
/* Set menu. */
if($this->app->tab == 'project')
{
$this->loadModel('project')->setMenu($task->project);
$this->project->setMenu($task->project);
}
elseif($this->app->tab == 'execution')
{
@@ -797,7 +803,7 @@ class testtask extends control
/* Create testtask from testtask of test.*/
$productID = $productID ? $productID : key($this->products);
$projectID = $this->lang->navGroup->testtask == 'qa' ? 0 : $this->session->project;
$executions = empty($productID) ? array() : $this->product->getExecutionPairsByProduct($productID, 0, 'id_desc', $projectID);
$executions = empty($productID) ? array() : $this->product->getExecutionPairsByProduct($productID, 0, 'id_desc', $projectID, 'multiple');
$executionID = $task->execution;
if($executionID)
{
@@ -815,6 +821,7 @@ class testtask extends control
$this->view->title = $this->products[$productID] . $this->lang->colon . $this->lang->testtask->edit;
$this->view->task = $task;
$this->view->project = $this->project->getByID($projectID);
$this->view->executions = $executions;
$this->view->builds = empty($productID) ? array() : $this->loadModel('build')->getBuildPairs($productID, 'all', 'noempty,notrunk', $executionID, 'execution');
$this->view->testreports = $this->loadModel('testreport')->getPairs($task->product, $task->testreport);