+ add feature bar to my story page.
This commit is contained in:
@@ -72,7 +72,7 @@ class my extends control
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function story()
|
||||
public function story($type = 'assignedto')
|
||||
{
|
||||
/* Save session. */
|
||||
$this->session->set('storyList', $this->app->getURI(true));
|
||||
@@ -80,8 +80,9 @@ class my extends control
|
||||
/* Assign. */
|
||||
$this->view->header->title = $this->lang->my->common . $this->lang->colon . $this->lang->my->story;
|
||||
$this->view->position[] = $this->lang->my->story;
|
||||
$this->view->stories = $this->loadModel('story')->getUserStories($this->app->user->account, 'active,draft,changed');
|
||||
$this->view->stories = $this->loadModel('story')->getUserStories($this->app->user->account, $type);
|
||||
$this->view->users = $this->user->getPairs('noletter');
|
||||
$this->view->type = $type;
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
@@ -18,3 +18,8 @@ $lang->my->taskMenu->openedByMe = 'My opened';
|
||||
$lang->my->taskMenu->finishedByMe = 'My finished';
|
||||
$lang->my->taskMenu->closedByMe = 'My closed';
|
||||
$lang->my->taskMenu->canceledByMe = 'My canceled';
|
||||
|
||||
$lang->my->storyMenu->assignedToMe = 'To me';
|
||||
$lang->my->storyMenu->openedByMe = 'My opened';
|
||||
$lang->my->storyMenu->reviewedByMe = 'My reviewed';
|
||||
$lang->my->storyMenu->closedByMe = 'My closed';
|
||||
|
||||
@@ -18,3 +18,8 @@ $lang->my->taskMenu->openedByMe = '由我创建';
|
||||
$lang->my->taskMenu->finishedByMe = '由我完成';
|
||||
$lang->my->taskMenu->closedByMe = '由我关闭';
|
||||
$lang->my->taskMenu->canceledByMe = '由我取消';
|
||||
|
||||
$lang->my->storyMenu->assignedToMe = '指派给我';
|
||||
$lang->my->storyMenu->openedByMe = '由我创建';
|
||||
$lang->my->storyMenu->reviewedByMe = '由我评审';
|
||||
$lang->my->storyMenu->closedByMe = '由我关闭';
|
||||
|
||||
@@ -12,6 +12,18 @@
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<?php include '../../common/view/tablesorter.html.php';?>
|
||||
<div class='yui-d0'>
|
||||
<div id='featurebar'>
|
||||
<div class='f-left'>
|
||||
<?php
|
||||
echo "<span id='assignedtoTab'>" . html::a(inlink('story', "type=assignedto"), $lang->my->storyMenu->assignedToMe) . "</span>";
|
||||
echo "<span id='openedbyTab'>" . html::a(inlink('story', "type=openedby"), $lang->my->storyMenu->openedByMe) . "</span>";
|
||||
echo "<span id='reviewedbyTab'>" . html::a(inlink('story', "type=reviewedby"), $lang->my->storyMenu->reviewedByMe) . "</span>";
|
||||
echo "<span id='closedbyTab'>" . html::a(inlink('story', "type=closedby"), $lang->my->storyMenu->closedByMe) . "</span>";
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class='yui-d0'>
|
||||
<table class='table-1 tablesorter'>
|
||||
<thead>
|
||||
@@ -53,4 +65,5 @@
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<script language='javascript'>$("#<?php echo $type;?>Tab").addClass('active');</script>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
|
||||
@@ -581,20 +581,24 @@ class storyModel extends model
|
||||
* Get stories of a user.
|
||||
*
|
||||
* @param string $account
|
||||
* @param string $status
|
||||
* @param string $type the query type
|
||||
* @param string $orderBy
|
||||
* @param object $pager
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getUserStories($account, $status = 'all', $orderBy = 'id_desc', $pager = null)
|
||||
public function getUserStories($account, $type = 'assignedto', $orderBy = 'id_desc', $pager = null)
|
||||
{
|
||||
$type = strtolower($type);
|
||||
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)
|
||||
->andWhere('t1.deleted')->eq(0)
|
||||
->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()
|
||||
->orderBy($orderBy)->page($pager)->fetchAll();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user