This commit is contained in:
lanzongjun
2022-12-09 15:38:54 +08:00
parent 980b2998ad
commit 9158f6f79f
4 changed files with 18 additions and 4 deletions
+10
View File
@@ -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();
+1 -1
View File
@@ -37,7 +37,7 @@
<td><?php if($disabled) echo $lang->build->notice->changeProduct;?></td>
</tr>
<tr>
<tr class='<?php if((!empty($product) and $product->type == 'normal') or empty($product)) echo 'hidden'?>'>
<tr class='<?php if((!empty($product) and $product->type == 'normal') or empty($product) or empty($build->execution)) echo 'hidden'?>'>
<?php
if(empty($product)) $product = new stdclass();
$productType = zget($product, 'type', 'normal');
-1
View File
@@ -147,7 +147,6 @@ class projectrelease extends control
$builds = $this->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;
+7 -2
View File
@@ -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, ',') . ',';