diff --git a/trunk/module/common/lang/zh-cn.php b/trunk/module/common/lang/zh-cn.php index 050ebcb1a7..e4c4ae0e69 100644 --- a/trunk/module/common/lang/zh-cn.php +++ b/trunk/module/common/lang/zh-cn.php @@ -60,6 +60,7 @@ $lang->my->menu->account = '%s' . $lang->arrow; $lang->my->menu->todo = array('link' => '我的TODO|my|todo|', 'subModule' => 'todo'); $lang->my->menu->task = '我的任务|my|task|'; $lang->my->menu->project = '我的项目|my|project|'; +$lang->my->menu->story = '我的需求|my|story|'; $lang->my->menu->bug = '我的Bug|my|bug|'; $lang->my->menu->profile = array('link' => '我的档案|my|profile|', 'alias' => 'editprofile'); $lang->todo->menu = $lang->my->menu; diff --git a/trunk/module/my/control.php b/trunk/module/my/control.php index 75e4650f79..af2bcfcdca 100644 --- a/trunk/module/my/control.php +++ b/trunk/module/my/control.php @@ -64,6 +64,23 @@ class my extends control $this->display(); } + /* 用户的story列表。*/ + public function story() + { + /* 设定header和position信息。*/ + $this->view->header->title = $this->lang->my->common . $this->lang->colon . $this->lang->my->story; + $this->view->position[] = $this->lang->my->story; + + /* 记录用户当前选择的列表。*/ + $this->app->session->set('storyList', $this->app->getURI(true)); + + /* 赋值。*/ + $this->view->stories = $this->loadModel('story')->getUserStories($this->app->user->account, 'doing,wait'); + $this->view->users = $this->user->getPairs($this->app->company->id, 'noletter'); + + $this->display(); + } + /* 用户的task列表。*/ public function task() { diff --git a/trunk/module/my/view/story.html.php b/trunk/module/my/view/story.html.php index 92d09281d4..9513408b76 100644 --- a/trunk/module/my/view/story.html.php +++ b/trunk/module/my/view/story.html.php @@ -22,6 +22,45 @@ * @link http://www.zentao.cn */ ?> - - - + + +
+ + + + + + + + + + + + + + + + + + $story):?> + + + + + + + + + + + + + + + +
story->id;?>story->pri;?>story->product;?>story->title;?>story->plan;?>story->assignedTo;?>story->openedBy;?>story->estimate;?>story->status;?>story->lastEditedDate;?>action;?>
id", sprintf('%03d', $story->id))) printf('%03d', $story->id);?>pri;?>productTitle;?>title;?>planTitle;?>assignedTo];?>openedBy];?>estimate;?>story->statusList; echo $statusList[$story->status];?>lastEditedDate, 5, 11);?> + createLink('story', 'edit', "story={$story->id}"), $lang->edit);?> + createLink('story', 'delete', "story={$story->id}&confirm=no"), $lang->delete, 'hiddenwin');?> +
+
+ diff --git a/trunk/module/story/model.php b/trunk/module/story/model.php index d35199c347..62b62f4687 100644 --- a/trunk/module/story/model.php +++ b/trunk/module/story/model.php @@ -167,6 +167,17 @@ class storyModel extends model return $this->dao->select('*')->from(TABLE_STORY)->where('plan')->eq($planID)->onCaseOf($status != 'all')->andWhere('status')->in($status)->endCase()->fetchAll(); } + /* 获得指派给某一个用户的需求列表。*/ + function getUserStories($account, $status = 'all', $orderBy = 'id|desc', $pager = null) + { + return $this->dao->select('t1.*, t2.title as planTitle, t3.name as productTitle') + ->from(TABLE_STORY)->alias('t1') + ->leftJoin(TABLE_PRODUCTPLAN)->alias('t2')->on('t1.plan = t2.id') + ->leftJoin(TABLE_PRODUCT)->alias('t3')->on('t1.product = t3.id') + ->where('t1.assignedTo')->eq($account) + ->orderBy($orderBy)->page($pager)->fetchAll(); + } + /* 格式化需求显示。*/ private function formatStories($stories) {