Merge branch 'zentaopms_263_bug#30033' into 'master'

* Fix bug #30033.

See merge request easycorp/zentaopms!6358
This commit is contained in:
王怡栋
2022-11-24 05:09:30 +00:00
3 changed files with 32 additions and 2 deletions
+14
View File
@@ -531,6 +531,20 @@ class build extends control
}
}
/**
* Ajax get last build.
*
* @param int $projectID
* @param int $executionID
* @access public
* @return string
*/
public function ajaxGetLastBuild($projectID, $executionID)
{
$lastBuild = $this->build->getLast($executionID, $projectID);
echo "<div class='help-block'> &nbsp; " . $this->lang->build->last . ": <a class='code label label-badge label-light' id='lastBuildBtn'>" . $lastBuild->name . "</a></div>";
}
/**
* Link stories.
*
+17 -1
View File
@@ -1,6 +1,6 @@
$().ready(function()
{
$('#lastBuildBtn').click(function()
$(document).on('click', '#lastBuildBtn', function()
{
$('#name').val($(this).text()).focus();
});
@@ -66,4 +66,20 @@ function loadProducts(executionID)
loadBranches($("#product").val());
}
});
loadLastBuild();
}
/**
* Load last build
*
* @access public
* @return void
*/
function loadLastBuild()
{
var executionID = $('#execution').val();
$.get(createLink('build', 'ajaxGetLastBuild', 'projectID=' + projectID + '&executionID=' + executionID), function(data)
{
if(data) $('#lastBuildBox').html(data);
});
}
+1 -1
View File
@@ -58,7 +58,7 @@
<tr>
<th class='w-120px'><?php echo $lang->build->name;?></th>
<td><?php echo html::input('name', '', "class='form-control' required");?></td>
<td class='text-muted'>
<td class='text-muted' id='lastBuildBox'>
<?php if($lastBuild):?>
<div class='help-block'> &nbsp; <?php echo $lang->build->last . ': <a class="code label label-badge label-light" id="lastBuildBtn">' . $lastBuild->name . '</a>';?></div>
<?php endif;?>