* Finish a task #45544.

This commit is contained in:
mayue
2021-12-14 09:49:46 +08:00
parent 99e725ef37
commit 77d36b7467
12 changed files with 81 additions and 148 deletions
+14 -14
View File
@@ -215,7 +215,7 @@ class bug extends control
$this->view->product = $product;
$this->view->projectProducts = $this->product->getProducts($this->projectID);
$this->view->productName = $productName;
$this->view->builds = $this->loadModel('build')->getProductBuildPairs($productID);
$this->view->builds = $this->loadModel('build')->getBuildPairs($productID);
$this->view->modules = $this->tree->getOptionMenu($productID, $viewType = 'bug', $startModuleID = 0, $branch);
$this->view->moduleTree = $moduleTree;
$this->view->moduleName = $moduleID ? $this->tree->getById($moduleID)->name : $this->lang->tree->all;
@@ -518,13 +518,13 @@ class bug extends control
/* If executionID is setted, get builds and stories of this execution. */
if($executionID)
{
$builds = $this->loadModel('build')->getExecutionBuildPairs($executionID, $productID, $branch, 'noempty,noterminate,nodone');
$builds = $this->loadModel('build')->getBuildPairs($productID, $branch, 'noempty,noterminate,nodone', $executionID, 'execution');
$stories = $this->story->getExecutionStoryPairs($executionID);
if(!$projectID) $projectID = $this->dao->select('project')->from(TABLE_EXECUTION)->where('id')->eq($executionID)->fetch('project');
}
else
{
$builds = $this->loadModel('build')->getProductBuildPairs($productID, $branch, 'noempty,noterminate,nodone');
$builds = $this->loadModel('build')->getBuildPairs($productID, $branch, 'noempty,noterminate,nodone,withbranch');
$stories = $this->story->getProductStoryPairs($productID, $branch);
}
@@ -683,12 +683,12 @@ class bug extends control
/* If executionID is setted, get builds and stories of this execution. */
if($executionID)
{
$builds = $this->loadModel('build')->getExecutionBuildPairs($executionID, $productID, $branch, 'noempty');
$builds = $this->loadModel('build')->getBuildPairs($productID, $branch, 'noempty', $executionID, 'execution');
$stories = $this->story->getExecutionStoryPairs($executionID);
}
else
{
$builds = $this->loadModel('build')->getProductBuildPairs($productID, $branch, 'noempty');
$builds = $this->loadModel('build')->getBuildPairs($productID, $branch, 'noempty');
$stories = $this->story->getProductStoryPairs($productID, $branch);
}
@@ -815,7 +815,7 @@ class bug extends control
$this->view->branchName = $product->type == 'normal' ? '' : zget($branches, $bug->branch, '');
$this->view->users = $this->user->getPairs('noletter');
$this->view->actions = $this->action->getList('bug', $bugID);
$this->view->builds = $this->loadModel('build')->getProductBuildPairs($productID, 'all', '');
$this->view->builds = $this->loadModel('build')->getBuildPairs($productID, 'all', '');
$this->view->preAndNext = $this->loadModel('common')->getPreAndNextObject('bug', $bugID);
$this->view->product = $product;
@@ -925,18 +925,18 @@ class bug extends control
/* Assign. */
$product = $this->loadModel('product')->getByID($productID);
$allBuilds = $this->loadModel('build')->getProductBuildPairs($productID, 'all', 'noempty');
$allBuilds = $this->loadModel('build')->getBuildPairs($productID, 'all', 'noempty');
if($executionID)
{
$openedBuilds = $this->build->getExecutionBuildPairs($executionID, $productID, $bug->branch, 'noempty,noterminate,nodone');
$openedBuilds = $this->build->getBuildPairs($productID, $bug->branch, 'noempty,noterminate,nodone,withbranch', $executionID, 'execution');
}
elseif($projectID)
{
$openedBuilds = $this->build->getProjectBuildPairs($projectID, $productID, $bug->branch, 'noempty,noterminate,nodone');
$openedBuilds = $this->build->getBuildPairs($productID, $bug->branch, 'noempty,noterminate,nodone,withbranch', $projectID, 'project');
}
else
{
$openedBuilds = $this->build->getProductBuildPairs($productID, $bug->branch, 'noempty,noterminate,nodone');
$openedBuilds = $this->build->getBuildPairs($productID, $bug->branch, 'noempty,noterminate,nodone,withbranch');
}
/* Set the openedBuilds list. */
@@ -1436,7 +1436,7 @@ class bug extends control
$this->view->users = $users;
$this->view->assignedTo = $assignedTo;
$this->view->executions = $this->loadModel('product')->getExecutionPairsByProduct($productID, $bug->branch ? "0,{$bug->branch}" : 0, 'id_desc', $projectID);
$this->view->builds = $this->loadModel('build')->getProductBuildPairs($productID, $branch = $bug->branch, 'all');
$this->view->builds = $this->loadModel('build')->getBuildPairs($productID, 'all', 'withbranch');
$this->view->actions = $this->action->getList('bug', $bugID);
$this->display();
}
@@ -1503,7 +1503,7 @@ class bug extends control
$this->view->bug = $bug;
$this->view->users = $this->user->getPairs('nodeleted', $bug->resolvedBy);
$this->view->builds = $this->loadModel('build')->getProductBuildPairs($productID, $bug->branch, 'noempty');
$this->view->builds = $this->loadModel('build')->getBuildPairs($productID, $bug->branch, 'noempty');
$this->view->actions = $this->action->getList('bug', $bugID);
$this->display();
@@ -1656,7 +1656,7 @@ class bug extends control
$this->view->bugs = $bugs;
$this->view->users = $this->user->getPairs();
$this->view->builds = $this->loadModel('build')->getProductBuildPairs($productID, $branch, 'noempty');
$this->view->builds = $this->loadModel('build')->getBuildPairs($productID, $branch, 'noempty');
$this->display();
}
@@ -2044,7 +2044,7 @@ class bug extends control
public function ajaxGetBugFieldOptions($productID, $executionID = 0)
{
$modules = $this->loadModel('tree')->getOptionMenu($productID, 'bug');
$builds = $this->loadModel('build')->getExecutionBuildPairs($executionID, $productID);
$builds = $this->loadModel('build')->getBuildPairs($productID, 'all', '', $executionID, 'execution');
$type = $this->lang->bug->typeList;
$pri = $this->lang->bug->priList;
$severity = $this->lang->bug->severityList;