diff --git a/module/product/control.php b/module/product/control.php index 7e99fbaf5d..fd65207862 100644 --- a/module/product/control.php +++ b/module/product/control.php @@ -238,7 +238,6 @@ class product extends control } else { - $branchID = $browseType == 'bymodule' ? 'all' : $branchID; $branches = $this->loadModel('branch')->getPairs($productID); $stories = $this->product->getStories($productID, $branchID, $browseType, $queryID, $moduleID, $storyType, $sort, $pager); } diff --git a/module/story/model.php b/module/story/model.php index 1b62c3e4e5..86745c3055 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -2608,9 +2608,9 @@ class storyModel extends model else { $productParam = ($type == 'byproduct' and $param) ? $param : $this->cookie->storyProductParam; - $branchParam = ($type == 'bybranch' and $param !== '') ? $param : $this->cookie->storyBranchParam; - $moduleParam = ($type == 'bymodule' and $param) ? $param : $this->cookie->storyModuleParam; - $modules = (empty($moduleParam) or strpos(',all,unclosed,bymodule,', ",$type,") === false) ? array() : $this->dao->select('id')->from(TABLE_MODULE)->where('path')->like("%,$moduleParam,%")->andWhere('type')->eq('story')->andWhere('deleted')->eq(0)->fetchPairs(); + $branchParam = ($type == 'bybranch' and $param !== '') ? $param : $this->cookie->storyBranchParam; + $moduleParam = ($type == 'bymodule' and $param !== '') ? $param : $this->cookie->storyModuleParam; + $modules = (empty($moduleParam) or strpos('allstory,unclosed,bymodule', "$type") === false) ? array() : $this->dao->select('id')->from(TABLE_MODULE)->where('path')->like("%,$moduleParam,%")->andWhere('type')->eq('story')->andWhere('deleted')->eq(0)->fetchPairs(); if(strpos($branchParam, ',') !== false) list($productParam, $branchParam) = explode(',', $branchParam); $unclosedStatus = $this->lang->story->statusList; diff --git a/module/tree/model.php b/module/tree/model.php index 45a42c3468..5318dcdc09 100644 --- a/module/tree/model.php +++ b/module/tree/model.php @@ -814,7 +814,7 @@ class treeModel extends model foreach($products as $id => $product) { $extra['productID'] = $id; - $projectProductLink = helper::createLink('projectstory', 'story', "projectID=$rootID&productID=$id"); + $projectProductLink = helper::createLink('projectstory', 'story', "projectID=$rootID&productID=$id&branch=all"); $executionProductLink = helper::createLink('execution', 'story', "executionID=$rootID&ordery=&status=byProduct&praram=$id"); $link = $this->app->rawModule == 'projectstory' ? $projectProductLink : $executionProductLink; if($productNum > 1) $menu .= "
  • " . html::a($link, $product, '_self', "id='product$id'"); @@ -1183,16 +1183,18 @@ class treeModel extends model /** * Create link of a test case. * - * @param object $module + * @param string $type + * @param object $module + * @param array $extra * @access public * @return string */ - public function createCaseLink($type, $module) + public function createCaseLink($type, $module, $extra = array()) { $moduleName = $this->app->tab == 'project' ? 'project' : 'testcase'; $methodName = $this->app->tab == 'project' ? 'testcase' : 'browse'; $projectParam = $this->app->tab == 'project' ? "projectID={$this->session->project}&" : ''; - return html::a(helper::createLink($moduleName, $methodName, $projectParam . "root={$module->root}&branch={$module->branch}&type=byModule¶m={$module->id}"), $module->name, '_self', "id='module{$module->id}' data-app='{$this->app->tab}' title='{$module->name}'"); + return html::a(helper::createLink($moduleName, $methodName, $projectParam . "root={$module->root}&branch={$extra['branchID']}&type=byModule¶m={$module->id}"), $module->name, '_self', "id='module{$module->id}' data-app='{$this->app->tab}' title='{$module->name}'"); } /**