diff --git a/module/api/v1/entries/execution.php b/module/api/v1/entries/execution.php index d1bd8c8894..ba63109dda 100644 --- a/module/api/v1/entries/execution.php +++ b/module/api/v1/entries/execution.php @@ -75,7 +75,7 @@ class executionEntry extends entry $execution->modules = $data->data->tree; } case 'builds': - $execution->builds = $this->loadModel('build')->getBuildPairs($productID, 'all', 'noempty,noterminate,nodone', $executionID, 'execution'); + $execution->builds = $this->loadModel('build')->getBuildPairs(array($productID), 'all', 'noempty,noterminate,nodone', $executionID, 'execution'); break; case 'moduleoptionmenu': $execution->moduleOptionMenu = $this->loadModel('tree')->getTaskOptionMenu($executionID, 0, 0, 'allModule'); diff --git a/module/api/v1/entries/options.php b/module/api/v1/entries/options.php index b16024e507..123cba4b51 100644 --- a/module/api/v1/entries/options.php +++ b/module/api/v1/entries/options.php @@ -36,7 +36,7 @@ class optionsEntry extends entry if($product) $options['modules'] = $this->loadModel('tree')->getOptionMenu($product, 'bug'); $execution = $this->param('execution', 0); - $options['build'] = $this->loadModel('build')->getBuildPairs($product, 'all', '', $execution, 'execution'); + $options['build'] = $this->loadModel('build')->getBuildPairs(array($product), 'all', '', $execution, 'execution'); break; } diff --git a/module/api/v1/entries/product.php b/module/api/v1/entries/product.php index da89023444..615991ddec 100644 --- a/module/api/v1/entries/product.php +++ b/module/api/v1/entries/product.php @@ -66,7 +66,7 @@ class productEntry extends entry $product->parentstories= $this->loadModel('story')->getParentStoryPairs($productID); break; case 'builds': - $product->builds = $this->loadModel('build')->getBuildPairs($productID, 'all', 'noempty,noterminate,nodone,withbranch', $this->param('object', 0), $this->param('objectType', 'execution')); + $product->builds = $this->loadModel('build')->getBuildPairs(array($productID), 'all', 'noempty,noterminate,nodone,withbranch', $this->param('object', 0), $this->param('objectType', 'execution')); break; case 'actions': $product->addComment = common::hasPriv('action', 'comment') ? true : false; diff --git a/module/api/v1/entries/testtasks.php b/module/api/v1/entries/testtasks.php index 6ee339ca5a..1d9db8e5a0 100644 --- a/module/api/v1/entries/testtasks.php +++ b/module/api/v1/entries/testtasks.php @@ -87,7 +87,7 @@ class testtasksEntry extends entry /* Check whether executionID and buildID is valid. */ $executions = $this->loadModel('product')->getExecutionPairsByProduct($productID, '', $projectID); - $builds = $this->loadModel('build')->getBuildPairs($productID, 'all', 'notrunk'); + $builds = $this->loadModel('build')->getBuildPairs(array($productID), 'all', 'notrunk'); if(!isset($executions[$executionID])) return $this->sendError(400, 'error execution id!'); if(!isset($builds[$buildID])) return $this->sendError(400, 'error build id!'); diff --git a/module/bug/control.php b/module/bug/control.php index 94e7508364..c16fdddc65 100755 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -179,7 +179,7 @@ class bug extends control $this->view->users = $this->loadModel('user')->getPairs('noletter'); $this->view->branches = $branches; $this->view->branchName = $product->type == 'normal' ? '' : zget($branches, $bug->branch, ''); - $this->view->builds = $this->loadModel('build')->getBuildPairs($bug->product, 'all'); + $this->view->builds = $this->loadModel('build')->getBuildPairs(array($bug->product), 'all'); $this->view->linkCommits = $this->loadModel('repo')->getCommitsByObject($bug->id, 'bug'); $this->view->actions = $this->loadModel('action')->getList('bug', $bug->id); $this->view->legendBasic = $this->bugZen->getBasicInfoTable($this->view); @@ -452,7 +452,7 @@ class bug extends control $this->view->execution = $oldBug->execution ? $this->loadModel('execution')->getByID($oldBug->execution) : ''; $this->view->users = $this->loadModel('user')->getPairs('noclosed'); $this->view->executions = $this->loadModel('product')->getExecutionPairsByProduct($oldBug->product, $oldBug->branch ? "0,{$oldBug->branch}" : 0, (int)$oldBug->project, 'stagefilter'); - $this->view->builds = $this->loadModel('build')->getBuildPairs($oldBug->product, $oldBug->branch, 'withbranch,noreleased'); + $this->view->builds = $this->loadModel('build')->getBuildPairs(array($oldBug->product), $oldBug->branch, 'withbranch,noreleased'); $this->view->actions = $this->loadModel('action')->getList('bug', $bugID); $this->display(); } @@ -510,7 +510,7 @@ class bug extends control $this->view->title = $this->lang->bug->activate; $this->view->bug = $oldBug; $this->view->users = $this->loadModel('user')->getPairs('noclosed', $oldBug->resolvedBy); - $this->view->builds = $this->loadModel('build')->getBuildPairs($productID, $oldBug->branch, 'noempty,noreleased', 0, 'execution', $oldBug->openedBuild); + $this->view->builds = $this->loadModel('build')->getBuildPairs(array($productID), $oldBug->branch, 'noempty,noreleased', 0, 'execution', $oldBug->openedBuild); $this->view->actions = $this->loadModel('action')->getList('bug', $bugID); $this->display(); } @@ -1270,7 +1270,7 @@ class bug extends control $this->view->title = $this->products[$productID] . $this->lang->colon . $this->lang->bug->batchActivate; $this->view->bugs = $this->bug->getByIdList($bugIdList); $this->view->users = $this->user->getPairs('noclosed'); - $this->view->builds = $this->loadModel('build')->getBuildPairs($productID, $branch, 'noempty,noreleased'); + $this->view->builds = $this->loadModel('build')->getBuildPairs(array($productID), $branch, 'noempty,noreleased'); $this->display(); } diff --git a/module/bug/model.php b/module/bug/model.php index 7c53d94977..554f4189b3 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -740,7 +740,7 @@ class bugModel extends model $this->config->bug->search['params']['module']['values'] = $modules; $this->config->bug->search['params']['execution']['values'] = $this->loadModel('product')->getExecutionPairsByProduct($productID, '0', (int)$projectID); $this->config->bug->search['params']['severity']['values'] = array(0 => '') + $this->lang->bug->severityList; //Fix bug #939. - $this->config->bug->search['params']['openedBuild']['values'] = $this->loadModel('build')->getBuildPairs($productID, 'all', 'withbranch|releasetag'); + $this->config->bug->search['params']['openedBuild']['values'] = $this->loadModel('build')->getBuildPairs(array($productID), 'all', 'withbranch|releasetag'); $this->config->bug->search['params']['resolvedBuild']['values'] = $this->config->bug->search['params']['openedBuild']['values']; if($this->session->currentProductType == 'normal') @@ -1382,14 +1382,18 @@ class bugModel extends model /* 统计最后一次查询的所属产品列表。*/ /* Get products in the last query. */ - $products = $this->session->product; + $productIdList = $this->session->product ? array($this->session->product) : array(); if($this->reportCondition() !== true) { preg_match('/`product` IN \((?P.+)\)/', $this->reportCondition(), $matches); - if(!empty($matches) && isset($matches['productIdList'])) $products = str_replace('\'', '', $matches['productIdList']); + if(!empty($matches) && isset($matches['productIdList'])) + { + $productIdList = str_replace('\'', '', $matches['productIdList']); + $productIdList = explode(',', $productIdList); + } } - $builds = $this->loadModel('build')->getBuildPairs($products, $branch = 0, $params = 'hasdeleted'); + $builds = $this->loadModel('build')->getBuildPairs($productIdList, 0, 'hasdeleted'); $this->app->loadLang('report'); foreach($datas as $buildID => $data) $data->name = zget($builds, $buildID, $this->lang->report->undefined); diff --git a/module/bug/zen.php b/module/bug/zen.php index 62c7ac5eb3..7904bf6c3b 100644 --- a/module/bug/zen.php +++ b/module/bug/zen.php @@ -306,13 +306,13 @@ class bugZen extends bug if($executionID) { - $builds = $this->build->getBuildPairs($productID, $branch, 'noempty,noterminate,nodone,noreleased', $executionID, 'execution'); + $builds = $this->build->getBuildPairs(array($productID), $branch, 'noempty,noterminate,nodone,noreleased', $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->build->getBuildPairs($productID, $branch, 'noempty,noterminate,nodone,withbranch,noreleased'); + $builds = $this->build->getBuildPairs(array($productID), $branch, 'noempty,noterminate,nodone,withbranch,noreleased'); $stories = $this->story->getProductStoryPairs($productID, $branch, $moduleID, 'all','id_desc', 0, 'full', 'story', false); } @@ -1075,7 +1075,7 @@ class bugZen extends bug $this->view->executions = $executions; $this->view->tasks = $this->loadModel('task')->getByIdList($taskIdList); $this->view->stories = $this->loadModel('story')->getByList($storyIdList); - $this->view->builds = $this->loadModel('build')->getBuildPairs($product->id, $branch); + $this->view->builds = $this->loadModel('build')->getBuildPairs(array($product->id), $branch); $this->view->bugs = $bugs; $this->view->users = $this->user->getPairs('noletter'); $this->view->memberPairs = $this->user->getPairs('noletter|noclosed'); @@ -1209,19 +1209,19 @@ class bugZen extends bug { if($bug->execution) { - $openedBuilds = $this->loadModel('build')->getBuildPairs($bug->product, $bug->branch, 'noempty,noterminate,nodone,withbranch,noreleased', $bug->execution, 'execution'); + $openedBuilds = $this->loadModel('build')->getBuildPairs(array($bug->product), $bug->branch, 'noempty,noterminate,nodone,withbranch,noreleased', $bug->execution, 'execution'); } elseif($bug->project) { - $openedBuilds = $this->loadModel('build')->getBuildPairs($bug->product, $bug->branch, 'noempty,noterminate,nodone,withbranch,noreleased', $bug->project, 'project'); + $openedBuilds = $this->loadModel('build')->getBuildPairs(array($bug->product), $bug->branch, 'noempty,noterminate,nodone,withbranch,noreleased', $bug->project, 'project'); } else { - $openedBuilds = $this->loadModel('build')->getBuildPairs($bug->product, $bug->branch, 'noempty,noterminate,nodone,withbranch,noreleased'); + $openedBuilds = $this->loadModel('build')->getBuildPairs(array($bug->product), $bug->branch, 'noempty,noterminate,nodone,withbranch,noreleased'); } $this->view->openedBuilds = $openedBuilds; - $this->view->resolvedBuilds = $this->build->getBuildPairs($bug->product, $bug->branch, 'noempty'); + $this->view->resolvedBuilds = $this->build->getBuildPairs(array($bug->product), $bug->branch, 'noempty'); $this->view->plans = $this->loadModel('productplan')->getPairs($bug->product, $bug->branch, '', true); $this->view->stories = $bug->execution ? $this->story->getExecutionStoryPairs($bug->execution) : $this->story->getProductStoryPairs($bug->product, $bug->branch, 0, 'all', 'id_desc', 0, 'full', 'story', false); $this->view->tasks = $this->task->getExecutionTaskPairs($bug->execution); @@ -1317,7 +1317,7 @@ class bugZen extends bug if($executionID) { /* Get builds, stories and branches of this execution. */ - $builds = $this->loadModel('build')->getBuildPairs($product->id, $branch, 'noempty,noreleased', $executionID, 'execution'); + $builds = $this->loadModel('build')->getBuildPairs(array($product->id), $branch, 'noempty,noreleased', $executionID, 'execution'); $stories = $this->story->getExecutionStoryPairs($executionID); $productBranches = $product->type != 'normal' ? $this->loadModel('execution')->getBranchByProduct(array($product->id), $executionID) : array(); $branches = isset($productBranches[$product->id]) ? $productBranches[$product->id] : array(); @@ -1330,7 +1330,7 @@ class bugZen extends bug else { /* Get builds, stories and branches of the product. */ - $builds = $this->loadModel('build')->getBuildPairs($product->id, $branch, 'noempty,noreleased'); + $builds = $this->loadModel('build')->getBuildPairs(array($product->id), $branch, 'noempty,noreleased'); $stories = $this->story->getProductStoryPairs($product->id, $branch); $branches = $product->type != 'normal' ? $this->loadModel('branch')->getPairs($product->id, 'active') : array(); } diff --git a/module/build/control.php b/module/build/control.php index 8e6b7c2b7a..2c29ab2d15 100644 --- a/module/build/control.php +++ b/module/build/control.php @@ -131,7 +131,7 @@ class build extends control { $productGroups = $this->product->getProducts($build->project, $status); $branches = $this->loadModel('branch')->getList($build->product, $build->project, 'all'); - $builds = $this->build->getBuildPairs($build->product, 'all', 'noempty,notrunk,singled,separate', $build->project, 'project', $build->builds, false); + $builds = $this->build->getBuildPairs(array($build->product), 'all', 'noempty,notrunk,singled,separate', $build->project, 'project', $build->builds, false); } $executions = $this->product->getExecutionPairsByProduct($build->product, $build->branch, (int)$this->session->project, 'stagefilter'); @@ -278,7 +278,7 @@ class build extends control $this->view->canBeChanged = common::canBeChanged('build', $build); // Determines whether an object is editable. $this->view->users = $this->loadModel('user')->getPairs('noletter'); $this->view->build = $build; - $this->view->buildPairs = $this->build->getBuildPairs(0, 'all', 'noempty,notrunk', $objectID, $objectType); + $this->view->buildPairs = $this->build->getBuildPairs(array(0), 'all', 'noempty,notrunk', $objectID, $objectType); $this->view->builds = $this->build->getByList(array_keys($this->view->buildPairs)); $this->view->executions = $executions; $this->view->actions = $this->loadModel('action')->getList('build', $buildID); @@ -340,7 +340,7 @@ class build extends control if($varName == 'openedBuild' ) { $params = $type == 'all' ? 'noempty,withbranch,noreleased' : 'noempty,noterminate,nodone,withbranch,noreleased'; - $builds = $this->build->getBuildPairs($productID, $branch, $params, 0, 'project', $build); + $builds = $this->build->getBuildPairs(array($productID), $branch, $params, 0, 'project', $build); if($isJsonView) return print(json_encode($builds)); $items = array(); @@ -349,7 +349,7 @@ class build extends control } if($varName == 'openedBuilds' ) { - $builds = $this->build->getBuildPairs($productID, $branch, 'noempty,noreleased', 0, 'project', $build); + $builds = $this->build->getBuildPairs(array($productID), $branch, 'noempty,noreleased', 0, 'project', $build); $buildList = array(); foreach($builds as $buildID => $buildName) $buildList[] = array('value' => $buildID, 'text' => $buildName); return $this->send($buildList); @@ -357,7 +357,7 @@ class build extends control if($varName == 'resolvedBuild') { $params = $type == 'all' ? 'withbranch,noreleased' : 'noterminate,nodone,withbranch,noreleased'; - $builds = $this->build->getBuildPairs($productID, $branch, $params, 0, 'project', $build); + $builds = $this->build->getBuildPairs(array($productID), $branch, $params, 0, 'project', $build); if($isJsonView) return print(json_encode($builds)); $items = array(); @@ -365,7 +365,7 @@ class build extends control return print(json_encode($items)); } - $builds = $this->build->getBuildPairs($productID, $branch, $type, 0, 'project', $build, false); + $builds = $this->build->getBuildPairs(array($productID), $branch, $type, 0, 'project', $build, false); if($isJsonView) return print(json_encode($builds)); $items = array(); @@ -395,7 +395,7 @@ class build extends control if(empty($projectID)) return $this->ajaxGetProductBuilds($productID, $varName, $build, $branch, $index, $type); $params = ($type == 'all') ? 'noempty,withbranch,noreleased' : 'noempty,noterminate,nodone,withbranch,noreleased'; - $builds = $this->build->getBuildPairs($productID, $branch, $params, $projectID, 'project', $build); + $builds = $this->build->getBuildPairs(array($productID), $branch, $params, $projectID, 'project', $build); if($isJsonView) return print(json_encode($builds)); $items = array(); @@ -411,7 +411,7 @@ class build extends control if(empty($projectID)) return $this->ajaxGetProductBuilds($productID, $varName, $build, $branch, $index, $type); $params = ($type == 'all') ? 'withbranch,noreleased' : 'noterminate,nodone,withbranch,noreleased'; - $builds = $this->build->getBuildPairs($productID, $branch, $params, $projectID, 'project', $build); + $builds = $this->build->getBuildPairs(array($productID), $branch, $params, $projectID, 'project', $build); return print(json_encode($builds)); $items = array(); @@ -425,7 +425,7 @@ class build extends control if(empty($projectID)) return $this->ajaxGetProductBuilds($productID, $varName, $build, $branch, $index, $type, $extra); - $builds = $this->build->getBuildPairs($productID, $branch, $type, $projectID, 'project', $build, false); + $builds = $this->build->getBuildPairs(array($productID), $branch, $type, $projectID, 'project', $build, false); if($isJsonView) return print(json_encode($builds)); $items = array(); @@ -460,7 +460,7 @@ class build extends control if(empty($executionID)) return $this->ajaxGetProductBuilds($productID, $varName, $build, $branch, $index, $type); $params = ($type == 'all') ? 'noempty,noreleased' : 'noempty,noterminate,nodone,noreleased'; - $builds = $this->build->getBuildPairs($productID, $branch, $params, $executionID, 'execution', $build); + $builds = $this->build->getBuildPairs(array($productID), $branch, $params, $executionID, 'execution', $build); if($isJsonView) return print(json_encode($builds)); $items = array(); @@ -471,7 +471,7 @@ class build extends control { if(empty($executionID)) return $this->ajaxGetProductBuilds($productID, $varName, $build, $branch, $index, $type); - $builds = $this->build->getBuildPairs($productID, $branch, 'noempty,noreleased', $executionID, 'execution', $build); + $builds = $this->build->getBuildPairs(array($productID), $branch, 'noempty,noreleased', $executionID, 'execution', $build); $buildList = array(); foreach($builds as $buildID => $buildName) $buildList[] = array('value' => $buildID, 'text' => $buildName); return $this->send($buildList); @@ -481,13 +481,13 @@ class build extends control if(empty($executionID)) return $this->ajaxGetProductBuilds($productID, $varName, $build, $branch, $index, $type); $params = ($type == 'all') ? ',noreleased' : 'noterminate,nodone,noreleased'; - $builds = $this->build->getBuildPairs($productID, $branch, $params, $executionID, 'execution', $build); + $builds = $this->build->getBuildPairs(array($productID), $branch, $params, $executionID, 'execution', $build); if($isJsonView) return print(json_encode($builds)); return print(html::select($varName, $builds, $build, "class='form-control'")); } if($varName == 'testTaskBuild') { - $builds = $this->build->getBuildPairs($productID, $branch, 'noempty,notrunk', $executionID, 'execution', '', false); + $builds = $this->build->getBuildPairs(array($productID), $branch, 'noempty,notrunk', $executionID, 'execution', '', false); if($isJsonView) return print(json_encode($builds)); $items = array(); @@ -496,7 +496,7 @@ class build extends control } if($varName == 'dropdownList') { - $builds = $this->build->getBuildPairs($productID, $branch, 'noempty,notrunk', $executionID, 'execution'); + $builds = $this->build->getBuildPairs(array($productID), $branch, 'noempty,notrunk', $executionID, 'execution'); if($isJsonView) return print(json_encode($builds)); $list = "
"; @@ -789,7 +789,7 @@ class build extends control $this->config->bug->search['params']['plan']['values'] = $this->loadModel('productplan')->getPairs($build->product, $build->branch, '', true); $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, (int)$this->session->project); - $this->config->bug->search['params']['openedBuild']['values'] = $this->build->getBuildPairs($build->product, $branch = 'all', $params = 'releasetag'); + $this->config->bug->search['params']['openedBuild']['values'] = $this->build->getBuildPairs(array($build->product), $branch = 'all', $params = 'releasetag'); $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/execution/model.php b/module/execution/model.php index 87ffd57f42..9e28c9c0d7 100755 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -3838,7 +3838,7 @@ class executionModel extends model $productModules = $this->loadModel('tree')->getOptionMenu($product->id, 'bug'); foreach($productModules as $moduleID => $moduleName) $modules[$moduleID] = ((count($products) >= 2 and $moduleID) ? $product->name : '') . $moduleName; - $productBuilds = $this->loadModel('build')->getBuildPairs($product->id, 'all', 'noempty|notrunk|withbranch'); + $productBuilds = $this->loadModel('build')->getBuildPairs(array($product->id), 'all', 'noempty|notrunk|withbranch'); foreach($productBuilds as $buildID => $buildName) $builds[$buildID] = ((count($products) >= 2 and $buildID) ? $product->name . '/' : '') . $buildName; } diff --git a/module/execution/zen.php b/module/execution/zen.php index 9a9d8aca78..8da21f8982 100644 --- a/module/execution/zen.php +++ b/module/execution/zen.php @@ -73,7 +73,7 @@ class executionZen extends execution $this->view->users = $this->loadModel('user')->getPairs('noletter'); $this->view->param = $param; $this->view->defaultProduct = (empty($productID) and !empty($products)) ? current(array_keys($products)) : $productID; - $this->view->builds = $this->loadModel('build')->getBuildPairs($productID); + $this->view->builds = $this->loadModel('build')->getBuildPairs(array($productID)); $this->view->projectPairs = $this->loadModel('project')->getPairsByProgram(); } diff --git a/module/mr/control.php b/module/mr/control.php index 36d99533de..d7d7867c5a 100644 --- a/module/mr/control.php +++ b/module/mr/control.php @@ -716,7 +716,7 @@ 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')->getBuildPairs($productID, 'all', 'releasetag'); + $this->config->bug->search['params']['openedBuild']['values'] = $this->loadModel('build')->getBuildPairs(array($productID), 'all', 'releasetag'); $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/my/model.php b/module/my/model.php index b67498ed62..796d215f47 100644 --- a/module/my/model.php +++ b/module/my/model.php @@ -659,7 +659,7 @@ class myModel extends model $this->config->bug->search['params']['plan']['values'] = $this->loadModel('productplan')->getPairs(); $this->config->bug->search['params']['module']['values'] = $this->loadModel('tree')->getAllModulePairs(); $this->config->bug->search['params']['severity']['values'] = array(0 => '') + $this->lang->bug->severityList; - $this->config->bug->search['params']['openedBuild']['values'] = $this->loadModel('build')->getBuildPairs($products, 'all', 'releasetag'); + $this->config->bug->search['params']['openedBuild']['values'] = $this->loadModel('build')->getBuildPairs(array_keys($products), 'all', 'releasetag'); $this->config->bug->search['params']['resolvedBuild']['values'] = $this->config->bug->search['params']['openedBuild']['values']; $this->loadModel('search')->setSearchParams($this->config->bug->search); diff --git a/module/productplan/zen.php b/module/productplan/zen.php index fb4090213a..fcec768926 100644 --- a/module/productplan/zen.php +++ b/module/productplan/zen.php @@ -309,7 +309,7 @@ class productplanZen extends productplan $this->config->bug->search['params']['plan']['values'] = $this->productplan->getPairs($plan->product, $plan->branch, 'withMainPlan', true); $this->config->bug->search['params']['execution']['values'] = $this->loadModel('product')->getExecutionPairsByProduct($plan->product, $plan->branch); $this->config->bug->search['params']['module']['values'] = $modulePairs; - $this->config->bug->search['params']['openedBuild']['values'] = $this->loadModel('build')->getBuildPairs($plan->product, 'all', 'releasetag'); + $this->config->bug->search['params']['openedBuild']['values'] = $this->loadModel('build')->getBuildPairs(array($plan->product), 'all', 'releasetag'); $this->config->bug->search['params']['resolvedBuild']['values'] = $this->config->bug->search['params']['openedBuild']['values']; $this->config->bug->search['params']['module']['values'] = $modulePairs; $this->config->bug->search['params']['project']['values'] = $this->product->getProjectPairsByProduct($plan->product, $plan->branch); diff --git a/module/project/zen.php b/module/project/zen.php index 2deb7b685a..90a03b9c42 100644 --- a/module/project/zen.php +++ b/module/project/zen.php @@ -714,7 +714,7 @@ class projectZen extends project $this->view->productID = $productID; $this->view->project = $project; $this->view->branchID = empty($this->view->build->branch) ? $branchID : $this->view->build->branch; - $this->view->builds = $this->loadModel('build')->getBuildPairs($productID); + $this->view->builds = $this->loadModel('build')->getBuildPairs(array($productID)); $this->view->users = $this->user->getPairs('noletter'); $this->view->executions = $this->loadModel('execution')->getPairs($projectID, 'all', 'empty|withdelete'); $this->view->plans = $this->loadModel('productplan')->getPairs($productID ? $productID : array_keys($products)); diff --git a/module/projectrelease/control.php b/module/projectrelease/control.php index 83cd5967e3..2dc7eed057 100644 --- a/module/projectrelease/control.php +++ b/module/projectrelease/control.php @@ -126,7 +126,7 @@ class projectrelease extends control $this->projectreleaseZen->commonAction($projectID); /* Get the builds that can select. */ - $builds = $this->loadModel('build')->getBuildPairs($this->view->product->id, 'all', 'notrunk|withbranch|hasproject', $projectID, 'project', '', false); + $builds = $this->loadModel('build')->getBuildPairs(array($this->view->product->id), 'all', 'notrunk|withbranch|hasproject', $projectID, 'project', '', false); $releasedBuilds = $this->projectrelease->getReleasedBuilds($projectID); foreach($releasedBuilds as $build) unset($builds[$build]); @@ -182,7 +182,7 @@ class projectrelease extends control $this->projectreleaseZen->commonAction($this->session->project, $release->product, $release->branch); /* Get the builds that can select. */ - $builds = $this->loadModel('build')->getBuildPairs($release->product, $release->branch, 'notrunk|withbranch|hasproject', $this->session->project, 'project', $release->build, false); + $builds = $this->loadModel('build')->getBuildPairs(array($release->product), $release->branch, 'notrunk|withbranch|hasproject', $this->session->project, 'project', $release->build, false); $bindBuilds = $this->build->getByList($release->build); $releasedBuilds = $this->projectrelease->getReleasedBuilds($this->session->project); foreach($releasedBuilds as $releasedBuild) @@ -562,7 +562,7 @@ class projectrelease extends control $this->config->bug->search['style'] = 'simple'; $this->config->bug->search['params']['plan']['values'] = $this->loadModel('productplan')->getPairs($release->product, $release->branch, 'withMainPlan', true); $this->config->bug->search['params']['execution']['values'] = $this->loadModel('product')->getExecutionPairsByProduct($release->product, $release->branch, $release->project); - $this->config->bug->search['params']['openedBuild']['values'] = $this->loadModel('build')->getBuildPairs($release->product, $branch = 0); + $this->config->bug->search['params']['openedBuild']['values'] = $this->loadModel('build')->getBuildPairs(array($release->product), $branch = 0); $this->config->bug->search['params']['resolvedBuild']['values'] = $this->config->bug->search['params']['openedBuild']['values']; $searchModules = array(); @@ -686,7 +686,7 @@ class projectrelease extends control */ public function ajaxLoadBuilds($projectID, $productID) { - $builds = $this->loadModel('build')->getBuildPairs($productID, 'all', 'notrunk,withbranch,hasproject', $projectID, 'project', '', false); + $builds = $this->loadModel('build')->getBuildPairs(array($productID), 'all', 'notrunk,withbranch,hasproject', $projectID, 'project', '', false); $releasedBuilds = $this->projectrelease->getReleasedBuilds($projectID); foreach($releasedBuilds as $build) unset($builds[$build]); diff --git a/module/release/control.php b/module/release/control.php index 0a5a78c9fb..5169721d8b 100644 --- a/module/release/control.php +++ b/module/release/control.php @@ -107,7 +107,7 @@ class release extends control return $this->send(array('result' => 'success', 'message' => $message, 'load' => inlink('view', "releaseID={$releaseID}"))); } - $builds = $this->loadModel('build')->getBuildPairs($productID, $branch, 'notrunk|withbranch|hasproject', 0, 'execution', '', false); + $builds = $this->loadModel('build')->getBuildPairs(array($productID), $branch, 'notrunk|withbranch|hasproject', 0, 'execution', '', false); $releasedBuilds = $this->release->getReleasedBuilds($productID, $branch); foreach($releasedBuilds as $build) unset($builds[$build]); @@ -154,7 +154,7 @@ class release extends control $release = $this->release->getById((int)$releaseID); $this->commonAction($release->product); - $builds = $this->loadModel('build')->getBuildPairs($release->product, $release->branch, 'notrunk|withbranch|hasproject', 0, 'project', $release->build, false); + $builds = $this->loadModel('build')->getBuildPairs(array($release->product), $release->branch, 'notrunk|withbranch|hasproject', 0, 'project', $release->build, false); $releasedBuilds = $this->release->getReleasedBuilds($release->product); foreach($releasedBuilds as $releasedBuild) { @@ -270,7 +270,7 @@ class release extends control $this->view->storyPager = $storyPager; $this->view->bugPager = $bugPager; $this->view->leftBugPager = $leftBugPager; - $this->view->builds = $this->loadModel('build')->getBuildPairs($release->product, 'all', 'withbranch|hasproject', 0, 'execution', '', false); + $this->view->builds = $this->loadModel('build')->getBuildPairs(array($release->product), 'all', 'withbranch|hasproject', 0, 'execution', '', false); $this->view->summary = $this->product->summary($stories); $this->view->storyCases = $this->loadModel('testcase')->getStoryCaseCounts(array_keys($stories)); @@ -642,7 +642,7 @@ class release extends control $this->config->bug->search['params']['plan']['values'] = $this->loadModel('productplan')->getPairs($release->product, $release->branch, 'withMainPlan', true); $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')->getBuildPairs($release->product, 'all', 'releasetag'); + $this->config->bug->search['params']['openedBuild']['values'] = $this->loadModel('build')->getBuildPairs(array($release->product), 'all', 'releasetag'); $this->config->bug->search['params']['resolvedBuild']['values'] = $this->config->bug->search['params']['openedBuild']['values']; $searchModules = array(); diff --git a/module/release/model.php b/module/release/model.php index 0e17b42e2b..03f35c48c7 100644 --- a/module/release/model.php +++ b/module/release/model.php @@ -1040,7 +1040,7 @@ class releaseModel extends model $this->config->release->search['actionURL'] = $actionURL; if($product->type != 'normal') $this->config->release->search['params']['branch']['values'] = $this->loadModel('branch')->getPairs($product->id, 'all'); - $this->config->release->search['params']['build']['values'] = $this->loadmodel('build')->getbuildpairs($product->id, $branch, 'notrunk|withbranch|hasproject', 0, 'execution', '', false); + $this->config->release->search['params']['build']['values'] = $this->loadmodel('build')->getBuildPairs(array($product->id), $branch, 'notrunk|withbranch|hasproject', 0, 'execution', '', false); $this->loadModel('search')->setSearchParams($this->config->release->search); } diff --git a/module/repo/control.php b/module/repo/control.php index 92fa6f4b32..40635e9d5e 100644 --- a/module/repo/control.php +++ b/module/repo/control.php @@ -1193,8 +1193,8 @@ class repo extends control $this->config->bug->search['params']['plan']['values'] = $this->loadModel('productplan')->getForProducts(array($product->id => $product->id)); $this->config->bug->search['params']['module']['values'] = $modules; $this->config->bug->search['params']['execution']['values'] = $this->product->getExecutionPairsByProduct($product->id); - $this->config->bug->search['params']['openedBuild']['values'] = $this->loadModel('build')->getBuildPairs($product->id, 'all', ''); - $this->config->bug->search['params']['resolvedBuild']['values'] = $this->loadModel('build')->getBuildPairs($product->id, 'all', ''); + $this->config->bug->search['params']['openedBuild']['values'] = $this->loadModel('build')->getBuildPairs(array($product->id), 'all', ''); + $this->config->bug->search['params']['resolvedBuild']['values'] = $this->loadModel('build')->getBuildPairs(array($product->id), 'all', ''); unset($this->config->bug->search['fields']['product']); if($product->type == 'normal') diff --git a/module/testtask/control.php b/module/testtask/control.php index 3cf787603c..88c0ee46fd 100644 --- a/module/testtask/control.php +++ b/module/testtask/control.php @@ -945,7 +945,7 @@ class testtask extends control $this->view->runID = $runID; $this->view->results = $results; $this->view->type = $type; - $this->view->builds = $this->loadModel('build')->getBuildPairs($case->product, $case->branch); + $this->view->builds = $this->loadModel('build')->getBuildPairs(array($case->product), $case->branch); $this->view->users = $this->loadModel('user')->getPairs('noclosed, noletter'); $this->view->testtasks = $this->testtask->getPairs($case->product); @@ -997,7 +997,7 @@ class testtask extends control $this->loadModel('qa')->setMenu($productID); $executions = empty($productID) ? array() : $this->product->getExecutionPairsByProduct($productID); - $builds = empty($productID) ? array() : $this->loadModel('build')->getBuildPairs($productID, 'all', 'notrunk', 0, 'execution', '', false); + $builds = empty($productID) ? array() : $this->loadModel('build')->getBuildPairs(array($productID), 'all', 'notrunk', 0, 'execution', '', false); $this->view->title = $this->products[$productID] . $this->lang->colon . $this->lang->testtask->importUnitResult; $this->view->users = $this->loadModel('user')->getPairs('noletter|nodeleted|noclosed'); diff --git a/module/testtask/zen.php b/module/testtask/zen.php index 7ab5f7dbc6..75a9064ee2 100644 --- a/module/testtask/zen.php +++ b/module/testtask/zen.php @@ -319,7 +319,7 @@ class testtaskZen extends testtask $this->view->title = $this->products[$productID] . $this->lang->colon . $this->lang->testtask->create; $this->view->product = $this->loadModel('product')->getByID($productID); $this->view->executions = $productID ? $this->product->getExecutionPairsByProduct($productID, '', $projectID, 'stagefilter') : array(); - $this->view->builds = $productID ? $this->loadModel('build')->getBuildPairs($productID, 'all', 'notrunk,withexecution', $projectID, 'project', '', false) : array(); + $this->view->builds = $productID ? $this->loadModel('build')->getBuildPairs(array($productID), 'all', 'notrunk,withexecution', $projectID, 'project', '', false) : array(); $this->view->testreports = array('') + $this->loadModel('testreport')->getPairs($productID); $this->view->users = $this->loadModel('user')->getPairs('noclosed|qdfirst|nodeleted'); $this->view->projectID = $projectID; @@ -359,7 +359,7 @@ class testtaskZen extends testtask $this->view->project = $this->project->getByID($projectID); $this->view->productID = $productID; $this->view->executions = $executions; - $this->view->builds = empty($productID) ? array() : $this->loadModel('build')->getBuildPairs($productID, 'all', 'noempty,notrunk,withexecution', $executionID ? $executionID : $task->project, $executionID ? 'execution' : 'project', $task->build, false); + $this->view->builds = empty($productID) ? array() : $this->loadModel('build')->getBuildPairs(array($productID), 'all', 'noempty,notrunk,withexecution', $executionID ? $executionID : $task->project, $executionID ? 'execution' : 'project', $task->build, false); $this->view->testreports = $this->loadModel('testreport')->getPairs($task->product, $task->testreport); $this->view->users = $this->loadModel('user')->getPairs('nodeleted|noclosed', $task->owner); $this->view->contactLists = $this->user->getContactLists($this->app->user->account, 'withnote');