From ce1edb39fcd91d2ca0e6df38b3b02ccd26984c47 Mon Sep 17 00:00:00 2001 From: holan20180123 <56391770@qq.com> Date: Thu, 25 Mar 2021 11:41:09 +0800 Subject: [PATCH] * Finish task #36875. --- module/bug/config.php | 2 ++ module/bug/control.php | 13 ++++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/module/bug/config.php b/module/bug/config.php index 51ff86cd7c..50edd6a927 100644 --- a/module/bug/config.php +++ b/module/bug/config.php @@ -56,6 +56,8 @@ $config->bug->editor->resolve = array('id' => 'comment', 'tools' => 'bugTools $config->bug->editor->close = array('id' => 'comment', 'tools' => 'bugTools'); $config->bug->editor->activate = array('id' => 'comment', 'tools' => 'bugTools'); +$config->bug->discardedTypes = array('interface', 'designchange', 'newfeature', 'trackthings'); + global $lang; $config->bug->search['module'] = 'bug'; $config->bug->search['fields']['title'] = $lang->bug->title; diff --git a/module/bug/control.php b/module/bug/control.php index 721969b22d..044b19c336 100644 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -287,6 +287,9 @@ class bug extends control $this->qa->setMenu($this->products, $productID); + /* Unset discarded types. */ + foreach($this->config->bug->discardedTypes as $type) unset($this->lang->bug->typeList[$type]); + /* Whether there is a object to transfer bug, for example feedback. */ $extras = str_replace(array(',', ' '), array('&', ''), $extras); parse_str($extras, $output); @@ -782,7 +785,15 @@ class bug extends control $this->bug->checkBugExecutionPriv($bug); /* Set the menu. */ - $this->bug->setMenu($this->products, $productID, $bug->branch); + if($this->app->openApp == 'project') $this->loadModel('project')->setMenu($bug->project); + if($this->app->openApp == 'execution') $this->loadModel('execution')->setMenu($bug->execution); + if($this->app->openApp == 'qa') $this->bug->setMenu($this->products, $productID, $bug->branch); + + /* Unset discarded types. */ + foreach($this->config->bug->discardedTypes as $type) + { + if($bug->type != $type) unset($this->lang->bug->typeList[$type]); + } /* Set header and position. */ $this->view->title = $this->lang->bug->edit . "BUG #$bug->id $bug->title - " . $this->products[$productID];