* Fix bug.

This commit is contained in:
wangyuting
2022-11-11 07:07:17 +00:00
parent f758694397
commit bb49320ee7
3 changed files with 11 additions and 10 deletions
+9 -8
View File
@@ -389,11 +389,10 @@ class build extends control
* @param string|int $branch
* @param int $index the index of batch create bug.
* @param string $type get all builds or some builds belong to normal releases and executions are not done.
* @param string $extra
* @access public
* @return string
*/
public function ajaxGetProductBuilds($productID, $varName, $build = '', $branch = 'all', $index = 0, $type = 'normal', $extra = '')
public function ajaxGetProductBuilds($productID, $varName, $build = '', $branch = 'all', $index = 0, $type = 'normal')
{
$isJsonView = $this->app->getViewType() == 'json';
if($varName == 'openedBuild' )
@@ -416,11 +415,6 @@ class build extends control
if($isJsonView) return print(json_encode($builds));
return print(html::select($varName, $builds, $build, "class='form-control'"));
}
$builds = $this->build->getBuildPairs($productID, $branch, $type);
if($isJsonView) return print(json_encode($builds));
if(strpos($extra, 'multiple') !== false) $varName .= '[]';
return print(html::select($varName, $builds, $build, "class='form-control chosen' $extra"));
}
/**
@@ -433,10 +427,11 @@ class build extends control
* @param int $index the index of batch create bug.
* @param bool $needCreate if need to append the link of create build
* @param string $type get all builds or some builds belong to normal releases and executions are not done.
* @param string $extra
* @access public
* @return string
*/
public function ajaxGetProjectBuilds($projectID, $productID, $varName, $build = '', $branch = 'all', $index = 0, $needCreate = false, $type = 'normal')
public function ajaxGetProjectBuilds($projectID, $productID, $varName, $build = '', $branch = 'all', $index = 0, $needCreate = false, $type = 'normal', $extra = '')
{
$isJsonView = $this->app->getViewType() == 'json';
if($varName == 'openedBuild')
@@ -457,6 +452,12 @@ class build extends control
if($isJsonView) return print(json_encode($builds));
return print(html::select($varName, $builds, $build, "class='form-control'"));
}
if(empty($projectID)) return $this->ajaxGetProductBuilds($productID, $varName, $build, $branch, $index, $type);
$builds = $this->build->getBuildPairs($productID, $branch, $type, $projectID, 'project', $build);
if(strpos($extra, 'multiple') !== false) $varName .= '[]';
if($isJsonView) return print(json_encode($builds));
return print(html::select($varName, $builds, $build, "class='form-control chosen' $extra"));
}
/**
+1 -1
View File
@@ -9,7 +9,7 @@ $().ready(function()
{
var productID = $('#product').val();
var branch = $('#branch').val();
$.get(createLink('build', 'ajaxGetProductBuilds', 'productID=' + productID + '&varName=builds&build=&branch=' + branch + '&index=&type=noempty,notrunk,separate,noproject&extra=multiple'), function(data)
$.get(createLink('build', 'ajaxGetProjectBuilds', 'projectID=' + projectID + '&productID=' + productID + '&varName=builds&build=&branch=' + branch + '&index=&needCreate=&type=noempty,notrunk,separate,noproject&extra=multiple'), function(data)
{
if(data) $('#buildBox').html(data);
$('#builds').chosen();
+1 -1
View File
@@ -11,7 +11,7 @@ $().ready(function()
{
var productID = $('#product').val();
var branch = $('#branch').val();
$.get(createLink('build', 'ajaxGetProductBuilds', 'productID=' + productID + '&varName=builds&build=' + builds + '&branch=' + branch + '&index=&type=noempty,notrunk,separate,noproject&extra=multiple'), function(data)
$.get(createLink('build', 'ajaxGetProjectBuilds', 'projectID=' + projectID + '&productID=' + productID + '&varName=builds&build=&branch=' + branch + '&index=&needCreate=&type=noempty,notrunk,separate,noproject&extra=multiple'), function(data)
{
if(data) $('#buildBox').html(data);
$('#builds').chosen();