diff --git a/module/bug/control.php b/module/bug/control.php index 63ad48afc3..ba5f620cbc 100644 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -207,13 +207,20 @@ class bug extends control $showModule = !empty($this->config->datatable->bugBrowse->showModule) ? $this->config->datatable->bugBrowse->showModule : ''; $productName = ($productID and isset($this->products[$productID])) ? $this->products[$productID] : $this->lang->product->allProduct; + + $product = $this->product->getById($productID); + if($product and $product->type != 'normal') + { + $this->app->loadLang('datatable'); + $this->lang->datatable->showBranch = sprintf($this->lang->datatable->showBranch, $this->lang->product->branchName[$product->type]); + } /* Set view. */ $this->view->title = $productName . $this->lang->colon . $this->lang->bug->common; $this->view->position[] = html::a($this->createLink('bug', 'browse', "productID=$productID"), $productName,'','title=' . $productName); $this->view->position[] = $this->lang->bug->common; $this->view->productID = $productID; - $this->view->product = $this->product->getById($productID); + $this->view->product = $product; $this->view->projectProducts = $this->product->getProducts($this->projectID); $this->view->productName = $productName; $this->view->builds = $this->loadModel('build')->getProductBuildPairs($productID); diff --git a/module/bug/model.php b/module/bug/model.php index 8e8b91b1a1..997097fafb 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -2751,7 +2751,8 @@ class bugModel extends model echo "" . zget($this->lang->bug->confirmedList, $bug->confirmed, $bug->confirmed) . " "; break; case 'title': - if($bug->branch and isset($branches[$bug->branch])) echo "{$branches[$bug->branch]} "; + $showBranch = isset($this->config->bug->browse->showBranch) ? $this->config->bug->browse->showBranch : 1; + if($bug->branch and isset($branches[$bug->branch]) and $showBranch) echo "{$branches[$bug->branch]} "; if($bug->module and isset($modulePairs[$bug->module])) echo "{$modulePairs[$bug->module]} "; echo $canView ? html::a($bugLink, $bug->title, null, "style='color: $bug->color'") : "{$bug->title}"; break; diff --git a/module/common/view/datatable.fix.html.php b/module/common/view/datatable.fix.html.php index 59b8a22120..fa7c745e7f 100644 --- a/module/common/view/datatable.fix.html.php +++ b/module/common/view/datatable.fix.html.php @@ -1,4 +1,7 @@ -moduleName . ucfirst($this->methodName);?> +moduleName;?> +methodName;?> +moduleName . ucfirst($this->methodName);?> + @@ -37,6 +40,8 @@ $(function() { if('app->user->account?>' == 'guest') return; datatableId = ''; + currentModule = ''; + currentMethod = ''; var value = $('#showModuleModal input[name="showModule"]:checked').val(); var allModule = $('#showModuleModal input[name="showAllModule"]:checked').val(); var showBranch = $('#showModuleModal input[name="showBranch"]:checked').val(); @@ -53,6 +58,8 @@ $(function() value: value, allModule: allModule, showBranch: showBranch, + currentModule: currentModule, + currentMethod: currentMethod, }, success:function(){window.location.reload();}, url: 'createLink('datatable', 'ajaxSave')?>' @@ -98,10 +105,10 @@ $(function() datatable->showAllModuleList, isset($config->execution->task->allModule) ? $config->execution->task->allModule : 0);?> - app->tab == 'product' and $app->moduleName == 'product' and $app->methodName == 'browse'):?> + app->tab == 'product' or $this->app->tab == 'qa'):?> datatable->showBranch;?> - datatable->showBranchList, isset($config->product->browse->showBranch) ? $config->product->browse->showBranch : 1);?> + datatable->showBranchList, isset($config->$currentModule->$currentMethod->showBranch) ? $config->$currentModule->$currentMethod->showBranch : 1);?> diff --git a/module/datatable/control.php b/module/datatable/control.php index 76c526121f..d625a087f7 100644 --- a/module/datatable/control.php +++ b/module/datatable/control.php @@ -38,7 +38,7 @@ class datatable extends control $name = 'datatable.' . $this->post->target . '.' . $this->post->name; $this->loadModel('setting')->setItem($account . '.' . $name, $this->post->value); if($this->post->allModule !== false) $this->setting->setItem("$account.execution.task.allModule", $this->post->allModule); - if($this->post->showBranch !== false) $this->setting->setItem("$account.product.browse.showBranch", $this->post->showBranch); + if($this->post->showBranch !== false) $this->setting->setItem($account . '.' . $this->post->currentModule . '.' . $this->post->currentMethod . '.showBranch', $this->post->showBranch); if($this->post->global) $this->setting->setItem('system.' . $name, $this->post->value); if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => 'dao error.')); diff --git a/module/product/control.php b/module/product/control.php index f1628fdda8..571b2eba51 100644 --- a/module/product/control.php +++ b/module/product/control.php @@ -210,7 +210,6 @@ class product extends control $pager = new pager($recTotal, $recPerPage, $pageID); $product = $this->product->getById($productID); - if($product and $product->type != 'normal') { $this->app->loadLang('datatable'); @@ -273,7 +272,6 @@ class product extends control $this->product->buildSearchForm($productID, $this->products, $queryID, $actionURL); $showModule = !empty($this->config->datatable->productBrowse->showModule) ? $this->config->datatable->productBrowse->showModule : ''; - $this->view->modulePairs = $showModule ? $this->tree->getModulePairs($productID, 'story', $showModule) : array(); $productName = ($this->app->rawModule == 'projectstory' and empty($productID)) ? $this->lang->product->all : $this->products[$productID]; @@ -311,6 +309,7 @@ class product extends control $this->view->projectProducts = isset($projectProducts) ? $projectProducts : array(); $this->view->storyType = $storyType; $this->view->from = $this->app->tab; + $this->view->modulePairs = $showModule ? $this->tree->getModulePairs($productID, 'story', $showModule) : array(); $this->display(); } diff --git a/module/testcase/control.php b/module/testcase/control.php index 1e8d94ad14..ff0c0e39bb 100644 --- a/module/testcase/control.php +++ b/module/testcase/control.php @@ -174,7 +174,6 @@ class testcase extends control $this->testcase->buildSearchForm($productID, $this->products, $queryID, $actionURL); $showModule = !empty($this->config->datatable->testcaseBrowse->showModule) ? $this->config->datatable->testcaseBrowse->showModule : ''; - $this->view->modulePairs = $showModule ? $this->tree->getModulePairs($productID, 'case', $showModule) : array(); /* Get module tree.*/ if($projectID and empty($productID)) @@ -186,13 +185,20 @@ class testcase extends control $moduleTree = $this->tree->getTreeMenu($productID, $viewType = 'case', $startModuleID = 0, array('treeModel', 'createCaseLink'), '', $branch); } + $product = $this->product->getById($productID); + if($product and $product->type != 'normal') + { + $this->app->loadLang('datatable'); + $this->lang->datatable->showBranch = sprintf($this->lang->datatable->showBranch, $this->lang->product->branchName[$product->type]); + } + /* Assign. */ $tree = $moduleID ? $this->tree->getByID($moduleID) : ''; $this->view->title = $this->products[$productID] . $this->lang->colon . $this->lang->testcase->common; $this->view->position[] = html::a($this->createLink('testcase', 'browse', "productID=$productID&branch=$branch"), $this->products[$productID]); $this->view->position[] = $this->lang->testcase->common; $this->view->productID = $productID; - $this->view->product = $this->product->getById($productID); + $this->view->product = $product; $this->view->productName = $this->products[$productID]; $this->view->modules = $this->tree->getOptionMenu($productID, $viewType = 'case', $startModuleID = 0, $branch); $this->view->moduleTree = $moduleTree; @@ -211,6 +217,7 @@ class testcase extends control $this->view->suiteList = $this->loadModel('testsuite')->getSuites($productID); $this->view->suiteID = $suiteID; $this->view->setModule = true; + $this->view->modulePairs = $showModule ? $this->tree->getModulePairs($productID, 'case', $showModule) : array(); $this->display(); } diff --git a/module/testcase/model.php b/module/testcase/model.php index ad374b9e53..b02a3c74b3 100644 --- a/module/testcase/model.php +++ b/module/testcase/model.php @@ -1521,7 +1521,8 @@ class testcaseModel extends model echo ""; break; case 'title': - if($case->branch) echo "{$branches[$case->branch]} "; + $showBranch = isset($this->config->testcase->browse->showBranch) ? $this->config->testcase->browse->showBranch : 1; + if($case->branch and $showBranch) echo "{$branches[$case->branch]} "; if($modulePairs and $case->module and isset($modulePairs[$case->module])) echo "{$modulePairs[$case->module]} "; echo $canView ? ($fromCaseID ? html::a($caseLink, $case->title, null, "style='color: $case->color' data-app='{$this->app->tab}'") . html::a(helper::createLink('testcase', 'view', "caseID=$fromCaseID"), "[#$fromCaseID]", '', "data-app='{$this->app->tab}'") : html::a($caseLink, $case->title, null, "style='color: $case->color' data-app='{$this->app->tab}'")) : "$case->title"; break;