diff --git a/module/build/control.php b/module/build/control.php index d529c7b3b8..6fa5c645dd 100644 --- a/module/build/control.php +++ b/module/build/control.php @@ -213,6 +213,7 @@ class build extends control */ public function ajaxGetProductBuilds($productID, $varName, $build = '', $branch = 0, $index = 0, $type = 'normal') { + $branch = $branch ? "0,$branch" : $branch; if($varName == 'openedBuild' ) { $params = ($type == 'all') ? 'noempty' : 'noempty, noterminate, nodone'; @@ -241,7 +242,8 @@ class build extends control */ public function ajaxGetProjectBuilds($projectID, $productID, $varName, $build = '', $branch = 0, $index = 0, $needCreate = false, $type = 'normal') { - if($varName == 'openedBuild') + $branch = $branch ? "0,$branch" : $branch; + if($varName == 'openedBuild') { $params = ($type == 'all') ? 'noempty' : 'noempty, noterminate, nodone'; $builds = $this->build->getProjectBuildPairs($projectID, $productID, $branch, $params); diff --git a/module/build/model.php b/module/build/model.php index 7d5f90432c..88185f7434 100644 --- a/module/build/model.php +++ b/module/build/model.php @@ -77,7 +77,7 @@ class buildModel extends model ->leftJoin(TABLE_BRANCH)->alias('t4')->on('t1.branch = t4.id') ->where('t1.project')->eq((int)$projectID) ->beginIF($productID)->andWhere('t1.product')->eq((int)$productID)->fi() - ->beginIF($branch)->andWhere('t1.branch')->eq($branch)->fi() + ->beginIF($branch)->andWhere('t1.branch')->in($branch)->fi() ->andWhere('t1.deleted')->eq(0) ->orderBy('t1.date desc, t1.id desc')->fetchAll('id'); @@ -121,7 +121,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)->andWhere('t1.branch')->eq($branch)->fi() + ->beginIF($branch)->andWhere('t1.branch')->in($branch)->fi() ->andWhere('t1.deleted')->eq(0) ->orderBy('t1.date desc, t1.id desc')->fetchAll('id'); diff --git a/module/product/control.php b/module/product/control.php index e9d3d67c79..66a71ff5f6 100644 --- a/module/product/control.php +++ b/module/product/control.php @@ -510,7 +510,7 @@ class product extends control */ public function ajaxGetProjects($productID, $projectID = 0, $branch = 0) { - $projects = $this->product->getProjectPairs($productID, $branch, $params = 'nodeleted'); + $projects = $this->product->getProjectPairs($productID, $branch ? "0,$branch" : $branch, $params = 'nodeleted'); die(html::select('project', $projects, $projectID, 'class=form-control onchange=loadProjectRelated(this.value)')); } diff --git a/module/story/control.php b/module/story/control.php index 51f7c6616f..82e80e5ec1 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -950,7 +950,7 @@ class story extends control $storyStatus = array_keys($storyStatus); } - $stories = $this->story->getProductStoryPairs($productID, $branch, $moduleID, $storyStatus, 'id_desc', $limit); + $stories = $this->story->getProductStoryPairs($productID, $branch ? "0,$branch" : $branch, $moduleID, $storyStatus, 'id_desc', $limit); $select = html::select('story', empty($stories) ? array('' => '') : $stories, $storyID, "class='form-control'"); /* If only need options, remove select wrap. */ diff --git a/module/story/model.php b/module/story/model.php index 343787f7b4..e7bdefd390 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -1069,7 +1069,7 @@ class storyModel extends model ->where('1=1') ->beginIF($productID)->andWhere('t1.product')->in($productID)->fi() ->beginIF($moduleIds)->andWhere('t1.module')->in($moduleIds)->fi() - ->beginIF($branch)->andWhere('t1.branch')->eq($branch)->fi() + ->beginIF($branch)->andWhere('t1.branch')->in($branch)->fi() ->beginIF($status and $status != 'all')->andWhere('t1.status')->in($status)->fi() ->andWhere('t1.deleted')->eq(0) ->orderBy($order)