Merge branch '15.0'
This commit is contained in:
+16
-1
@@ -395,7 +395,7 @@ class bug extends control
|
||||
|
||||
if($this->app->openApp == 'execution')
|
||||
{
|
||||
$location = $this->createLink('execution', 'bug', "executionID={$output['executionID']}");
|
||||
$location = $this->session->bugList ? $this->session->bugList : $this->createLink('execution', 'bug', "executionID={$output['executionID']}");
|
||||
}
|
||||
elseif($this->app->openApp == 'project')
|
||||
{
|
||||
@@ -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(){
|
||||
|
||||
@@ -18,7 +18,7 @@ $lang->bug->productplan = '所屬' . '計劃';
|
||||
$lang->bug->module = '所屬模組';
|
||||
$lang->bug->moduleAB = '模組';
|
||||
$lang->bug->project = '所屬項目';
|
||||
$lang->bug->execution = '所屬' . $lang->executionCommon;
|
||||
$lang->bug->execution = '所屬' . $lang->execution->common;
|
||||
$lang->bug->story = "相關需求";
|
||||
$lang->bug->storyVersion = "{$lang->SRCommon}版本";
|
||||
$lang->bug->color = '標題顏色';
|
||||
|
||||
@@ -187,7 +187,10 @@ class bugModel extends model
|
||||
|
||||
foreach($extendFields as $extendField)
|
||||
{
|
||||
$bug->{$extendField->field} = htmlspecialchars($this->post->{$extendField->field}[$i]);
|
||||
$bug->{$extendField->field} = $this->post->{$extendField->field}[$i];
|
||||
if(is_array($bug->{$extendField->field})) $bug->{$extendField->field} = join(',', $bug->{$extendField->field});
|
||||
|
||||
$bug->{$extendField->field} = htmlspecialchars($bug->{$extendField->field});
|
||||
$message = $this->checkFlowRule($extendField, $bug->{$extendField->field});
|
||||
if($message) die(js::alert($message));
|
||||
}
|
||||
@@ -731,7 +734,10 @@ class bugModel extends model
|
||||
|
||||
foreach($extendFields as $extendField)
|
||||
{
|
||||
$bug->{$extendField->field} = htmlspecialchars($this->post->{$extendField->field}[$bugID]);
|
||||
$bug->{$extendField->field} = $this->post->{$extendField->field}[$bugID];
|
||||
if(is_array($bug->{$extendField->field})) $bug->{$extendField->field} = join(',', $bug->{$extendField->field});
|
||||
|
||||
$bug->{$extendField->field} = htmlspecialchars($bug->{$extendField->field});
|
||||
$message = $this->checkFlowRule($extendField, $bug->{$extendField->field});
|
||||
if($message) die(js::alert($message));
|
||||
}
|
||||
|
||||
@@ -259,25 +259,26 @@ js::set('confirmUnlinkBuild' , sprintf($lang->bug->confirmUnlinkBuild, zget(
|
||||
<th class='thWidth'><?php echo $lang->bug->linkBug;?></th>
|
||||
<td><?php echo html::a($this->createLink('bug', 'linkBugs', "bugID=$bug->id", '', true), $lang->bug->linkBugs, '', "class='text-primary' data-toggle='modal' data-type='iframe' data-width='95%'");?></td>
|
||||
</tr>
|
||||
<?php if(isset($bug->linkBugTitles)):?>
|
||||
<tr>
|
||||
<th></th>
|
||||
<td>
|
||||
<ul class='list-unstyled'>
|
||||
<?php
|
||||
foreach($bug->linkBugTitles as $linkBugID => $linkBugTitle)
|
||||
if(isset($bug->linkBugTitles))
|
||||
{
|
||||
echo "<li><div class='checkbox-primary'>";
|
||||
echo "<input type='checkbox' checked='checked' name='linkBug[]' value=$linkBugID />";
|
||||
echo "<label>#{$linkBugID} {$linkBugTitle}</label>";
|
||||
echo '</div></li>';
|
||||
foreach($bug->linkBugTitles as $linkBugID => $linkBugTitle)
|
||||
{
|
||||
echo "<li><div class='checkbox-primary'>";
|
||||
echo "<input type='checkbox' checked='checked' name='linkBug[]' value=$linkBugID />";
|
||||
echo "<label>#{$linkBugID} {$linkBugTitle}</label>";
|
||||
echo '</div></li>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
<span id='linkBugsBox'></span>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endif;?>
|
||||
<tr>
|
||||
<th><?php echo $lang->bug->testtask;?></th>
|
||||
<td id='testtaskBox'><?php echo html::select('testtask', $testtasks, $bug->testtask, 'class="form-control chosen"');?></td>
|
||||
|
||||
Reference in New Issue
Block a user