diff --git a/module/build/js/create.js b/module/build/js/create.js index 836a71ed59..0626390b86 100644 --- a/module/build/js/create.js +++ b/module/build/js/create.js @@ -25,6 +25,7 @@ $().ready(function() { var projectID = $('#project').val(); var executionID = $('#execution').val(); + if($(this).val() == 'no') { $('#execution').closest('tr').show(); @@ -35,7 +36,16 @@ $().ready(function() { $('#execution').closest('tr').hide(); $('#buildBox').closest('tr').show(); + + $.ajaxSettings.async = false; loadProducts(projectID); + var productID = $('#product').val(); + $.get(createLink('build', 'ajaxGetProjectBuilds', 'projectID=' + projectID + '&productID=' + productID + '&varName=builds&build=&branch=all&index=&needCreate=&type=noempty,notrunk,separate,singled&extra=multiple'), function(data) + { + if(data) $('#buildBox').html(data); + $('#builds').attr('data-placeholder', multipleSelect).chosen(); + }); + $.ajaxSettings.async = true; } }); $('#product').change(); diff --git a/module/build/view/edit.html.php b/module/build/view/edit.html.php index 45df680489..82f83870e5 100644 --- a/module/build/view/edit.html.php +++ b/module/build/view/edit.html.php @@ -37,7 +37,7 @@ build->notice->changeProduct;?> - '> + execution)) echo 'hidden'?>'> build->getBuildPairs($this->view->product->id, 'all', 'notrunk|withbranch|hasproject', $projectID, 'project', '', false); $releasedBuilds = $this->projectrelease->getReleasedBuilds($projectID); foreach($releasedBuilds as $build) unset($builds[$build]); - $this->view->title = $this->view->project->name . $this->lang->colon . $this->lang->release->create; $this->view->projectID = $projectID; $this->view->builds = $builds; diff --git a/module/release/model.php b/module/release/model.php index b647e47907..2b089d5860 100644 --- a/module/release/model.php +++ b/module/release/model.php @@ -235,6 +235,7 @@ class releaseModel extends model $linkedBuilds = array_merge($linkedBuilds, explode(',', $build->builds)); } if($linkedBuilds) $builds += $this->dao->select('id,project,branch,builds,stories,bugs')->from(TABLE_BUILD)->where('id')->in($linkedBuilds)->fetchAll('id'); + $branches = array(); foreach($builds as $build) { foreach(explode(',', $build->branch) as $buildBranch) @@ -339,10 +340,14 @@ class releaseModel extends model /* update release project and branch */ if($release->build) { - $builds = $this->dao->select('project, branch')->from(TABLE_BUILD)->where('id')->in($release->build)->fetchAll(); + $builds = $this->dao->select('project, branch')->from(TABLE_BUILD)->where('id')->in($release->build)->fetchAll(); + $branches = array(); foreach($builds as $build) { - $branches[$build->branch] = $build->branch; + foreach(explode(',', $build->branch) as $buildBranch) + { + if(!isset($branches[$buildBranch])) $branches[$buildBranch] = $buildBranch; + } $projects[$build->project] = $build->project; } $release->build = ',' . trim($release->build, ',') . ',';