From 02ce779b654fbb25689212e009d37c2f979aaf17 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Thu, 26 Nov 2015 13:29:29 +0800 Subject: [PATCH] * adjust code. --- module/project/control.php | 15 ++++++++------- module/project/view/linkstory.html.php | 8 ++++++-- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/module/project/control.php b/module/project/control.php index 96493640f6..23c6602d4b 100644 --- a/module/project/control.php +++ b/module/project/control.php @@ -1537,10 +1537,10 @@ class project extends control $queryID = ($browseType == 'bySearch') ? (int)$param : 0; - $allBranches = $this->loadModel('branch')->getByProducts(array_keys($products), 'noempty'); - $branchPairs = array(); - $productType = 'normal'; - $productNum = count($products); + $branchGroups = $this->loadModel('branch')->getByProducts(array_keys($products), 'noempty'); + $branchPairs = array(); + $productType = 'normal'; + $productNum = count($products); foreach($products as $product) { $productPairs[$product->id] = $product->name; @@ -1550,11 +1550,11 @@ class project extends control $productType = $product->type; if($product->branch) { - $branchPairs[$product->branch] = ($productNum > 1 ? $product->name . '/' : '') . $allBranches[$product->id][$product->branch]; + $branchPairs[$product->branch] = ($productNum > 1 ? $product->name . '/' : '') . $branchGroups[$product->id][$product->branch]; } else { - $productBranches = $allBranches[$product->id]; + $productBranches = $branchGroups[$product->id]; if($productNum > 1) { foreach($productBranches as $branchID => $branchName) $productBranches[$branchID] = $product->name . '/' . $branchName; @@ -1606,8 +1606,9 @@ class project extends control $this->view->allStories = $allStories; $this->view->prjStories = $prjStories; $this->view->browseType = $browseType; + $this->view->productType = $productType; $this->view->users = $this->loadModel('user')->getPairs('noletter'); - $this->view->branchGroups = $this->loadModel('branch')->getByProducts(array_keys($products), 'noempty'); + $this->view->branchGroups = $branchGroups; $this->display(); } diff --git a/module/project/view/linkstory.html.php b/module/project/view/linkstory.html.php index b00ff22651..85121d9311 100644 --- a/module/project/view/linkstory.html.php +++ b/module/project/view/linkstory.html.php @@ -29,7 +29,9 @@ story->product;?> story->title;?> story->plan;?> - branch->common;?> + + product->branchName[$productType];?> + openedByAB;?> story->estimateAB;?> @@ -49,7 +51,9 @@ createLink('product', 'browse', "productID=$story->product&branch=$story->branch"), $products[$story->product]->name, '_blank');?> title);?> planTitle;?> + product][$story->branch])) echo $branchGroups[$story->product][$story->branch];?> + openedBy];?> estimate;?> @@ -58,7 +62,7 @@ - + ' class='text-left'>