diff --git a/module/product/control.php b/module/product/control.php index 53c247e325..c9f293d88f 100644 --- a/module/product/control.php +++ b/module/product/control.php @@ -215,6 +215,7 @@ class product extends control if($this->app->rawModule == 'projectstory') { if(!empty($product)) $this->session->set('currentProductType', $product->type); + $this->products = $this->loadModel('project')->getProducts($this->session->PRJ, false); $projectProducts = $this->product->getProducts($this->session->PRJ); $productPlans = $this->execution->getPlans($projectProducts); diff --git a/module/product/model.php b/module/product/model.php index 1ac736ebec..9274c2bb98 100644 --- a/module/product/model.php +++ b/module/product/model.php @@ -833,16 +833,18 @@ class productModel extends model $this->config->product->search['queryID'] = $queryID; $this->config->product->search['params']['plan']['values'] = $this->loadModel('productplan')->getPairs($productID); - if($this->app->rawModule == 'projectstory' and empty($productID)) + $product = ($this->app->rawModule == 'projectstory' and empty($productID)) ? $products : array($productID => $products[$productID]); + $this->config->product->search['params']['product']['values'] = $product + array('all' => $this->lang->product->allProduct); + + /* Get module of all products.*/ + $module = $this->loadModel('tree')->getOptionMenu($productID, $viewType = 'story', $startModuleID = 0); + if(!$productID) { - $this->config->product->search['params']['product']['values'] = array('all' => $this->lang->product->allProduct, 'all' => $this->lang->product->allProduct); + $module = array(); + foreach($products as $id => $product) $module += $this->loadModel('tree')->getOptionMenu($id, $viewType = 'story', $startModuleID = 0); } - else - { - $this->config->product->search['params']['product']['values'] = array($productID => $products[$productID], 'all' => $this->lang->product->allProduct); - } + $this->config->product->search['params']['module']['values'] = $module; - $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 985a97e9d3..d2192a27d7 100644 --- a/module/product/view/browse.html.php +++ b/module/product/view/browse.html.php @@ -203,7 +203,7 @@ $isProjectStory = $this->app->rawModule == 'projectstory';
- tree->manage, '', "class='btn btn-info btn-wide'");?> + tree->manage, '', "class='btn btn-info btn-wide'");?>
diff --git a/module/story/model.php b/module/story/model.php index e3992b66b5..ece2ee9f33 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -2375,7 +2375,7 @@ class storyModel extends model ->beginIF($execution->type == 'project') ->beginIF(!empty($productID))->andWhere('t1.product')->eq($productID) ->beginIF($type == 'bybranch')->andWhere('t2.branch')->eq($branch)->fi() - ->beginIF(isset($statusFeatureList) and in_array($type, array_keys($statusFeatureList)))->andWhere('t2.status')->eq($type)->fi() + ->beginIF(isset($statusFeatureList) and in_array($type, array_keys($statusFeatureList)))->andWhere('t2.status')->eq(substr($type, 0, -5))->fi() ->beginIF(isset($otherFeatureList) and in_array($type, array_keys($otherFeatureList)))->andWhere('t2.' . substr($type, 0, -2))->eq($this->app->user->account)->fi() ->beginIF($type == 'unclosed')->andWhere('t2.status')->in(array_keys($unclosedStatus))->fi() ->beginIF($type == 'willclose')->andWhere('t2.stage')->in('developed,released')->andWhere('t2.status')->ne('closed')->fi() diff --git a/module/tree/model.php b/module/tree/model.php index 895ac0ba93..2a6b8f9e78 100644 --- a/module/tree/model.php +++ b/module/tree/model.php @@ -760,7 +760,8 @@ class treeModel extends model while($module = $stmt->fetch()) { /* If not manage, ignore unused modules. */ - if(isset($executionModules[$module->id])) $this->buildTree($treeMenu, $module, 'task', $userFunc, $extra); + if(isset($executionModules[$module->id]) and $this->app->rawModule == 'execution') $this->buildTree($treeMenu, $module, 'task', $userFunc, $extra); + if($this->app->rawModule == 'projectstory') $this->buildTree($treeMenu, $module, 'task', $userFunc, $extra); } if((isset($treeMenu[0]) and $branch) or isset($executionBranches[$branch])) {