diff --git a/module/build/control.php b/module/build/control.php index 74ea084661..3a69f74bba 100644 --- a/module/build/control.php +++ b/module/build/control.php @@ -310,13 +310,23 @@ class build extends control $this->executeHooks($buildID); - $buildIdList = $build->execution ? array() : array($buildID => $buildID); + $objectType = 'execution'; + $objectID = $build->execution; + if($build->project and $this->app->tab == 'project') + { + $project = $this->project->getByID($build->project); + if(!$project->multiple) + { + $objectType = 'project'; + $objectID = $build->project; + } + } /* Assign. */ $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', $build->execution, 'execution', $buildIdList); + $this->view->buildPairs = $this->build->getBuildPairs(0, 'all', 'noempty,notrunk', $objectID, $objectType); $this->view->actions = $this->loadModel('action')->getList('build', $buildID); $this->view->link = $link; $this->view->param = $param; diff --git a/module/build/model.php b/module/build/model.php index 5d563e01cb..94ffdf616b 100644 --- a/module/build/model.php +++ b/module/build/model.php @@ -236,7 +236,6 @@ class buildModel extends model ->beginIF($products)->andWhere('t1.product')->in($products)->fi() ->beginIF($objectType === 'execution' and $objectID)->andWhere('t1.execution')->eq($objectID)->fi() ->beginIF($objectType === 'project' and $objectID)->andWhere('t1.project')->eq($objectID)->fi() - ->beginIF($objectType === 'execution' and !$objectID)->andWhere('t1.id')->in($buildIdList)->fi() ->beginIF($branch !== 'all')->andWhere('t1.branch')->in("0,$branch")->fi() ->orderBy('t1.date desc, t1.id desc')->fetchAll('id');