diff --git a/module/bug/control.php b/module/bug/control.php index 454b49093e..8fde4f0b4d 100644 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -550,6 +550,7 @@ class bug extends control /* Get product info. */ $productID = $bug->product; $productName = $this->products[$productID]; + $branches = $this->session->currentProductType == 'normal' ? array() : $this->loadModel('branch')->getPairs($bug->product); /* Header and positon. */ $this->view->title = "BUG #$bug->id $bug->title - " . $this->products[$productID]; @@ -559,9 +560,11 @@ class bug extends control /* Assign. */ $this->view->productID = $productID; $this->view->productName = $productName; + $this->view->branches = $branches; $this->view->modulePath = $this->tree->getParents($bug->module); + $this->view->bugModule = empty($bug->module) ? '' : $this->tree->getById($bug->module); $this->view->bug = $bug; - $this->view->branchName = $this->session->currentProductType == 'normal' ? '' : $this->loadModel('branch')->getById($bug->branch, $bug->product); + $this->view->branchName = $this->session->currentProductType == 'normal' ? '' : zget($branches, $bug->branch, ''); $this->view->users = $this->user->getPairs('noletter'); $this->view->actions = $this->action->getList('bug', $bugID); $this->view->builds = $this->loadModel('build')->getProductBuildPairs($productID, $branch = 0, $params = ''); diff --git a/module/bug/view/view.html.php b/module/bug/view/view.html.php index 72c51ad4de..3810f677fd 100644 --- a/module/bug/view/view.html.php +++ b/module/bug/view/view.html.php @@ -123,16 +123,22 @@ } else { - foreach($modulePath as $key => $module) - { - $moduleTitle .= $module->name; - if(!common::printLink('bug', 'browse', "productID=$bug->product&branch=$module->branch&browseType=byModule¶m=$module->id", $module->name)) echo $module->name; - if(isset($modulePath[$key + 1])) - { - $moduleTitle .= '/'; - echo $lang->arrow; - } - } + if($bugModule->branch and isset($branches[$bugModule->branch])) + { + $moduleTitle .= $branches[$bugModule->branch] . '/'; + echo $branches[$bugModule->branch] . $lang->arrow; + } + + foreach($modulePath as $key => $module) + { + $moduleTitle .= $module->name; + if(!common::printLink('bug', 'browse', "productID=$bug->product&branch=$module->branch&browseType=byModule¶m=$module->id", $module->name)) echo $module->name; + if(isset($modulePath[$key + 1])) + { + $moduleTitle .= '/'; + echo $lang->arrow; + } + } } $printModule = ob_get_contents(); ob_end_clean(); diff --git a/module/story/control.php b/module/story/control.php index b2704adcbc..cb614ef09c 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -683,6 +683,7 @@ class story extends control $fromBug = $this->dao->select('id,title')->from(TABLE_BUG)->where('toStory')->eq($storyID)->fetch(); $cases = $this->dao->select('id,title')->from(TABLE_CASE)->where('story')->eq($storyID)->andWhere('deleted')->eq(0)->fetchAll(); $modulePath = $this->tree->getParents($story->module); + $storyModule = empty($story->module) ? '' : $this->tree->getById($story->module); $users = $this->user->getPairs('noletter'); /* Set the menu. */ @@ -699,23 +700,24 @@ class story extends control $position[] = $this->lang->story->common; $position[] = $this->lang->story->view; - $this->view->title = $title; - $this->view->position = $position; - $this->view->product = $product; - $this->view->branches = $product->type == 'normal' ? array() : $this->loadModel('branch')->getPairs($product->id); - $this->view->plan = $plan; - $this->view->bugs = $bugs; - $this->view->fromBug = $fromBug; - $this->view->cases = $cases; - $this->view->story = $story; - $this->view->users = $users; - $this->view->projects = $this->loadModel('project')->getPairs('nocode'); - $this->view->actions = $this->action->getList('story', $storyID); - $this->view->modulePath = $modulePath; - $this->view->version = $version == 0 ? $story->version : $version; - $this->view->preAndNext = $this->loadModel('common')->getPreAndNextObject('story', $storyID); - $this->view->from = $from; - $this->view->param = $param; + $this->view->title = $title; + $this->view->position = $position; + $this->view->product = $product; + $this->view->branches = $product->type == 'normal' ? array() : $this->loadModel('branch')->getPairs($product->id); + $this->view->plan = $plan; + $this->view->bugs = $bugs; + $this->view->fromBug = $fromBug; + $this->view->cases = $cases; + $this->view->story = $story; + $this->view->users = $users; + $this->view->projects = $this->loadModel('project')->getPairs('nocode'); + $this->view->actions = $this->action->getList('story', $storyID); + $this->view->storyModule = $storyModule; + $this->view->modulePath = $modulePath; + $this->view->version = $version == 0 ? $story->version : $version; + $this->view->preAndNext = $this->loadModel('common')->getPreAndNextObject('story', $storyID); + $this->view->from = $from; + $this->view->param = $param; $this->display(); } diff --git a/module/story/view/view.html.php b/module/story/view/view.html.php index 21df901cfa..ce2a273682 100644 --- a/module/story/view/view.html.php +++ b/module/story/view/view.html.php @@ -144,6 +144,12 @@ } else { + if($storyModule->branch and isset($branches[$storyModule->branch])) + { + $moduleTitle .= $branches[$storyModule->branch] . '/'; + echo $branches[$storyModule->branch] . $lang->arrow; + } + foreach($modulePath as $key => $module) { $moduleTitle .= $module->name; diff --git a/module/testcase/control.php b/module/testcase/control.php index 59253bc911..ec65893fe0 100644 --- a/module/testcase/control.php +++ b/module/testcase/control.php @@ -487,6 +487,7 @@ class testcase extends control if(!$case) die(js::error($this->lang->notFound) . js::locate('back')); if($from == 'testtask') $run = $this->loadModel('testtask')->getRunByCase($taskID, $caseID); + $branches = $this->session->currentProductType == 'normal' ? array() : $this->loadModel('branch')->getPairs($case->product); $isLibCase = ($case->lib and empty($case->product)); if($isLibCase) { @@ -508,7 +509,7 @@ class testcase extends control $this->view->position[] = html::a($this->createLink('testcase', 'browse', "productID=$productID"), $this->products[$productID]); $this->view->productName = $this->products[$productID]; - $this->view->branchName = $this->session->currentProductType == 'normal' ? '' : $this->loadModel('branch')->getById($case->branch); + $this->view->branchName = $this->session->currentProductType == 'normal' ? '' : zget($branches, $case->branch, ''); } $caseFails = $this->dao->select('COUNT(*) AS count')->from(TABLE_TESTRESULT) @@ -526,12 +527,14 @@ class testcase extends control $this->view->taskID = $taskID; $this->view->version = $version ? $version : $case->version; $this->view->modulePath = $this->tree->getParents($case->module); + $this->view->caseModule = empty($case->module) ? '' : $this->tree->getById($case->module); $this->view->users = $this->user->getPairs('noletter'); $this->view->actions = $this->loadModel('action')->getList('case', $caseID); $this->view->preAndNext = $this->loadModel('common')->getPreAndNextObject('testcase', $caseID); $this->view->runID = $from == 'testcase' ? 0 : $run->id; $this->view->isLibCase = $isLibCase; $this->view->caseFails = $caseFails; + $this->view->branches = $branches; $this->display(); } diff --git a/module/testcase/view/view.html.php b/module/testcase/view/view.html.php index f8e739eebe..09317f79cc 100644 --- a/module/testcase/view/view.html.php +++ b/module/testcase/view/view.html.php @@ -156,11 +156,16 @@ } else { - foreach($modulePath as $key => $module) - { - if(!common::printLink('testcase', 'browse', "productID=$case->product&branch=$module->branch&browseType=byModule¶m=$module->id", $module->name)) echo $module->name; - if(isset($modulePath[$key + 1])) echo $lang->arrow; - } + if($caseModule->branch and isset($branches[$caseModule->branch])) + { + echo $branches[$caseModule->branch] . $lang->arrow; + } + + foreach($modulePath as $key => $module) + { + if(!common::printLink('testcase', 'browse', "productID=$case->product&branch=$module->branch&browseType=byModule¶m=$module->id", $module->name)) echo $module->name; + if(isset($modulePath[$key + 1])) echo $lang->arrow; + } } ?>