From 99e725ef37aed410877e9d1ff4e05c4d43488890 Mon Sep 17 00:00:00 2001 From: mayue Date: Wed, 8 Dec 2021 13:25:50 +0800 Subject: [PATCH] * Finish task #45544. --- module/bug/control.php | 2 +- module/build/control.php | 2 +- module/build/model.php | 2 +- module/mr/control.php | 4 ++-- module/productplan/control.php | 4 ++-- module/projectrelease/control.php | 8 ++++---- module/release/control.php | 2 +- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/module/bug/control.php b/module/bug/control.php index 0beba6c819..513222a7a1 100644 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -925,7 +925,7 @@ class bug extends control /* Assign. */ $product = $this->loadModel('product')->getByID($productID); - $allBuilds = $this->loadModel('build')->getProductBuildPairs($productID, $branch = 0, 'noempty'); + $allBuilds = $this->loadModel('build')->getProductBuildPairs($productID, 'all', 'noempty'); if($executionID) { $openedBuilds = $this->build->getExecutionBuildPairs($executionID, $productID, $bug->branch, 'noempty,noterminate,nodone'); diff --git a/module/build/control.php b/module/build/control.php index 707bedd53f..dbb91e1393 100644 --- a/module/build/control.php +++ b/module/build/control.php @@ -651,7 +651,7 @@ class build extends control $this->config->bug->search['params']['plan']['values'] = $this->loadModel('productplan')->getPairsForStory($build->product, $build->branch, 'skipParent'); $this->config->bug->search['params']['module']['values'] = $this->loadModel('tree')->getOptionMenu($build->product, 'bug', 0, $build->branch); $this->config->bug->search['params']['execution']['values'] = $this->loadModel('product')->getExecutionPairsByProduct($build->product, $build->branch, 'id_desc', $this->session->project); - $this->config->bug->search['params']['openedBuild']['values'] = $this->build->getProductBuildPairs($build->product, $branch = 0, $params = ''); + $this->config->bug->search['params']['openedBuild']['values'] = $this->build->getProductBuildPairs($build->product, $branch = 'all', $params = ''); $this->config->bug->search['params']['resolvedBuild']['values'] = $this->config->bug->search['params']['openedBuild']['values']; unset($this->config->bug->search['fields']['product']); diff --git a/module/build/model.php b/module/build/model.php index fe46c08ec1..6b7f129dd3 100644 --- a/module/build/model.php +++ b/module/build/model.php @@ -280,7 +280,7 @@ class buildModel extends model ->leftJoin(TABLE_RELEASE)->alias('t3')->on('t1.id = t3.build') ->leftJoin(TABLE_BRANCH)->alias('t4')->on('t1.branch = t4.id') ->where('t1.product')->in($products) - ->beginIF($branch !== 'all')->andWhere('t1.branch')->eq($branch)->fi() + ->beginIF($branch !== 'all')->andWhere('t1.branch')->in($branch)->fi() ->andWhere('t1.deleted')->eq(0) ->orderBy('t1.date desc, t1.id desc')->fetchAll('id'); diff --git a/module/mr/control.php b/module/mr/control.php index aba3903a58..46c79badd0 100644 --- a/module/mr/control.php +++ b/module/mr/control.php @@ -599,8 +599,8 @@ class mr extends control $this->config->bug->search['params']['plan']['values'] = $this->loadModel('productplan')->getForProducts(array($productID => $productID)); $this->config->bug->search['params']['module']['values'] = $modules; $this->config->bug->search['params']['execution']['values'] = $this->product->getExecutionPairsByProduct($productID); - $this->config->bug->search['params']['openedBuild']['values'] = $this->loadModel('build')->getProductBuildPairs($productID, $branch = 0, $params = ''); - $this->config->bug->search['params']['resolvedBuild']['values'] = $this->loadModel('build')->getProductBuildPairs($productID, $branch = 0, $params = ''); + $this->config->bug->search['params']['openedBuild']['values'] = $this->loadModel('build')->getProductBuildPairs($productID, $branch = 'all', $params = ''); + $this->config->bug->search['params']['resolvedBuild']['values'] = $this->loadModel('build')->getProductBuildPairs($productID, $branch = 'all', $params = ''); unset($this->config->bug->search['fields']['product']); if($product->type == 'normal') diff --git a/module/productplan/control.php b/module/productplan/control.php index dd6e49e9a9..643b2d6ed3 100644 --- a/module/productplan/control.php +++ b/module/productplan/control.php @@ -562,8 +562,8 @@ class productplan extends control $this->config->bug->search['style'] = 'simple'; $this->config->bug->search['params']['plan']['values'] = $this->productplan->getPairsForStory($productID, $plan->branch, 'skipParent|withMainPlan'); $this->config->bug->search['params']['execution']['values'] = $this->loadModel('product')->getExecutionPairsByProduct($plan->product, $plan->branch); - $this->config->bug->search['params']['openedBuild']['values'] = $this->loadModel('build')->getProductBuildPairs($productID, $branch = 0, $params = ''); - $this->config->bug->search['params']['resolvedBuild']['values'] = $this->build->getProductBuildPairs($productID, $branch = 0, $params = ''); + $this->config->bug->search['params']['openedBuild']['values'] = $this->loadModel('build')->getProductBuildPairs($productID, $branch = 'all', $params = ''); + $this->config->bug->search['params']['resolvedBuild']['values'] = $this->build->getProductBuildPairs($productID, $branch = 'all', $params = ''); $this->config->bug->search['params']['module']['values'] = $this->loadModel('tree')->getOptionMenu($plan->product, 'bug', 0, $plan->branch); if($this->config->systemMode == 'new') $this->config->bug->search['params']['project']['values'] = $this->product->getProjectPairsByProduct($productID, $plan->branch); diff --git a/module/projectrelease/control.php b/module/projectrelease/control.php index fcf5fa2bdc..d0f750b38f 100644 --- a/module/projectrelease/control.php +++ b/module/projectrelease/control.php @@ -116,15 +116,15 @@ class projectrelease extends control return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('view', "releaseID=$releaseID"))); } + $this->project->setMenu($projectID); + $this->commonAction($projectID); + /* Get the builds that can select. */ - $builds = $this->build->getProjectBuildPairs($projectID, 0, 0, 'notrunk|withbranch'); + $builds = $this->build->getProjectBuildPairs($projectID, key($this->products), 0, 'notrunk|withbranch'); $releasedBuilds = $this->projectrelease->getReleasedBuilds($projectID); foreach($releasedBuilds as $build) unset($builds[$build]); unset($builds['trunk']); - $this->project->setMenu($projectID); - $this->commonAction($projectID); - $this->view->title = $this->view->project->name . $this->lang->colon . $this->lang->release->create; $this->view->position[] = $this->lang->release->create; $this->view->builds = $builds; diff --git a/module/release/control.php b/module/release/control.php index 31f41e3b1f..f2c6bbfc34 100644 --- a/module/release/control.php +++ b/module/release/control.php @@ -568,7 +568,7 @@ class release extends control $this->config->bug->search['style'] = 'simple'; $this->config->bug->search['params']['plan']['values'] = $this->loadModel('productplan')->getPairsForStory($release->product, $release->branch, 'skipParent|withMainPlan'); $this->config->bug->search['params']['execution']['values'] = $this->loadModel('product')->getExecutionPairsByProduct($release->product, $release->branch); - $this->config->bug->search['params']['openedBuild']['values'] = $this->loadModel('build')->getProductBuildPairs($release->product, $branch = 0, $params = ''); + $this->config->bug->search['params']['openedBuild']['values'] = $this->loadModel('build')->getProductBuildPairs($release->product, $branch = 'all', $params = ''); $this->config->bug->search['params']['resolvedBuild']['values'] = $this->config->bug->search['params']['openedBuild']['values']; $this->config->bug->search['params']['module']['values'] = $this->loadModel('tree')->getOptionMenu($release->product, 'bug', 0, $release->branch); if($this->session->currentProductType == 'normal')