diff --git a/module/bug/control.php b/module/bug/control.php index a48fc1ec09..ee20c28353 100644 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -205,6 +205,7 @@ class bug extends control $this->config->bug->search['onMenuBar'] = 'yes'; $this->bug->buildSearchForm($productID, $this->products, $queryID, $actionURL); + $showBranch = isset($this->config->bug->browse->showBranch) ? $this->config->bug->browse->showBranch : 1; $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; @@ -238,6 +239,7 @@ class bug extends control $this->view->setModule = true; $this->view->isProjectBug = ($productID and !$this->projectID) ? false : true; $this->view->modulePairs = $showModule ? $this->tree->getModulePairs($productID, 'bug', $showModule) : array(); + $this->view->showBranch = $showBranch; $this->display(); } diff --git a/module/common/view/datatable.fix.html.php b/module/common/view/datatable.fix.html.php index 59b8a22120..36b079d931 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);?> + + @@ -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..c3e927356b 100644 --- a/module/product/control.php +++ b/module/product/control.php @@ -274,6 +274,7 @@ class product extends control $showModule = !empty($this->config->datatable->productBrowse->showModule) ? $this->config->datatable->productBrowse->showModule : ''; $this->view->modulePairs = $showModule ? $this->tree->getModulePairs($productID, 'story', $showModule) : array(); + $this->view->showBranch = isset($this->config->product->browse->showBranch) ? $this->config->product->browse->showBranch : 1; $productName = ($this->app->rawModule == 'projectstory' and empty($productID)) ? $this->lang->product->all : $this->products[$productID]; diff --git a/module/story/model.php b/module/story/model.php index d9054353cf..73d7bcb362 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -3610,7 +3610,7 @@ class storyModel extends model * @access public * @return void */ - public function printCell($col, $story, $users, $branches, $storyStages, $modulePairs = array(), $storyTasks = array(), $storyBugs = array(), $storyCases = array(), $mode = 'datatable', $storyType = 'story') + public function printCell($col, $story, $users, $branches, $storyStages, $modulePairs = array(), $storyTasks = array(), $storyBugs = array(), $storyCases = array(), $mode = 'datatable', $storyType = 'story', $showBranch = '') { /* Check the product is closed. */ $canBeChanged = common::canBeChanged('story', $story); @@ -3716,10 +3716,9 @@ class storyModel extends model echo ""; break; case 'title': - $showBranch = isset($this->config->product->browse->showBranch) ? $this->config->product->browse->showBranch : 1; if($storyType == 'requirement') echo 'SR '; if($story->parent > 0 and isset($story->parentName)) $story->title = "{$story->parentName} / {$story->title}"; - if(isset($branches[$story->branch]) and $showBranch) echo "{$branches[$story->branch]} "; + if(isset($branches[$story->branch]) and !empty($showBranch)) echo "{$branches[$story->branch]} "; if($story->module and isset($modulePairs[$story->module])) echo "{$modulePairs[$story->module]} "; if($story->parent > 0) echo '' . $this->lang->story->childrenAB . ' '; echo $canView ? html::a($storyLink, $story->title, '', "style='color: $story->color' data-app='$tab'") : "{$story->title}"; diff --git a/module/testcase/control.php b/module/testcase/control.php index d900def98d..51043dba74 100644 --- a/module/testcase/control.php +++ b/module/testcase/control.php @@ -175,6 +175,7 @@ class testcase extends control $showModule = !empty($this->config->datatable->testcaseBrowse->showModule) ? $this->config->datatable->testcaseBrowse->showModule : ''; $this->view->modulePairs = $showModule ? $this->tree->getModulePairs($productID, 'case', $showModule) : array(); + $this->view->showBranch = isset($this->config->testcase->browse->showBranch) ? $this->config->testcase->browse->showBranch : 1; /* Get module tree.*/ if($projectID and empty($productID))