diff --git a/module/bug/control.php b/module/bug/control.php index 308cdea98e..00e55cdb57 100644 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -1504,15 +1504,8 @@ class bug extends control public function resolve($bugID, $extra = '') { $bug = $this->bug->getById($bugID); - if($bug->execution) - { - $execution = $this->loadModel('execution')->getByID($bug->execution); - if($execution->type == 'kanban' and $this->app->tab == 'execution') - { - $this->app->loadLang('build'); - $this->lang->build->execution = str_replace($this->lang->executionCommon, $this->lang->execution->kanban, $this->lang->build->execution); - } - } + if($bug->execution) $execution = $this->loadModel('execution')->getByID($bug->execution); + if(!empty($_POST)) { $changes = $this->bug->resolve($bugID, $extra); @@ -1584,6 +1577,7 @@ class bug extends control $this->view->executions = $this->loadModel('product')->getExecutionPairsByProduct($productID, $bug->branch ? "0,{$bug->branch}" : 0, 'id_desc', $projectID); $this->view->builds = $this->loadModel('build')->getBuildPairs($productID, $bug->branch, 'withbranch'); $this->view->actions = $this->action->getList('bug', $bugID); + $this->view->execution = isset($execution) ? $execution : ''; $this->display(); } diff --git a/module/bug/model.php b/module/bug/model.php index df9f1bc9ce..75d2d54035 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -1057,15 +1057,16 @@ class bugModel extends model if(empty($bug->buildName)) dao::$errors['buildName'][] = sprintf($this->lang->error->notempty, $this->lang->bug->placeholder->newBuildName); if(empty($bug->buildExecution)) { + $executionField = $this->lang->bug->execution; if($oldBug->execution) { $execution = $this->loadModel('execution')->getByID($oldBug->execution); if($execution->type == 'kanban' and $this->app->tab == 'execution') { - $this->lang->bug->execution = str_replace($this->lang->execution->common, $this->lang->execution->kanban, $this->lang->bug->execution); + $executionField = $this->lang->bug->kanban; } } - dao::$errors['buildExecution'][] = sprintf($this->lang->error->notempty, $this->lang->bug->execution); + dao::$errors['buildExecution'][] = sprintf($this->lang->error->notempty, $executionField); } if(dao::isError()) return false; diff --git a/module/bug/view/resolve.html.php b/module/bug/view/resolve.html.php index dcb8c8b4d3..4ce907d918 100644 --- a/module/bug/view/resolve.html.php +++ b/module/bug/view/resolve.html.php @@ -44,7 +44,7 @@ js::set('productID' , $bug->product); bug->resolvedBuild;?>
- build->execution;?> + type == 'kanban' and $app->tab == 'execution') ? $lang->bug->kanban : $lang->build->execution;?>