From 6410641bbbf63cc8977183ca5e6dbf03b32c0251 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Mon, 28 Jul 2014 02:07:41 +0000 Subject: [PATCH] * finish task #1970. --- module/product/control.php | 1 + module/product/lang/en.php | 1 + module/product/lang/zh-cn.php | 1 + module/product/view/browse.html.php | 1 + module/story/model.php | 23 +++++++++++++++++++++++ 5 files changed, 27 insertions(+) diff --git a/module/product/control.php b/module/product/control.php index 871d8bf76e..48964b6d0e 100644 --- a/module/product/control.php +++ b/module/product/control.php @@ -136,6 +136,7 @@ class product extends control if($browseType == 'draftstory') $stories = $this->story->getByStatus($productID, 'draft', $orderBy, $pager); if($browseType == 'activestory') $stories = $this->story->getByStatus($productID, 'active', $orderBy, $pager); if($browseType == 'changedstory')$stories = $this->story->getByStatus($productID, 'changed', $orderBy, $pager); + if($browseType == 'willclose') $stories = $this->story->getWillClose($productID, $orderBy, $pager); if($browseType == 'closedstory') $stories = $this->story->getByStatus($productID, 'closed', $orderBy, $pager); /* Process the sql, get the conditon partion, save it to session. */ diff --git a/module/product/lang/en.php b/module/product/lang/en.php index cc9061dcd3..91139a83ac 100644 --- a/module/product/lang/en.php +++ b/module/product/lang/en.php @@ -74,6 +74,7 @@ $lang->product->closedByMe = 'My closed'; $lang->product->draftStory = 'Draft'; $lang->product->activeStory = 'Active'; $lang->product->changedStory = 'Changed'; +$lang->product->willClose = 'Will close'; $lang->product->closedStory = 'Closed'; $lang->product->allStory = 'All'; diff --git a/module/product/lang/zh-cn.php b/module/product/lang/zh-cn.php index 44f2583d7c..bbe529b09b 100644 --- a/module/product/lang/zh-cn.php +++ b/module/product/lang/zh-cn.php @@ -74,6 +74,7 @@ $lang->product->closedByMe = '由我关闭'; $lang->product->draftStory = '草稿'; $lang->product->activeStory = '激活'; $lang->product->changedStory = '已变更'; +$lang->product->willClose = '待关闭'; $lang->product->closedStory = '已关闭'; $lang->product->allStory = '全部需求'; diff --git a/module/product/view/browse.html.php b/module/product/view/browse.html.php index 8615869240..c4c1ed7e8e 100644 --- a/module/product/view/browse.html.php +++ b/module/product/view/browse.html.php @@ -23,6 +23,7 @@
  • inlink('browse', "productID=$productID&browseType=draftStory"), $lang->product->draftStory);?>
  • inlink('browse', "productID=$productID&browseType=activeStory"), $lang->product->activeStory);?>
  • inlink('browse', "productID=$productID&browseType=changedStory"), $lang->product->changedStory);?>
  • +
  • inlink('browse', "productID=$productID&browseType=willClose"), $lang->product->willClose);?>
  • inlink('browse', "productID=$productID&browseType=closedStory"), $lang->product->closedStory);?>
  • product->searchStory;?>
  • diff --git a/module/story/model.php b/module/story/model.php index 392dce8ac8..2de1a5681b 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -987,6 +987,29 @@ class storyModel extends model ->fetchAll(); } + /** + * Get will close stories. + * + * @param int $productID + * @param string $orderBy + * @param string $pager + * @access public + * @return array + */ + public function getWillClose($productID, $orderBy, $pager) + { + return $this->dao->select('t1.*, t2.title as planTitle') + ->from(TABLE_STORY)->alias('t1') + ->leftJoin(TABLE_PRODUCTPLAN)->alias('t2')->on('t1.plan = t2.id') + ->where('t1.product')->in($productID) + ->andWhere('t1.deleted')->eq(0) + ->andWhere('stage')->in('developed,released') + ->andWhere('status')->ne('closed') + ->orderBy($orderBy) + ->page($pager) + ->fetchAll(); + } + /** * Get stories through search. *