This commit is contained in:
holan20180123
2021-04-20 16:06:43 +08:00
parent c399696227
commit 3c96c44935
4 changed files with 9 additions and 5 deletions
+1 -1
View File
@@ -27,7 +27,7 @@ function setBranchRelated(branchID, productID, num)
$("#modules" + num).chosen();
});
executionLink = createLink('product', 'ajaxGetExecutions', 'productID=' + productID + '&executionID=0&branch=' + branchID + '&num=' + num);
executionLink = createLink('product', 'ajaxGetExecutions', 'productID=' + productID + '&projectID=0&branch=' + branchID + '&num=' + num);
$.get(executionLink, function(executions)
{
if(!executions) executions = '<select id="executions' + num + '" name="executions[' + num + ']" class="form-control"></select>';
+3 -1
View File
@@ -1,8 +1,10 @@
var oldExecutionID = $('#execution').val();
function loadExecutions()
{
var productID = $('#product').val();
var branchID = $('#branch').length > 0 ? $('#branch').val() : 0;
$('#executionsBox').load(createLink('product', 'ajaxGetExecutions', 'productID=' + productID + '&executionID=0&branch=' + branchID), function()
$('#executionsBox').load(createLink('product', 'ajaxGetExecutions', 'productID=' + productID + '&projectID=0&branch=' + branchID + '&number=&executionID=' + oldExecutionID), function()
{
$('#executionsBox #execution').chosen().removeAttr('onchange');
});
+1
View File
@@ -89,4 +89,5 @@
</div>
</div>
<?php js::set('productGroups', $productGroups)?>
<?php js::set('projectID', $build->project)?>
<?php include '../../common/view/footer.html.php';?>
+4 -3
View File
@@ -855,15 +855,16 @@ class product extends control
* AJAX: get executions of a product in html select.
*
* @param int $productID
* @param int $executionID
* @param int $projectID
* @param int $branch
* @param string $number
* @param int $executionID
* @access public
* @return void
*/
public function ajaxGetExecutions($productID, $executionID = 0, $branch = 0, $number = '')
public function ajaxGetExecutions($productID, $projectID = 0, $branch = 0, $number = '', $executionID = 0)
{
$executions = $this->product->getExecutionPairsByProduct($productID, $branch ? "0,$branch" : $branch, 'id_desc', $executionID);
$executions = $this->product->getExecutionPairsByProduct($productID, $branch ? "0,$branch" : $branch, 'id_desc', $projectID);
if($this->app->getViewType() == 'json') die(json_encode($executions));
if($number === '')