* code for task#1487.

This commit is contained in:
chencongzhi520@gmail.com
2013-07-03 08:39:11 +00:00
parent 6a7917ffba
commit 5d8358246c
2 changed files with 20 additions and 36 deletions

View File

@@ -73,7 +73,7 @@ class user extends control
/* set menus. */
$this->lang->set('menugroup.user', 'company');
$this->user->setMenu($this->user->getPairs('noempty|noclosed|nodeleted'), $account);
$this->view->userList = $this->user->setUserList($this->user->getPairs('noempty|noclosed'), $account);
$this->view->userList = $this->user->setUserList($this->user->getPairs('noempty|noclosed|nodeleted'), $account);
$title = $this->lang->company->orgView . $this->lang->colon . $this->lang->user->todo;
$position[] = $this->lang->user->todo;
@@ -115,8 +115,8 @@ class user extends control
/* 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);
$this->user->setMenu($this->user->getPairs('noempty|noclosed|nodeleted'), $account);
$this->view->userList = $this->user->setUserList($this->user->getPairs('noempty|noclosed|nodeleted'), $account);
/* Assign. */
$this->view->title = $this->lang->user->common . $this->lang->colon . $this->lang->user->story;
@@ -152,8 +152,8 @@ class user extends control
/* Set the 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);
$this->user->setMenu($this->user->getPairs('noempty|noclosed|nodeleted'), $account);
$this->view->userList = $this->user->setUserList($this->user->getPairs('noempty|noclosed|nodeleted'), $account);
/* Assign. */
$title = $this->lang->user->common . $this->lang->colon . $this->lang->user->task;
@@ -193,8 +193,8 @@ class user extends control
/* 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);
$this->user->setMenu($this->user->getPairs('noempty|noclosed|nodeleted'), $account);
$this->view->userList = $this->user->setUserList($this->user->getPairs('noempty|noclosed|nodeleted'), $account);
/* Load the lang of bug module. */
$this->app->loadLang('bug');
@@ -234,8 +234,8 @@ class user extends control
/* 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);
$this->user->setMenu($this->user->getPairs('noempty|noclosed|nodeleted'), $account);
$this->view->userList = $this->user->setUserList($this->user->getPairs('noempty|noclosed|nodeleted'), $account);
/* Save session. */
$this->session->set('testtaskList', $this->app->getURI(true));
@@ -280,8 +280,8 @@ class user extends control
/* 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);
$this->user->setMenu($this->user->getPairs('noempty|noclosed|nodeleted'), $account);
$this->view->userList = $this->user->setUserList($this->user->getPairs('noempty|noclosed|nodeleted'), $account);
$cases = array();
if($type == 'case2Him')
@@ -331,8 +331,8 @@ class user extends control
/* Set the menus. */
$this->loadModel('project');
$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);
$this->user->setMenu($this->user->getPairs('noempty|noclosed|nodeleted'), $account);
$this->view->userList = $this->user->setUserList($this->user->getPairs('noempty|noclose|nodeleted'), $account);
$title = $this->lang->user->common . $this->lang->colon . $this->lang->user->project;
$position[] = $this->lang->user->project;
@@ -356,8 +356,8 @@ class user extends control
public function profile($account)
{
/* Set menu. */
$this->user->setMenu($this->user->getPairs('noempty|noclosed'), $account);
$this->view->userList = $this->user->setUserList($this->user->getPairs('noempty|noclosed'), $account);
$this->user->setMenu($this->user->getPairs('noempty|noclosed|nodeleted'), $account);
$this->view->userList = $this->user->setUserList($this->user->getPairs('noempty|noclose|nodeleted'), $account);
$user = $this->user->getById($account);
@@ -761,8 +761,8 @@ class user extends control
{
/* set menus. */
$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);
$this->user->setMenu($this->user->getPairs('noempty|noclosed|nodeleted'), $account);
$this->view->userList = $this->user->setUserList($this->user->getPairs('noempty|noclosed|nodeleted'), $account);
/* Save session. */
$uri = $this->app->getURI(true);

View File

@@ -60,10 +60,11 @@ class userModel extends model
* Get the account=>relaname pairs.
*
* @param string $params noletter|noempty|noclosed|nodeleted|withguest|pofirst|devfirst|qafirst|pmfirst, can be sets of theme
* @param string $usersToAppended account1,account2
* @access public
* @return array
*/
public function getPairs($params = '')
public function getPairs($params = '', $usersToAppended = '')
{
/* Set the query fields and orderBy condition.
*
@@ -84,6 +85,7 @@ class userModel extends model
->beginIF(strpos($params, 'nodeleted') !== false)->where('deleted')->eq(0)->fi()
->orderBy($orderBy)
->fetchAll('account');
if($usersToAppended) $users += $this->dao->select($fields)->from(TABLE_USER)->where('account')->in($usersToAppended)->fetchAll('account');
/* Cycle the user records to append the first letter of his account. */
foreach($users as $account => $user)
@@ -118,24 +120,6 @@ class userModel extends model
return $commiters;
}
/**
* Appened deleted users to the user list.
*
* @param array $users
* @param string $deleteds the deleted users, can be a list
* @access public
* @return array new user lists with deleted users.
*/
public function appendDeleted($users, $deleteds = '')
{
$deleteds = explode(',', $deleteds);
foreach($deleteds as $deleted)
{
if(!isset($users[$deleted])) $users[$deleted] = $deleted;
}
return $users;
}
/**
* Get user list with email and real name.
*