Merge branch 'zentaopms_263_bug#30033' into 'master'
* Fix bug #30033. See merge request easycorp/zentaopms!6358
This commit is contained in:
@@ -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'> " . $this->lang->build->last . ": <a class='code label label-badge label-light' id='lastBuildBtn'>" . $lastBuild->name . "</a></div>";
|
||||
}
|
||||
|
||||
/**
|
||||
* Link stories.
|
||||
*
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -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'> <?php echo $lang->build->last . ': <a class="code label label-badge label-light" id="lastBuildBtn">' . $lastBuild->name . '</a>';?></div>
|
||||
<?php endif;?>
|
||||
|
||||
Reference in New Issue
Block a user