* Fix bug#13385.
This commit is contained in:
@@ -1919,4 +1919,19 @@ class bug extends control
|
||||
$this->view->lines = $this->product->getLinePairs();
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Ajax get project team members.
|
||||
*
|
||||
* @param int $projectID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function ajaxGetProjectTeamMembers($projectID)
|
||||
{
|
||||
$users = $this->loadModel('user')->getPairs('noclosed');
|
||||
$teamMembers = empty($projectID) ? array() : $this->loadModel('project')->getTeamMemberPairs($projectID);
|
||||
foreach($teamMembers as $account => $member) $teamMembers[$account] = $users[$account];
|
||||
die(html::select('assignedTo', $teamMembers, '', 'class="form-control"'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -343,6 +343,7 @@ function loadProductBuilds(productID)
|
||||
*/
|
||||
function loadExecutionRelated(executionID)
|
||||
{
|
||||
executionID = parseInt(executionID);
|
||||
if(executionID)
|
||||
{
|
||||
loadExecutionTasks(executionID);
|
||||
@@ -357,6 +358,7 @@ function loadExecutionRelated(executionID)
|
||||
loadProductStories($('#product').val());
|
||||
loadProductBuilds($('#product').val());
|
||||
loadTestTasks($('#product').val());
|
||||
loadProjectTeamMembers($('#project').val());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -435,6 +437,25 @@ function loadExecutionBuilds(executionID)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Load project members.
|
||||
*
|
||||
* @param projectID $projectID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function loadProjectTeamMembers(projectID)
|
||||
{
|
||||
link = createLink('bug', 'ajaxGetProjectTeamMembers', 'projectID=' + projectID);
|
||||
$.get(link, function(data)
|
||||
{
|
||||
if(!data) data = '<select id="assignedTo" name="assignedTo" class="form-control"></select>';
|
||||
$('#assignedTo').replaceWith(data);
|
||||
$('#assignedTo_chosen').remove();
|
||||
$("#assignedTo").chosen();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Set story field.
|
||||
*
|
||||
|
||||
+15
-2
@@ -103,11 +103,18 @@ $(function()
|
||||
oldOpenedBuild = '';
|
||||
oldTaskID = $('#oldTaskID').val() || 0;
|
||||
|
||||
if($('#execution').val()) loadExecutionRelated($('#execution').val());
|
||||
if(parseInt($('#execution').val()))
|
||||
{
|
||||
loadExecutionRelated($('#execution').val());
|
||||
}
|
||||
else
|
||||
{
|
||||
if(parseInt($('#project').val())) loadProjectTeamMembers($('#project').val());
|
||||
}
|
||||
|
||||
if(!assignedto) setTimeout(function(){setAssignedTo(moduleID, productID)}, 500);
|
||||
notice();
|
||||
|
||||
|
||||
$('[data-toggle=tooltip]').tooltip();
|
||||
|
||||
/* Adjust size of bug type input group. */
|
||||
@@ -150,6 +157,12 @@ $(function()
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
$('#project').change(function()
|
||||
{
|
||||
var projectID = parseInt($(this).val());
|
||||
projectID ? loadProjectTeamMembers(projectID) : loadExecutionTeamMembers($('#product').val());
|
||||
});
|
||||
});
|
||||
|
||||
$(window).unload(function(){
|
||||
|
||||
Reference in New Issue
Block a user