diff --git a/framework/api/entry.class.php b/framework/api/entry.class.php index 5c89698e49..3728feb92e 100644 --- a/framework/api/entry.class.php +++ b/framework/api/entry.class.php @@ -18,6 +18,8 @@ class entry extends baseEntry { parent::__construct(); + if($this->app->action == 'options') return $this->send(204); + if(!isset($this->app->user) or $this->app->user->account == 'guest') $this->sendError(401, 'Unauthorized'); $this->dao = $this->loadModel('common')->dao; diff --git a/module/product/model.php b/module/product/model.php index 95766d7eea..2eb24d2727 100644 --- a/module/product/model.php +++ b/module/product/model.php @@ -76,7 +76,7 @@ class productModel extends model public function select($products, $productID, $currentModule, $currentMethod, $extra = '', $branch = '', $module = 0, $moduleType = '', $withBranch = true) { $isQaModule = (strpos(',project,execution,', ",{$this->app->tab},") !== false and strpos(',bug,testcase,testtask,ajaxselectstory,', ",{$this->app->rawMethod},") !== false and isset($products[0])) ? true : false; - + $isFeedbackModel = strpos(',feedback,', ",{$this->app->tab},") !== false ? true : false; if(count($products) <= 2 and isset($products[0])) { unset($products[0]); @@ -86,7 +86,7 @@ class productModel extends model if(empty($products)) return; $this->app->loadLang('product'); - if(!$isQaModule and !$productID) + if(!$isQaModule and !$productID and !$isFeedbackModel) { unset($this->lang->product->menu->settings['subMenu']->branch); return; @@ -109,6 +109,12 @@ class productModel extends model $currentProduct->name = $products[$productID]; $currentProduct->type = 'normal'; } + if($isFeedbackModel and !$productID) + { + $currentProduct = new stdclass(); + $currentProduct->name = isset($products[$productID]) ? $products[$productID] : current($products); + $currentProduct->type = 'normal'; + } $this->session->set('currentProductType', $currentProduct->type); $executionID = ($isQaModule and $this->app->tab == 'execution') ? $extra : 0; diff --git a/module/tree/control.php b/module/tree/control.php index 694fb98501..2e63786574 100644 --- a/module/tree/control.php +++ b/module/tree/control.php @@ -45,6 +45,11 @@ class tree extends control $products = $this->product->getProducts($this->session->project, 'all', '', false); if($viewType == 'case') $this->lang->modulePageNav = $this->product->select($products, $rootID, 'tree', 'browse', 'case', $branch); } + else if($this->app->tab == 'feedback') + { + $products = $this->product->getProducts(0, 'all', '', false); + if($viewType == 'feedback') $this->lang->modulePageNav = $this->product->select($products, $rootID, 'tree', 'browse', 'feedback', '', '', '', false); + } /* According to the type, set the module root and modules. */ if(strpos('story|bug|case', $viewType) !== false) @@ -131,8 +136,9 @@ class tree extends control { $this->app->loadLang('feedback'); $this->lang->tree->menu = $this->lang->feedback->menu; + $productItem = $this->product->getById($rootID); $root = new stdclass(); - $root->name = $this->lang->feedback->common; + $root->name = !empty($rootID) ? $productItem->name : $this->lang->feedback->common; $this->view->root = $root; $title = $this->lang->tree->manageFeedback; diff --git a/module/tree/view/browse.html.php b/module/tree/view/browse.html.php index b6582f2936..dc03710379 100644 --- a/module/tree/view/browse.html.php +++ b/module/tree/view/browse.html.php @@ -28,20 +28,14 @@ $name = $lang->tree->name; if($viewType == 'line') $name = $lang->tree->line; if($viewType == 'api') $name = $lang->tree->dir; if($viewType == 'doc') $name = $lang->doc->catalogName; -if($viewType == 'feedback' or $viewType == 'trainskill' or $viewType == 'trainpost') $name = $lang->tree->cate; +if($viewType == 'trainskill' or $viewType == 'trainpost') $name = $lang->tree->cate; $childTitle = $lang->tree->child; -if(strpos($viewType, 'feedback') !== false) $childTitle = $lang->tree->subCategory; if(strpos($viewType, 'doc') !== false or $viewType == 'api') $childTitle = $lang->doc->childType; if($viewType == 'line' or $viewType == 'trainskill' or $viewType == 'trainpost') $childTitle = ''; $editTitle = $lang->tree->edit; $deleteTitle = $lang->tree->delete; -if($viewType == 'feedback') -{ - $editTitle = $lang->tree->editCategory; - $deleteTitle = $lang->tree->delCategory; -} if($viewType == 'doc' or $viewType == 'api') { $editTitle = $lang->doc->editType; @@ -65,10 +59,6 @@ if($viewType == 'doc' or $viewType == 'api') { echo $lang->api->manageType . $lang->colon . $root->name; } - elseif($viewType == 'feedback') - { - echo $lang->feedback->manageCate; - } elseif($viewType == 'line') { echo $lang->tree->manageLine;