*finished task #399
This commit is contained in:
@@ -209,7 +209,7 @@ class actionModel extends model
|
||||
* @param string $objectType
|
||||
* @param int $count
|
||||
* @access public
|
||||
* @return void
|
||||
* @return array
|
||||
*/
|
||||
public function getDynamic($account = 'all', $period = 'all', $orderBy = 'id_desc', $pager = null)
|
||||
{
|
||||
|
||||
@@ -193,6 +193,7 @@ $lang->user->menu->todo = array('link' => 'Todo|user|todo|account=%s', 'subM
|
||||
$lang->user->menu->task = 'Task|user|task|account=%s';
|
||||
$lang->user->menu->bug = 'Bug列表|user|bug|account=%s';
|
||||
$lang->user->menu->project = 'Project|user|project|account=%s';
|
||||
$lang->user->menu->dynamic = 'Dynamic|user|dynamic|account=%s';
|
||||
$lang->user->menu->profile = array('link' => 'Profile|user|profile|account=%s', 'alias' => 'edit');
|
||||
$lang->user->menu->browse = array('link' => '用户管理|company|browse|', 'float' => 'right');
|
||||
|
||||
|
||||
@@ -194,6 +194,7 @@ $lang->user->menu->todo = array('link' => 'TODO列表|user|todo|account=%s',
|
||||
$lang->user->menu->task = '任务列表|user|task|account=%s';
|
||||
$lang->user->menu->bug = 'Bug列表|user|bug|account=%s';
|
||||
$lang->user->menu->project = '项目列表|user|project|account=%s';
|
||||
$lang->user->menu->dynamic = '用户动态|user|dynamic|type=today&account=%s';
|
||||
$lang->user->menu->profile = array('link' => '用户信息|user|profile|account=%s', 'alias' => 'edit');
|
||||
$lang->user->menu->browse = array('link' => '用户管理|company|browse|', 'float' => 'right');
|
||||
|
||||
|
||||
@@ -428,4 +428,53 @@ class user extends control
|
||||
$vars = !empty($referer) ? "referer=$referer" : '';
|
||||
$this->locate($this->createLink('user', 'login', $vars));
|
||||
}
|
||||
|
||||
/**
|
||||
* My dynamic.
|
||||
*
|
||||
* @param string $type
|
||||
* @param string $orderBy
|
||||
* @param int $recTotal
|
||||
* @param int $recPerPage
|
||||
* @param int $pageID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function dynamic($period = 'today', $account = '', $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
|
||||
{
|
||||
/* set menus. */
|
||||
$this->lang->set('menugroup.user', 'company');
|
||||
$this->user->setMenu($this->user->getPairs('noempty|noclosed'), $account);
|
||||
|
||||
/* Save session. */
|
||||
$uri = $this->app->getURI(true);
|
||||
$this->session->set('productList', $uri);
|
||||
$this->session->set('productPlanList', $uri);
|
||||
$this->session->set('releaseList', $uri);
|
||||
$this->session->set('storyList', $uri);
|
||||
$this->session->set('projectList', $uri);
|
||||
$this->session->set('taskList', $uri);
|
||||
$this->session->set('buildList', $uri);
|
||||
$this->session->set('bugList', $uri);
|
||||
$this->session->set('caseList', $uri);
|
||||
$this->session->set('testtaskList', $uri);
|
||||
|
||||
/* Set the pager. */
|
||||
$this->app->loadClass('pager', $static = true);
|
||||
$pager = pager::init($recTotal, $recPerPage, $pageID);
|
||||
$this->view->orderBy = $orderBy;
|
||||
$this->view->pager = $pager;
|
||||
|
||||
$this->view->header->title = $this->lang->company->common . $this->lang->colon . $this->lang->company->dynamic;
|
||||
$this->view->position[] = $this->lang->company->dynamic;
|
||||
|
||||
/* Assign. */
|
||||
$this->view->period = $period;
|
||||
$this->view->users = $this->loadModel('user')->getPairs('nodeleted|noclosed');
|
||||
$this->view->account = $account;
|
||||
$this->view->actions = $this->loadModel('action')->getDynamic($account, $period, $orderBy, $pager);
|
||||
$this->display();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
/**
|
||||
* The action->dynamic view file of dashboard module of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2010 QingDao Nature Easy Soft Network Technology Co,LTD (www.cnezsoft.com)
|
||||
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
|
||||
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
|
||||
* @package dashboard
|
||||
* @version $Id: action->dynamic.html.php 1477 2011-03-01 15:25:50Z wwccss $
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<?php include '../../common/view/tablesorter.html.php';?>
|
||||
<div id='featurebar'>
|
||||
<?php
|
||||
echo '<span id="today">' . html::a(inlink('dynamic', "type=today&account=$account"), $lang->action->dynamic->today) . '</span>';
|
||||
echo '<span id="yesterday">' . html::a(inlink('dynamic', "type=yesterday&account=$account"), $lang->action->dynamic->yesterday) . '</span>';
|
||||
echo '<span id="twodaysago">' . html::a(inlink('dynamic', "type=twodaysago&account=$account"), $lang->action->dynamic->twoDaysAgo) . '</span>';
|
||||
echo '<span id="thisweek">' . html::a(inlink('dynamic', "type=thisweek&account=$account"), $lang->action->dynamic->thisWeek) . '</span>';
|
||||
echo '<span id="lastweek">' . html::a(inlink('dynamic', "type=lastweek&account=$account"), $lang->action->dynamic->lastWeek) . '</span>';
|
||||
echo '<span id="thismonth">' . html::a(inlink('dynamic', "type=thismonth&account=$account"), $lang->action->dynamic->thisMonth) . '</span>';
|
||||
echo '<span id="lastmonth">' . html::a(inlink('dynamic', "type=lastmonth&account=$account"), $lang->action->dynamic->lastMonth) . '</span>';
|
||||
echo '<span id="all">' . html::a(inlink('dynamic', "type=all&account=$account"), $lang->action->dynamic->all) . '</span>';
|
||||
?>
|
||||
</div>
|
||||
|
||||
<table class='table-1 colored tablesorter'>
|
||||
<?php $vars = "orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}"; ?>
|
||||
<thead>
|
||||
<tr class='colhead'>
|
||||
<th class='w-150px'><?php common::printOrderLink('date', $orderBy, $vars, $lang->action->date);?></th>
|
||||
<th class='w-user'> <?php common::printOrderLink('actor', $orderBy, $vars, $lang->action->actor);?></th>
|
||||
<th class='w-100px'><?php common::printOrderLink('action', $orderBy, $vars, $lang->action->action);?></th>
|
||||
<th class='w-80px'> <?php common::printOrderLink('objectType', $orderBy, $vars, $lang->action->objectType);?></th>
|
||||
<th class='w-id'> <?php common::printOrderLink('objectID', $orderBy, $vars, $lang->idAB);?></th>
|
||||
<th><?php echo $lang->action->objectName;?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach($actions as $action):?>
|
||||
<?php $module = $action->objectType == 'case' ? 'testcase' : $action->objectType;?>
|
||||
<tr class='a-center'>
|
||||
<td><?php echo $action->date;?></td>
|
||||
<td><?php echo $app->user->realname;?></td>
|
||||
<td><?php echo $action->actionLabel;?></td>
|
||||
<td><?php echo $lang->action->objectTypes[$action->objectType];?></td>
|
||||
<td><?php echo $action->objectID;?></td>
|
||||
<td class='a-left'><?php echo html::a($this->createLink($module, 'view', "id=$action->objectID"), $action->objectName);?></td>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
</tbody>
|
||||
<tfoot><tr><td colspan='6'><?php $pager->show();?></td></tr></tfoot>
|
||||
</table>
|
||||
<script>
|
||||
$('#<?php echo $period;?>').addClass('active')
|
||||
var period = '<?php echo $period;?>';
|
||||
</script>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
+16
-2
@@ -272,10 +272,24 @@ function saveProject()
|
||||
if($('#projectID')) $.cookie('lastProject', $('#projectID').val(), {expires:config.cookieLife, path:config.webRoot});
|
||||
}
|
||||
|
||||
/* 选择用户。*/
|
||||
/**
|
||||
* Switch account
|
||||
*
|
||||
* @param string $account
|
||||
* @param string $method
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function switchAccount(account, method)
|
||||
{
|
||||
link = createLink('user', method, 'account=' + account);
|
||||
if(method == 'dynamic')
|
||||
{
|
||||
link = createLink('user', method, 'period=' + period + '&account=' + account);
|
||||
}
|
||||
else
|
||||
{
|
||||
link = createLink('user', method, 'account=' + account);
|
||||
}
|
||||
location.href=link;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user