From 09aa6eb818bd0ff4e9cdd3aac46a10a69fb3f170 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Wed, 29 Jul 2015 17:24:43 +0800 Subject: [PATCH] * fix a bug #711. --- module/story/control.php | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/module/story/control.php b/module/story/control.php index a9b1ed583a..e981583dca 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -93,20 +93,17 @@ class story extends control } /* Set products, users and module. */ - if($productID != 0) + if($projectID != 0) { - $product = $this->product->getById($productID); - $products = $this->product->getPairs(); + $products = $this->product->getProductsByProject($projectID); + $product = $this->product->getById(($productID and array_key_exists($productID, $products)) ? $productID : key($products)); } else { - $products = $this->product->getProductsByProject($projectID); - foreach($products as $key => $title) - { - $product = $this->product->getById($key); - break; - } + $products = $this->product->getPairs(); + $product = $this->product->getById($productID ? $productID : key($products)); } + $users = $this->user->getPairs('nodeleted|pdfirst|noclosed'); $moduleOptionMenu = $this->tree->getOptionMenu($productID, $viewType = 'story');