This commit is contained in:
zhangzilong
2022-02-08 15:50:12 +08:00
parent 395d380c05
commit ec4003a9a0
4 changed files with 32 additions and 2 deletions
+20
View File
@@ -815,6 +815,10 @@ class bug extends control
$bug = $this->bug->getById($bugID, true);
if(!$bug) return print(js::error($this->lang->notFound) . js::locate($this->createLink('qa', 'index')));
$projectID = $bug->project;
$project = new stdclass();
$project = $this->loadModel('project')->getByID($projectID);
$this->session->set('storyList', '', 'product');
$this->session->set('projectList', $this->app->getURI(true) . "#app={$this->app->tab}", 'project');
$this->bug->checkBugExecutionPriv($bug);
@@ -856,6 +860,7 @@ class bug extends control
$this->view->position[] = $this->lang->bug->view;
/* Assign. */
$this->view->project = $project;
$this->view->productID = $productID;
$this->view->branches = $branches;
$this->view->modulePath = $this->tree->getParents($bug->module);
@@ -2242,4 +2247,19 @@ class bug extends control
foreach($teamMembers as $account => $member) $teamMembers[$account] = $users[$account];
die(html::select('assignedTo', $teamMembers, '', 'class="form-control"'));
}
/**
* Ajax get execution lang.
*
* @param int $projectID
* @access public
* @return string
*/
public function ajaxGetExecutionLang($projectID)
{
$project = $this->loadModel('project')->getByID($projectID);
if($project->model == 'kanban') return print($this->lang->bug->kanban);
if($project->model != 'kanban') return print($this->lang->bug->execution);
}
}
+10
View File
@@ -19,6 +19,16 @@ $(function()
}
});
}
$('#project').change(function()
{
var projectID = $('#project').val();
var link = createLink('bug', 'ajaxGetExecutionLang', 'projectID=' + projectID);
$.post(link, function(executionLang)
{
$('#executionBox').html(executionLang);
})
})
});
/**
+1 -1
View File
@@ -194,7 +194,7 @@ if($this->app->tab == 'project') js::set('objectID', $bug->project);
</tr>
<?php endif;?>
<tr>
<th class='w-85px'><?php echo $lang->bug->execution;?></th>
<th class='w-85px' id='executionBox'><?php echo $lang->bug->execution;?></th>
<td><span id='executionIdBox'><?php echo html::select('execution', $executions, $bug->execution, "class='form-control chosen' onchange='loadExecutionRelated(this.value)'");?></span></td>
</tr>
<tr>
+1 -1
View File
@@ -281,7 +281,7 @@
</tr>
<?php endif;?>
<tr>
<th class='w-70px'><?php echo $lang->bug->execution;?></th>
<th class='w-70px'><?php echo (isset($project->model) and $project->model == 'kanban') ? $lang->bug->kanban : $lang->bug->execution;?></th>
<td><?php if($bug->execution) echo html::a($this->createLink('execution', 'browse', "executionID=$bug->execution"), $bug->executionName);?></td>
</tr>
<tr class='nofixed'>