diff --git a/module/bug/control.php b/module/bug/control.php index 15f3c99f5a..c4d8498a8c 100644 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -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); + } } diff --git a/module/bug/js/edit.js b/module/bug/js/edit.js index 2669cde048..1068899348 100644 --- a/module/bug/js/edit.js +++ b/module/bug/js/edit.js @@ -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); + }) + }) }); /** diff --git a/module/bug/view/edit.html.php b/module/bug/view/edit.html.php index cb873e9887..4872fc2ac6 100644 --- a/module/bug/view/edit.html.php +++ b/module/bug/view/edit.html.php @@ -194,7 +194,7 @@ if($this->app->tab == 'project') js::set('objectID', $bug->project); - bug->execution;?> + bug->execution;?> execution, "class='form-control chosen' onchange='loadExecutionRelated(this.value)'");?> diff --git a/module/bug/view/view.html.php b/module/bug/view/view.html.php index 5b4cd02e67..62f68d60af 100644 --- a/module/bug/view/view.html.php +++ b/module/bug/view/view.html.php @@ -281,7 +281,7 @@ - bug->execution;?> + model) and $project->model == 'kanban') ? $lang->bug->kanban : $lang->bug->execution;?> execution) echo html::a($this->createLink('execution', 'browse', "executionID=$bug->execution"), $bug->executionName);?>