From 8a616cfd0b6f7cedced7a32f3684988cc58cabd2 Mon Sep 17 00:00:00 2001 From: "chencongzhi520@gmail.com" Date: Mon, 15 Apr 2013 06:59:38 +0000 Subject: [PATCH] * finish task#1303. --- module/group/lang/resource.php | 1 + module/story/model.php | 8 +++--- module/user/control.php | 35 ++++++++++++++++++++++++ module/user/view/featurebar.html.php | 7 +++-- module/user/view/story.html.php | 41 +++++++++++++++++++++++++--- 5 files changed, 81 insertions(+), 11 deletions(-) diff --git a/module/group/lang/resource.php b/module/group/lang/resource.php index 986c7ea138..956984c44f 100644 --- a/module/group/lang/resource.php +++ b/module/group/lang/resource.php @@ -528,6 +528,7 @@ $lang->resource->user->editGroup = 'editGroup'; $lang->resource->user->unlock = 'unlock'; $lang->resource->user->delete = 'delete'; $lang->resource->user->todo = 'todo'; +$lang->resource->user->story = 'story'; $lang->resource->user->task = 'task'; $lang->resource->user->bug = 'bug'; $lang->resource->user->project = 'project'; diff --git a/module/story/model.php b/module/story/model.php index 0e66c7efd8..b1aa7f599d 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -1031,10 +1031,10 @@ class storyModel extends model ->leftJoin(TABLE_PRODUCTPLAN)->alias('t2')->on('t1.plan = t2.id') ->leftJoin(TABLE_PRODUCT)->alias('t3')->on('t1.product = t3.id') ->where('t1.deleted')->eq(0) - ->beginIF($type == 'assignedto')->andWhere('assignedTo')->eq($this->app->user->account)->fi() - ->beginIF($type == 'openedby')->andWhere('openedby')->eq($this->app->user->account)->fi() - ->beginIF($type == 'reviewedby')->andWhere('reviewedby')->like('%' . $this->app->user->account . '%')->fi() - ->beginIF($type == 'closedby')->andWhere('closedby')->eq($this->app->user->account)->fi() + ->beginIF($type == 'assignedto')->andWhere('assignedTo')->eq($account)->fi() + ->beginIF($type == 'openedby')->andWhere('openedby')->eq($account)->fi() + ->beginIF($type == 'reviewedby')->andWhere('reviewedby')->like('%' . $account . '%')->fi() + ->beginIF($type == 'closedby')->andWhere('closedby')->eq($account)->fi() ->orderBy($orderBy)->page($pager)->fetchAll(); $this->loadModel('common')->saveQueryCondition($this->dao->get(), 'story'); diff --git a/module/user/control.php b/module/user/control.php index 987e4d40d1..5ced346e0a 100644 --- a/module/user/control.php +++ b/module/user/control.php @@ -92,6 +92,41 @@ class user extends control $this->display(); } + /** + * Story of a user. + * + * @param int $account + * @param int $recTotal + * @param int $recPerPage + * @param int $pageID + * @access public + * @return void + */ + public function story($account, $recTotal = 0, $recPerPage = 20, $pageID = 1) + { + /* Save session. */ + $this->session->set('storyList', $this->app->getURI(true)); + + /* Load pager. */ + $this->app->loadClass('pager', $static = true); + $pager = pager::init($recTotal, $recPerPage, $pageID); + + /* Set menu. */ + $this->lang->set('menugroup.user', 'company'); + $this->user->setMenu($this->user->getPairs('noempty|noclosed'), $account); + $this->view->userList = $this->user->setUserList($this->user->getPairs('noempty|noclosed'), $account); + + /* Assign. */ + $this->view->title = $this->lang->user->common . $this->lang->colon . $this->lang->user->story; + $this->view->position[] = $this->lang->user->story; + $this->view->stories = $this->loadModel('story')->getUserStories($account, 'assignedto', 'id_desc', $pager); + $this->view->users = $this->user->getPairs('noletter'); + $this->view->account = $account; + $this->view->pager = $pager; + + $this->display(); + } + /** * Tasks of a user. * diff --git a/module/user/view/featurebar.html.php b/module/user/view/featurebar.html.php index 30ec922ad9..dfdead8bba 100755 --- a/module/user/view/featurebar.html.php +++ b/module/user/view/featurebar.html.php @@ -6,9 +6,10 @@ $date = isset($date) ? $date : helper::today(); echo $userList . $lang->arrow; - echo ""; common::printLink('user', 'todo',"account=$account", $lang->user->todo); echo ''; - echo ""; common::printLink('user', 'task',"account=$account", $lang->user->task); echo ''; - echo "" ; common::printLink('user', 'bug', "account=$account", $lang->user->bug); echo ''; + echo ""; common::printLink('user', 'todo',"account=$account", $lang->user->todo); echo ''; + echo ""; common::printLink('user', 'story',"account=$account", $lang->user->story); echo ''; + echo ""; common::printLink('user', 'task',"account=$account", $lang->user->task); echo ''; + echo "" ; common::printLink('user', 'bug', "account=$account", $lang->user->bug); echo ''; echo ""; common::printLink('user', 'dynamic', "type=today&account=$account", $lang->user->dynamic); echo '' ; echo ""; common::printLink('user', 'project', "account=$account", $lang->user->project); echo ''; echo ""; common::printLink('user', 'profile', "account=$account", $lang->user->profile); echo ''; diff --git a/module/user/view/story.html.php b/module/user/view/story.html.php index 29dc5df125..85aaeed51e 100644 --- a/module/user/view/story.html.php +++ b/module/user/view/story.html.php @@ -4,12 +4,45 @@ * * @copyright Copyright 2009-2013 青岛易软天创网络科技有限公司 (QingDao Nature Easy Soft Network Technology Co,LTD www.cnezsoft.com) * @license LGPL (http://www.gnu.org/licenses/lgpl.html) - * @author Chunsheng Wang + * @author Congzhi Chen * @package dashboard * @version $Id$ * @link http://www.zentao.net */ ?> - - - + + + + + + + + + + + + + + + + + + + $story):?> + createLink('story', 'view', "id=$story->id");?> + + + + + + + + + + + + + + +
idAB;?> priAB;?> story->product;?> story->title;?> story->plan;?> openedByAB;?> story->estimateAB;?>statusAB;?> story->stageAB;?>
id));?>pri;?>'>pri?>productTitle;?>title);?>planTitle;?>openedBy];?>estimate;?>story->statusList[$story->status];?>story->stageList[$story->stage];?>
show();?>
+