* Add order by to user view.
This commit is contained in:
@@ -148,9 +148,10 @@ $lang->group->menuOrder = $lang->company->menuOrder;
|
||||
$lang->user->menuOrder = $lang->company->menuOrder;
|
||||
|
||||
/* system menu order. */
|
||||
$lang->system->menuOrder[5] = 'company';
|
||||
$lang->system->menuOrder[10] = 'team';
|
||||
$lang->system->menuOrder[15] = 'calendar';
|
||||
$lang->system->menuOrder[5] = 'team';
|
||||
$lang->system->menuOrder[10] = 'calendar';
|
||||
$lang->system->menuOrder[15] = 'dynamic';
|
||||
$lang->system->menuOrder[20] = 'view';
|
||||
|
||||
/* admin menu order. */
|
||||
$lang->admin->menuOrder[5] = 'index';
|
||||
|
||||
@@ -554,7 +554,7 @@ $lang->admin->subMenu->system->cron = array('link' => '定时|cron|index',
|
||||
$lang->admin->subMenu->system->timezone = array('link' => '时区|custom|timezone', 'subModule' => 'custom');
|
||||
$lang->admin->subMenu->system->buildIndex = array('link' => '重建索引|search|buildindex|');
|
||||
|
||||
$lang->admin->dividerMenu = ',message,system,';
|
||||
$lang->admin->dividerMenu = ',company,message,system,';
|
||||
|
||||
$lang->convert = new stdclass();
|
||||
$lang->upgrade = new stdclass();
|
||||
|
||||
@@ -1728,7 +1728,7 @@ EOD;
|
||||
if(!defined('IN_UPGRADE') and $inProject)
|
||||
{
|
||||
/* Check program priv. */
|
||||
if($this->session->PRJ and strpos(",{$this->app->user->view->projects},", ",{$this->session->PRJ},") === false and !$this->app->user->admin) $this->loadModel('program')->accessDenied();
|
||||
if($this->session->PRJ and strpos(",{$this->app->user->view->projects},", ",{$this->session->PRJ},") === false and !$this->app->user->admin) $this->loadModel('project')->accessDenied();
|
||||
$this->resetProgramPriv($module, $method);
|
||||
if(!commonModel::hasPriv($module, $method)) $this->deny($module, $method, false);
|
||||
}
|
||||
|
||||
@@ -118,7 +118,10 @@
|
||||
{
|
||||
if(['todo', 'task', 'story', 'bug', 'testtask', 'testcase', 'execution', 'dynamic', 'profile'].includes(methodLowerCase)) return 'system';
|
||||
}
|
||||
if(moduleName === 'my') if(methodLowerCase === 'team' || methodLowerCase == 'calendar') return 'system';
|
||||
if(moduleName === 'my')
|
||||
{
|
||||
if(['todo', 'team', 'calendar'].includes(methodLowerCase)) return 'system';
|
||||
}
|
||||
if(moduleName === 'company') if(methodLowerCase === 'dynamic' || methodLowerCase == 'view') return 'system';
|
||||
if(moduleName === 'tree')
|
||||
{
|
||||
|
||||
@@ -562,15 +562,15 @@ class projectModel extends model
|
||||
* Get project pairs by model and project.
|
||||
*
|
||||
* @param string $model all|scrum|waterfall
|
||||
* @param int $projectID
|
||||
* @param int $programID
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getPairsByModel($model = 'all', $projectID = 0)
|
||||
public function getPairsByModel($model = 'all', $programID = 0)
|
||||
{
|
||||
return $this->dao->select('id, name')->from(TABLE_PROJECT)
|
||||
->where('type')->eq('project')
|
||||
->beginIF($projectID)->andWhere('parent')->eq($projectID)->fi()
|
||||
->beginIF($programID)->andWhere('parent')->eq($programID)->fi()
|
||||
->beginIF($model != 'all')->andWhere('model')->eq($model)->fi()
|
||||
->andWhere('deleted')->eq('0')
|
||||
->beginIF(!$this->app->user->admin)->andWhere('id')->in($this->app->user->view->projects)->fi()
|
||||
|
||||
@@ -399,7 +399,7 @@ class todo extends control
|
||||
$this->lang->set('menugroup.todo', $from);
|
||||
}
|
||||
|
||||
$projects = $this->loadModel('project')->getPairs();
|
||||
$projects = $this->loadModel('project')->getPairsByModel('all');
|
||||
if(!isset($this->session->PRJ)) $this->session->set('project', key($projects));
|
||||
|
||||
$this->view->title = $this->app->user->account == $todo->account ? "{$this->lang->todo->common} #$todo->id $todo->name" : $this->lang->todo->common ;
|
||||
|
||||
+11
-7
@@ -55,7 +55,7 @@ class user extends control
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function todo($userID, $type = 'today', $status = 'all', $orderBy='date,status,begin', $recTotal = 0, $recPerPage = 20, $pageID = 1)
|
||||
public function todo($userID, $type = 'today', $status = 'all', $orderBy = 'date,status,begin', $recTotal = 0, $recPerPage = 20, $pageID = 1)
|
||||
{
|
||||
$user = $this->user->getById($userID, 'id');
|
||||
if(empty($user)) die(js::error($this->lang->notFound) . js::locate('back'));
|
||||
@@ -112,7 +112,7 @@ class user extends control
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function story($userID, $storyType = 'story', $type = 'assignedTo', $recTotal = 0, $recPerPage = 20, $pageID = 1)
|
||||
public function story($userID, $storyType = 'story', $type = 'assignedTo', $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
|
||||
{
|
||||
/* Save session. */
|
||||
$this->session->set('storyList', $this->app->getURI(true));
|
||||
@@ -138,9 +138,10 @@ class user extends control
|
||||
/* 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->story->getUserStories($account, $type, 'id_desc', $pager, $storyType);
|
||||
$this->view->stories = $this->story->getUserStories($account, $type, $orderBy, $pager, $storyType);
|
||||
$this->view->users = $this->user->getPairs('noletter');
|
||||
$this->view->storyType = $storyType;
|
||||
$this->view->orderBy = $orderBy;
|
||||
$this->view->type = $type;
|
||||
$this->view->user = $user;
|
||||
$this->view->pager = $pager;
|
||||
@@ -160,7 +161,7 @@ class user extends control
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function task($userID, $type = 'assignedTo', $recTotal = 0, $recPerPage = 20, $pageID = 1)
|
||||
public function task($userID, $type = 'assignedTo', $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
|
||||
{
|
||||
/* Save the session. */
|
||||
$this->session->set('taskList', $this->app->getURI(true));
|
||||
@@ -184,8 +185,9 @@ class user extends control
|
||||
$this->view->title = $this->lang->user->common . $this->lang->colon . $this->lang->user->task;
|
||||
$this->view->position[] = $this->lang->user->task;
|
||||
$this->view->tabID = 'task';
|
||||
$this->view->tasks = $this->loadModel('task')->getUserTasks($account, $type, 0, $pager);
|
||||
$this->view->tasks = $this->loadModel('task')->getUserTasks($account, $type, 0, $pager, $orderBy);
|
||||
$this->view->type = $type;
|
||||
$this->view->orderBy = $orderBy;
|
||||
$this->view->user = $user;
|
||||
$this->view->pager = $pager;
|
||||
|
||||
@@ -233,6 +235,7 @@ class user extends control
|
||||
$this->view->bugs = $this->loadModel('bug')->getUserBugs($account, $type, $orderBy, 0, $pager);
|
||||
$this->view->type = $type;
|
||||
$this->view->user = $user;
|
||||
$this->view->orderBy = $orderBy;
|
||||
$this->view->users = $this->user->getPairs('noletter');
|
||||
$this->view->pager = $pager;
|
||||
|
||||
@@ -362,7 +365,7 @@ class user extends control
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function execution($userID, $recTotal = 0, $recPerPage = 20, $pageID = 1)
|
||||
public function execution($userID, $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
|
||||
{
|
||||
$uri = $this->app->getURI(true);
|
||||
$this->session->set('projectList', $uri);
|
||||
@@ -386,8 +389,9 @@ class user extends control
|
||||
$this->view->title = $this->lang->user->common . $this->lang->colon . $this->lang->user->execution;
|
||||
$this->view->position[] = $this->lang->user->execution;
|
||||
$this->view->tabID = 'project';
|
||||
$this->view->executions = $this->user->getProjects($account, 'execution', 'all', $pager);
|
||||
$this->view->executions = $this->user->getExecutions($account, 'execution', 'all', $orderBy, $pager);
|
||||
$this->view->user = $user;
|
||||
$this->view->orderBy = $orderBy;
|
||||
$this->view->pager = $pager;
|
||||
|
||||
$this->display();
|
||||
|
||||
@@ -1015,7 +1015,7 @@ class userModel extends model
|
||||
}
|
||||
|
||||
/**
|
||||
* Get projects a user participated.
|
||||
* Get execution a user participated.
|
||||
*
|
||||
* @param string $account
|
||||
* @param string $type project|execution
|
||||
@@ -1023,7 +1023,7 @@ class userModel extends model
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getProjects($account, $type = 'project', $status = 'all', $pager = null)
|
||||
public function getExecutions($account, $type = 'execution', $status = 'all', $orderBy, $pager = null)
|
||||
{
|
||||
if($type == 'execution') $type = 'sprint,stage';
|
||||
$myProjectsList = $this->dao->select('t1. *,t2. *')->from(TABLE_TEAM)->alias('t1')
|
||||
@@ -1035,7 +1035,7 @@ class userModel extends model
|
||||
->beginIF($status == 'openedbyme')->andWhere('openedBy')->eq($account)->fi()
|
||||
->andWhere('t1.account')->eq($account)
|
||||
->andWhere('t2.deleted')->eq(0)
|
||||
->orderBy('t2.id_desc')
|
||||
->orderBy("t2.$orderBy")
|
||||
->page($pager)
|
||||
->fetchGroup('project');
|
||||
|
||||
|
||||
@@ -34,17 +34,18 @@
|
||||
</nav>
|
||||
|
||||
<div class='main-table'>
|
||||
<table class='table has-sort-head tablesorter'>
|
||||
<table class='table has-sort-head'>
|
||||
<?php $vars = "userID={$user->id}&type=$type&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}"; ?>
|
||||
<thead>
|
||||
<tr class='text-center'>
|
||||
<th class='w-id'><?php echo $lang->idAB;?></th>
|
||||
<th class='w-severity'><?php echo $lang->bug->severityAB;?></th>
|
||||
<th class='w-pri'><?php echo $lang->priAB;?></th>
|
||||
<th class='w-type'><?php echo $lang->typeAB;?></th>
|
||||
<th class='text-left'><?php echo $lang->bug->title;?></th>
|
||||
<th class='w-90px'><?php echo $lang->openedByAB;?></th>
|
||||
<th class='w-100px'><?php echo $lang->bug->resolvedBy;?></th>
|
||||
<th class='w-100px'><?php echo $lang->bug->resolutionAB;?></th>
|
||||
<th class='w-id'> <?php common::printOrderLink('id', $orderBy, $vars, $lang->idAB);?></th>
|
||||
<th class='w-severity'><?php common::printOrderLink('severity', $orderBy, $vars, $lang->bug->severityAB);?></th>
|
||||
<th class='w-pri'> <?php common::printOrderLink('pri', $orderBy, $vars, $lang->priAB);?></th>
|
||||
<th class='w-type'> <?php common::printOrderLink('type', $orderBy, $vars, $lang->typeAB);?></th>
|
||||
<th class='text-left'> <?php common::printOrderLink('title', $orderBy, $vars, $lang->bug->title);?></th>
|
||||
<th class='w-90px'> <?php common::printOrderLink('openedBy', $orderBy, $vars, $lang->openedByAB);?></th>
|
||||
<th class='w-100px'> <?php common::printOrderLink('resolvedBy', $orderBy, $vars, $lang->bug->resolvedBy);?></th>
|
||||
<th class='w-100px'> <?php common::printOrderLink('resolution', $orderBy, $vars, $lang->bug->resolutionAB);?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
@@ -15,17 +15,18 @@
|
||||
<?php include './featurebar.html.php';?>
|
||||
<div id='mainContent'>
|
||||
<div class='main-table'>
|
||||
<table class='table has-sort-head table-fixed tablesorter'>
|
||||
<table class='table has-sort-head table-fixed'>
|
||||
<?php $vars = "userID={$user->id}&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}"; ?>
|
||||
<thead>
|
||||
<tr class='colhead'>
|
||||
<th class='w-id'><?php echo $lang->idAB;?></th>
|
||||
<th class="text-left"><?php echo $lang->user->name;?></th>
|
||||
<th class='w-status'><?php echo $lang->statusAB;?></th>
|
||||
<th class='w-user'><?php echo $lang->team->role;?></th>
|
||||
<th class='w-date'><?php echo $lang->execution->begin;?></th>
|
||||
<th class='w-date'><?php echo $lang->execution->end;?></th>
|
||||
<th class='w-date'><?php echo $lang->team->join;?></th>
|
||||
<th class='w-110px'><?php echo $lang->team->hours;?></th>
|
||||
<th class='w-id'> <?php common::printOrderLink('id', $orderBy, $vars, $lang->idAB);?></th>
|
||||
<th class="text-left"><?php common::printOrderLink('name', $orderBy, $vars, $lang->user->name);?></th>
|
||||
<th class='w-status'> <?php common::printOrderLink('status', $orderBy, $vars, $lang->statusAB);?></th>
|
||||
<th class='w-user'> <?php $lang->team->role;?></th>
|
||||
<th class='w-date'> <?php common::printOrderLink('begin', $orderBy, $vars, $lang->execution->begin);?></th>
|
||||
<th class='w-date'> <?php common::printOrderLink('end', $orderBy, $vars, $lang->execution->end);?></th>
|
||||
<th class='w-date'> <?php $lang->team->join;?></th>
|
||||
<th class='w-110px'> <?php $lang->team->hours;?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
@@ -34,18 +34,19 @@
|
||||
</nav>
|
||||
|
||||
<div class='main-table'>
|
||||
<table class='table has-sort-head tablesorter'>
|
||||
<table class='table has-sort-head'>
|
||||
<?php $vars = "userID={$user->id}&storyType=$storyType&type=$type&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}"; ?>
|
||||
<thead>
|
||||
<tr class='colhead'>
|
||||
<th class='w-id'> <?php echo $lang->idAB;?></th>
|
||||
<th class='w-pri'> <?php echo $lang->priAB;?></th>
|
||||
<th class='w-200px'> <?php echo $lang->story->product;?></th>
|
||||
<th> <?php echo $lang->story->title;?></th>
|
||||
<th class='w-150px'> <?php echo $lang->story->plan;?></th>
|
||||
<th class='w-90px'> <?php echo $lang->openedByAB;?></th>
|
||||
<th class='w-80px'> <?php echo $lang->story->estimateAB;?></th>
|
||||
<th class='w-status'><?php echo $lang->statusAB;?></th>
|
||||
<th class='w-100px'> <?php echo $lang->story->stageAB;?></th>
|
||||
<th class='w-id'> <?php common::printOrderLink('id', $orderBy, $vars, $lang->idAB);?></th>
|
||||
<th class='w-pri'> <?php common::printOrderLink('pri', $orderBy, $vars, $lang->priAB);?></th>
|
||||
<th class='w-200px'> <?php common::printOrderLink('product', $orderBy, $vars, $lang->story->product);?></th>
|
||||
<th> <?php common::printOrderLink('title', $orderBy, $vars, $lang->story->title);?></th>
|
||||
<th class='w-150px'> <?php common::printOrderLink('plan', $orderBy, $vars, $lang->story->plan);?></th>
|
||||
<th class='w-90px'> <?php common::printOrderLink('openedBy', $orderBy, $vars, $lang->openedByAB);?></th>
|
||||
<th class='w-80px'> <?php common::printOrderLink('estimate', $orderBy, $vars, $lang->story->estimateAB);?></th>
|
||||
<th class='w-status'><?php common::printOrderLink('status', $orderBy, $vars, $lang->statusAB);?></th>
|
||||
<th class='w-100px'> <?php common::printOrderLink('stage', $orderBy, $vars, $lang->story->stageAB);?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
@@ -37,18 +37,19 @@
|
||||
</nav>
|
||||
|
||||
<div class='main-table'>
|
||||
<table class='table has-sort-head tablesorter' id='tasktable'>
|
||||
<table class='table has-sort-head' id='tasktable'>
|
||||
<?php $vars = "userID={$user->id}&type=$type&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}"; ?>
|
||||
<thead>
|
||||
<tr class='colhead'>
|
||||
<th class='w-id'><?php echo $lang->idAB;?></th>
|
||||
<th class='w-pri'><?php echo $lang->priAB;?></th>
|
||||
<th><?php echo $lang->task->execution;?></th>
|
||||
<th><?php echo $lang->task->name;?></th>
|
||||
<th class='w-70px'><?php echo $lang->task->estimateAB;?></th>
|
||||
<th class='w-70px'><?php echo $lang->task->consumedAB;?></th>
|
||||
<th class='w-hour'><?php echo $lang->task->leftAB;?></th>
|
||||
<th class='w-date'><?php echo $lang->task->deadlineAB;?></th>
|
||||
<th class='w-70px'><?php echo $lang->statusAB;?></th>
|
||||
<th class='w-id'><?php common::printOrderLink('id', $orderBy, $vars, $lang->idAB);?></th>
|
||||
<th class='w-pri'><?php common::printOrderLink('pri', $orderBy, $vars, $lang->priAB);?></th>
|
||||
<th><?php common::printOrderLink('execution', $orderBy, $vars, $lang->task->execution);?></th>
|
||||
<th><?php common::printOrderLink('name', $orderBy, $vars, $lang->task->name);?></th>
|
||||
<th class='w-70px'><?php common::printOrderLink('estimate', $orderBy, $vars, $lang->task->estimateAB);?></th>
|
||||
<th class='w-70px'><?php common::printOrderLink('consumed', $orderBy, $vars, $lang->task->consumedAB);?></th>
|
||||
<th class='w-hour'><?php common::printOrderLink('left', $orderBy, $vars, $lang->task->leftAB);?></th>
|
||||
<th class='w-date'><?php common::printOrderLink('deadline', $orderBy, $vars, $lang->task->deadlineAB);?></th>
|
||||
<th class='w-70px'><?php common::printOrderLink('status', $orderBy, $vars, $lang->statusAB);?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
Reference in New Issue
Block a user