* adjust task #2731.
This commit is contained in:
@@ -5,25 +5,49 @@ $(function()
|
||||
})
|
||||
|
||||
/**
|
||||
* Load project builds
|
||||
*
|
||||
* @param int $productID
|
||||
* @param int $projectID
|
||||
* @param int $index
|
||||
* Set branch related.
|
||||
*
|
||||
* @param int $branchID
|
||||
* @param int $productID
|
||||
* @param int $num
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function loadProjectBuilds(productID, projectID, index)
|
||||
function setBranchRelated(branchID, productID, num)
|
||||
{
|
||||
if(projectID)
|
||||
moduleLink = createLink('tree', 'ajaxGetModules', 'productID=' + productID + '&viewType=bug&branch=' + branchID + '&num=' + num);
|
||||
$.get(moduleLink, function(modules)
|
||||
{
|
||||
link = createLink('build', 'ajaxGetProjectBuilds', 'projectID=' + projectID + '&productID=' + productID + "&varName=openedBuilds&build=&branch=" + branch + "&index=" + index);
|
||||
}
|
||||
else
|
||||
{
|
||||
link = createLink('build', 'ajaxGetProductBuilds', 'productID=' + productID + "&varName=openedBuilds&build=&branch=" + branch + "&index=" + index);
|
||||
}
|
||||
if(!modules) modules = '<select id="modules' + num + '" name="modules[' + num + ']" class="form-control"></select>';
|
||||
$('#modules' + num).replaceWith(modules);
|
||||
$("#modules" + num + "_chosen").remove();
|
||||
$("#modules" + num).chosen(defaultChosenOptions);
|
||||
});
|
||||
|
||||
projectLink = createLink('product', 'ajaxGetProjects', 'productID=' + productID + '&projectID=0&branch=' + branchID + '&num=' + num);
|
||||
$.get(projectLink, function(projects)
|
||||
{
|
||||
if(!projects) projects = '<select id="projects' + num + '" name="projects[' + num + ']" class="form-control"></select>';
|
||||
$('#projects' + num).replaceWith(projects);
|
||||
$("#projects" + num + "_chosen").remove();
|
||||
$("#projects" + num).chosen(defaultChosenOptions);
|
||||
});
|
||||
|
||||
buildLink = createLink('build', 'ajaxGetProductBuilds', 'productID=' + productID + "&varName=openedBuilds&build=&branch=" + branchID + "&index=" + num);
|
||||
|
||||
setOpenedBuilds(buildLink, num);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set opened builds.
|
||||
*
|
||||
* @param string $link
|
||||
* @param int $index
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function setOpenedBuilds(link, index)
|
||||
{
|
||||
$.get(link, function(builds)
|
||||
{
|
||||
var row = $('#buildBox' + index).closest('tbody').find('tr').size()
|
||||
@@ -45,6 +69,29 @@ function loadProjectBuilds(productID, projectID, index)
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Load project builds
|
||||
*
|
||||
* @param int $productID
|
||||
* @param int $projectID
|
||||
* @param int $index
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function loadProjectBuilds(productID, projectID, index)
|
||||
{
|
||||
if(projectID)
|
||||
{
|
||||
link = createLink('build', 'ajaxGetProjectBuilds', 'projectID=' + projectID + '&productID=' + productID + "&varName=openedBuilds&build=&branch=" + branch + "&index=" + index);
|
||||
}
|
||||
else
|
||||
{
|
||||
link = createLink('build', 'ajaxGetProductBuilds', 'productID=' + productID + "&varName=openedBuilds&build=&branch=" + branch + "&index=" + index);
|
||||
}
|
||||
|
||||
setOpenedBuilds(link, index);
|
||||
}
|
||||
|
||||
$(document).on('click', '.chosen-with-drop', function()
|
||||
{
|
||||
var select = $(this).prev('select');
|
||||
|
||||
@@ -79,7 +79,7 @@ foreach(explode(',', $showFields) as $field)
|
||||
?>
|
||||
<tr class='text-center'>
|
||||
<td><?php echo $i+1;?></td>
|
||||
<td class='text-left<?php echo zget($visibleFields, $product->type, ' hidden')?>'><?php echo html::select("branches[$i]", $branches, $branch, "class='form-control'");?></td>
|
||||
<td class='text-left<?php echo zget($visibleFields, $product->type, ' hidden')?>'><?php echo html::select("branches[$i]", $branches, $branch, "class='form-control' onchange='setBranchRelated(this.value, $productID, $i)'");?></td>
|
||||
<td class='text-left<?php echo zget($visibleFields, 'module', ' hidden')?>' style='overflow:visible'><?php echo html::select("modules[$i]", $moduleOptionMenu, $moduleID, "class='form-control chosen'");?></td>
|
||||
<td class='text-left<?php echo zget($visibleFields, 'project', ' hidden')?>' style='overflow:visible'><?php echo html::select("projects[$i]", $projects, $projectID, "class='form-control chosen' onchange='loadProjectBuilds($productID, this.value, $i)'");?></td>
|
||||
<td class='text-left' style='overflow:visible' id='buildBox<?php echo $i;?>'><?php echo html::select("openedBuilds[$i][]", $builds, 'trunk', "class='form-control chosen' multiple");?></td>
|
||||
@@ -112,7 +112,7 @@ foreach(explode(',', $showFields) as $field)
|
||||
?>
|
||||
<tr class='text-center'>
|
||||
<td><?php echo $i+1;?></td>
|
||||
<td class='text-left<?php echo zget($visibleFields, $product->type, ' hidden')?>'><?php echo html::select("branches[$i]", $branches, $branch, "class='form-control'");?></td>
|
||||
<td class='text-left<?php echo zget($visibleFields, $product->type, ' hidden')?>'><?php echo html::select("branches[$i]", $branches, $branch, "class='form-control' onchange='setBranchRelated(this.value, $productID, $i)'");?></td>
|
||||
<td class='text-left<?php echo zget($visibleFields, 'module', ' hidden')?>' style='overflow:visible'><?php echo html::select("modules[$i]", $moduleOptionMenu, $moduleID, "class='form-control chosen'");?></td>
|
||||
<td class='text-left<?php echo zget($visibleFields, 'project', ' hidden')?>' style='overflow:visible'><?php echo html::select("projects[$i]", $projects, $projectID, "class='form-control chosen' onchange='loadProjectBuilds($productID, this.value, $i)'");?></td>
|
||||
<td class='text-left' style='overflow:visible' id='buildBox<?php echo $i;?>'><?php echo html::select("openedBuilds[$i][]", $builds, '', "class='form-control chosen' multiple");?></td>
|
||||
@@ -141,7 +141,7 @@ foreach(explode(',', $showFields) as $field)
|
||||
<tbody>
|
||||
<tr class='text-center'>
|
||||
<td>%s</td>
|
||||
<td class='text-left<?php echo zget($visibleFields, $product->type, ' hidden')?>'><?php echo html::select("branches[%s]", $branches, $branch, "class='form-control'");?></td>
|
||||
<td class='text-left<?php echo zget($visibleFields, $product->type, ' hidden')?>'><?php echo html::select("branches[%s]", $branches, $branch, "class='form-control' onchange='setBranchRelated(this.value, $productID, \"%s\")'");?></td>
|
||||
<td class='text-left<?php echo zget($visibleFields, 'module', ' hidden')?>' style='overflow:visible'><?php echo html::select("modules[%s]", $moduleOptionMenu, $moduleID, "class='form-control'");?></td>
|
||||
<td class='text-left<?php echo zget($visibleFields, 'project', ' hidden')?>' style='overflow:visible'><?php echo html::select("projects[%s]", $projects, $projectID, "class='form-control' onchange='loadProjectBuilds($productID, this.value, \"%s\")'");?></td>
|
||||
<td class='text-left' style='overflow:visible' id='buildBox%s'><?php echo html::select("openedBuilds[%s][]", $builds, '', "class='form-control' multiple");?></td>
|
||||
|
||||
Reference in New Issue
Block a user