From 2f28d73c47b733e34e3061abf56b6caaaf7326c2 Mon Sep 17 00:00:00 2001 From: chenfeiCF Date: Fri, 13 Nov 2015 10:54:14 +0800 Subject: [PATCH] * finish task #2400. --- module/bug/control.php | 6 +++--- module/bug/model.php | 2 +- module/build/control.php | 2 +- module/build/model.php | 2 +- module/productplan/control.php | 4 ++-- module/release/control.php | 2 +- module/testtask/control.php | 4 ++-- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/module/bug/control.php b/module/bug/control.php index 056e4bc4ac..12efcf63d0 100644 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -122,7 +122,7 @@ class bug extends control $this->config->bug->search['params']['plan']['values'] = $this->loadModel('productplan')->getPairs($productID); $this->config->bug->search['params']['module']['values'] = $this->tree->getOptionMenu($productID, $viewType = 'bug', $startModuleID = 0); $this->config->bug->search['params']['project']['values'] = $this->product->getProjectPairs($productID); - $this->config->bug->search['params']['openedBuild']['values'] = $this->loadModel('build')->getProductBuildPairs($productID); + $this->config->bug->search['params']['openedBuild']['values'] = $this->loadModel('build')->getProductBuildPairs($productID, $branch = 0, $params = ''); $this->config->bug->search['params']['resolvedBuild']['values'] = $this->config->bug->search['params']['openedBuild']['values']; if($this->session->currentProductType == 'normal') { @@ -141,7 +141,7 @@ class bug extends control /* Process the openedBuild and resolvedBuild fields. */ $productIdList = array(); foreach($bugs as $bug) $productIdList[$bug->id] = $bug->product; - $builds = $this->loadModel('build')->getProductBuildPairs(array_unique($productIdList)); + $builds = $this->loadModel('build')->getProductBuildPairs(array_unique($productIdList), $branch = 0, $params = ''); foreach($bugs as $key => $bug) { $openBuildIdList = explode(',', $bug->openedBuild); @@ -487,7 +487,7 @@ class bug extends control $this->view->branchName = $this->session->currentProductType == 'normal' ? '' : $this->loadModel('branch')->getById($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); + $this->view->builds = $this->loadModel('build')->getProductBuildPairs($productID, $branch = 0, $params = ''); $this->view->preAndNext = $this->loadModel('common')->getPreAndNextObject('bug', $bugID); $this->display(); diff --git a/module/bug/model.php b/module/bug/model.php index ff027eb114..5552f10970 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -1048,7 +1048,7 @@ class bugModel extends model { $datas = $this->dao->select('openedBuild as name, count(openedBuild) as value')->from(TABLE_BUG)->where($this->reportCondition())->groupBy('openedBuild')->orderBy('value DESC')->fetchAll('name'); if(!$datas) return array(); - $builds = $this->loadModel('build')->getProductBuildPairs($this->session->product); + $builds = $this->loadModel('build')->getProductBuildPairs($this->session->product, $branch = 0, $params = ''); /* Deal with the situation that a bug maybe associate more than one openedBuild. */ foreach($datas as $buildIDList => $data) diff --git a/module/build/control.php b/module/build/control.php index 1cb38fef88..2f77ff4eee 100644 --- a/module/build/control.php +++ b/module/build/control.php @@ -415,7 +415,7 @@ class build extends control $this->config->bug->search['params']['plan']['values'] = $this->loadModel('productplan')->getForProducts(array($build->product => $build->product)); $this->config->bug->search['params']['module']['values'] = $this->loadModel('tree')->getOptionMenu($build->product, $viewType = 'bug', $startModuleID = 0); $this->config->bug->search['params']['project']['values'] = $this->loadModel('product')->getProjectPairs($build->product); - $this->config->bug->search['params']['openedBuild']['values'] = $this->build->getProductBuildPairs($build->product); + $this->config->bug->search['params']['openedBuild']['values'] = $this->build->getProductBuildPairs($build->product, $branch = 0, $params = ''); $this->config->bug->search['params']['resolvedBuild']['values'] = $this->config->bug->search['params']['openedBuild']['values']; unset($this->config->bug->search['fields']['branch']); unset($this->config->bug->search['params']['branch']); diff --git a/module/build/model.php b/module/build/model.php index 61808f84fe..0acaced72d 100644 --- a/module/build/model.php +++ b/module/build/model.php @@ -107,7 +107,7 @@ class buildModel extends model * @access public * @return string */ - public function getProductBuildPairs($products, $branch = 0, $params = '', $replace = true) + public function getProductBuildPairs($products, $branch = 0, $params = 'noterminate, nodone', $replace = true) { $sysBuilds = array(); if(strpos($params, 'noempty') === false) $sysBuilds = array('' => ''); diff --git a/module/productplan/control.php b/module/productplan/control.php index 0067b22dbb..c17771e7ac 100644 --- a/module/productplan/control.php +++ b/module/productplan/control.php @@ -395,8 +395,8 @@ class productplan extends control $this->config->bug->search['params']['plan']['values'] = $this->productplan->getForProducts(array($plan->product => $plan->product)); $this->config->bug->search['params']['module']['values'] = $this->loadModel('tree')->getOptionMenu($productID, $viewType = 'bug', $startModuleID = 0); $this->config->bug->search['params']['project']['values'] = $this->product->getProjectPairs($productID); - $this->config->bug->search['params']['openedBuild']['values'] = $this->loadModel('build')->getProductBuildPairs($productID); - $this->config->bug->search['params']['resolvedBuild']['values'] = $this->build->getProductBuildPairs($productID); + $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->loadModel('search')->setSearchParams($this->config->bug->search); if($browseType == 'bySearch') diff --git a/module/release/control.php b/module/release/control.php index 7a8b96e6b2..0ce046541f 100644 --- a/module/release/control.php +++ b/module/release/control.php @@ -444,7 +444,7 @@ class release extends control $this->config->bug->search['params']['plan']['values'] = $this->loadModel('productplan')->getForProducts(array($release->product => $release->product)); $this->config->bug->search['params']['module']['values'] = $this->loadModel('tree')->getOptionMenu($release->product, $viewType = 'bug', $startModuleID = 0); $this->config->bug->search['params']['project']['values'] = $this->loadModel('product')->getProjectPairs($release->product); - $this->config->bug->search['params']['openedBuild']['values'] = $this->loadModel('build')->getProductBuildPairs($release->product); + $this->config->bug->search['params']['openedBuild']['values'] = $this->loadModel('build')->getProductBuildPairs($release->product, $branch = 0, $params = ''); $this->config->bug->search['params']['resolvedBuild']['values'] = $this->config->bug->search['params']['openedBuild']['values']; unset($this->config->bug->search['fields']['branch']); unset($this->config->bug->search['params']['branch']); diff --git a/module/testtask/control.php b/module/testtask/control.php index f2f56b716d..7e7b187ca3 100644 --- a/module/testtask/control.php +++ b/module/testtask/control.php @@ -418,7 +418,7 @@ class testtask extends control $this->view->task = $task; $this->view->projects = $this->product->getProjectPairs($productID); - $this->view->builds = $this->loadModel('build')->getProductBuildPairs($productID); + $this->view->builds = $this->loadModel('build')->getProductBuildPairs($productID, $branch = 0, $params = ''); $this->view->users = $this->loadModel('user')->getPairs('nodeleted', $task->owner); $this->display(); @@ -818,7 +818,7 @@ class testtask extends control $this->view->case = $case; $this->view->results = $results; - $this->view->builds = $this->loadModel('build')->getProductBuildPairs($case->product); + $this->view->builds = $this->loadModel('build')->getProductBuildPairs($case->product, $branch = 0, $params = ''); $this->view->users = $this->loadModel('user')->getPairs('noclosed, noletter'); die($this->display());