diff --git a/module/execution/control.php b/module/execution/control.php index 218b446514..bec99166b1 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -803,7 +803,7 @@ class execution extends control $this->view->orderBy = $orderBy; $this->view->type = $this->session->executionStoryBrowseType; $this->view->param = $param; - $this->view->moduleTree = $this->loadModel('tree')->getProjectStoryTreeMenu($executionID, $startModuleID = 0, array('treeModel', 'createExecutionStoryLink')); + $this->view->moduleTree = $this->loadModel('tree')->getExecutionStoryTreeMenu($executionID, $startModuleID = 0, array('treeModel', 'createExecutionStoryLink')); $this->view->tabID = 'story'; $this->view->storyTasks = $storyTasks; $this->view->storyBugs = $storyBugs; diff --git a/module/product/control.php b/module/product/control.php index ac5957a401..97f1463622 100644 --- a/module/product/control.php +++ b/module/product/control.php @@ -132,7 +132,7 @@ class product extends control $this->loadModel('execution'); /* Set product, module and query. */ - $productID = $this->product->saveState($productID, $this->products); + $productID = $this->app->rawModule != 'projectstory' ? $this->product->saveState($productID, $this->products) : $productID; $branch = ($branch === '') ? (int)$this->cookie->preBranch : (int)$branch; setcookie('preProductID', $productID, $this->config->cookieLife, $this->config->webRoot, '', false, true); setcookie('preBranch', (int)$branch, $this->config->cookieLife, $this->config->webRoot, '', false, true); @@ -174,11 +174,25 @@ class product extends control { setcookie('treeBranch', (int)$branch, 0, $this->config->webRoot, '', false, false); $browseType = 'unclosed'; - $moduleTree = $this->tree->getTreeMenu($productID, 'story', $startModuleID = 0, array('treeModel', $createModuleLink), '', $branch, "¶m=$param&storyType=$storyType"); + if($this->app->rawModule == 'projectstory' and empty($productID)) + { + $moduleTree = $this->tree->getExecutionStoryTreeMenu($this->session->PRJ, 0, array('treeModel', 'createProjectStoryLink')); + } + else + { + $moduleTree = $this->tree->getTreeMenu($productID, 'story', $startModuleID = 0, array('treeModel', $createModuleLink), '', $branch, "¶m=$param&storyType=$storyType"); + } } else { - $moduleTree = $this->tree->getTreeMenu($productID, 'story', $startModuleID = 0, array('treeModel', $createModuleLink), '', (int)$this->cookie->treeBranch, "¶m=$param&storyType=$storyType"); + if($this->app->rawModule == 'projectstory' and empty($productID)) + { + $moduleTree = $this->tree->getExecutionStoryTreeMenu($this->session->PRJ, 0, array('treeModel', 'createProjectStoryLink')); + } + else + { + $moduleTree = $this->tree->getTreeMenu($productID, 'story', $startModuleID = 0, array('treeModel', $createModuleLink), '', (int)$this->cookie->treeBranch, "¶m=$param&storyType=$storyType"); + } } if($browseType != 'bymodule' and $browseType != 'bybranch') $this->session->set('storyBrowseType', $browseType); @@ -201,7 +215,7 @@ class product extends control $stories = $this->product->getStories($productID, $branch, $browseType, $queryID, $moduleID, $storyType, $sort, $pager); if($this->app->rawModule == 'projectstory') { - $this->session->set('currentProductType', $product->type); + if(!empty($product)) $this->session->set('currentProductType', $product->type); $projectProducts = $this->product->getProducts($this->session->PRJ); $productPlans = $this->execution->getPlans($projectProducts); @@ -244,13 +258,15 @@ 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(); + $productName = ($this->app->rawModule == 'projectstory' and empty($productID)) ? $this->lang->product->all : $this->products[$productID]; + /* Assign. */ - $this->view->title = $this->products[$productID]. $this->lang->colon . $this->lang->product->browse; - $this->view->position[] = $this->products[$productID]; + $this->view->title = $productName . $this->lang->colon . $this->lang->product->browse; + $this->view->position[] = $productName; $this->view->position[] = $this->lang->product->browse; $this->view->productID = $productID; $this->view->product = $product; - $this->view->productName = $this->products[$productID]; + $this->view->productName = $productName; $this->view->moduleID = $moduleID; $this->view->stories = $stories; $this->view->plans = $this->loadModel('productplan')->getPairs($productID, $branch, '', true); diff --git a/module/product/model.php b/module/product/model.php index a81c632fcd..90a25c7106 100644 --- a/module/product/model.php +++ b/module/product/model.php @@ -823,9 +823,18 @@ class productModel extends model { $this->config->product->search['actionURL'] = $actionURL; $this->config->product->search['queryID'] = $queryID; - $this->config->product->search['params']['plan']['values'] = $this->loadModel('productplan')->getPairs($productID); - $this->config->product->search['params']['product']['values'] = array($productID => $products[$productID], 'all' => $this->lang->product->allProduct); - $this->config->product->search['params']['module']['values'] = $this->loadModel('tree')->getOptionMenu($productID, $viewType = 'story', $startModuleID = 0); + $this->config->product->search['params']['plan']['values'] = $this->loadModel('productplan')->getPairs($productID); + + if($this->app->rawModule == 'projectstory' and empty($productID)) + { + $this->config->product->search['params']['product']['values'] = array('all' => $this->lang->product->allProduct, 'all' => $this->lang->product->allProduct); + } + else + { + $this->config->product->search['params']['product']['values'] = array($productID => $products[$productID], 'all' => $this->lang->product->allProduct); + } + + $this->config->product->search['params']['module']['values'] = $this->loadModel('tree')->getOptionMenu($productID, $viewType = 'story', $startModuleID = 0); if($this->session->currentProductType == 'normal') { unset($this->config->product->search['fields']['branch']); diff --git a/module/product/view/browse.html.php b/module/product/view/browse.html.php index 2526773b87..1982955bcc 100644 --- a/module/product/view/browse.html.php +++ b/module/product/view/browse.html.php @@ -51,6 +51,7 @@ $isProjectStory = $this->app->rawModule == 'projectstory';