feedback module
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user