* Fix bug#27991 and adjust code
This commit is contained in:
@@ -154,19 +154,18 @@ class groupModel extends model
|
||||
* Get group by account.
|
||||
*
|
||||
* @param string $account
|
||||
* @param string $visions
|
||||
* @param bool $allVision
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getByAccount($account, $visions = '')
|
||||
public function getByAccount($account, $allVison = false)
|
||||
{
|
||||
$visions = empty($visions) ? $this->config->vision : $visions;
|
||||
return $this->dao->select('t2.*')->from(TABLE_USERGROUP)->alias('t1')
|
||||
->leftJoin(TABLE_GROUP)->alias('t2')
|
||||
->on('t1.`group` = t2.id')
|
||||
->where('t1.account')->eq($account)
|
||||
->andWhere('t2.project')->eq(0)
|
||||
->andWhere('t2.vision')->in($visions)
|
||||
->beginIF(!$allVison)->andWhere('t2.vision')->eq($this->config->vision)->fi()
|
||||
->fetchAll('id');
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.c-id {width: 50px;}
|
||||
.c-pri, .c-record, .c-left {width: 70px;}
|
||||
.c-reason {width: 100px;}
|
||||
.c-module, .c-assigned {width: 150px;}
|
||||
.c-module, .c-assigned, .c-name {width: 150px;}
|
||||
|
||||
@@ -635,10 +635,10 @@ class user extends control
|
||||
return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $link));
|
||||
}
|
||||
|
||||
$visionList = $this->user->getVisionList();
|
||||
$userVisionList = $this->user->getVisionList();
|
||||
|
||||
$user = $this->user->getById($userID, 'id');
|
||||
$userGroups = $this->loadModel('group')->getByAccount($user->account, implode(',', array_keys($visionList)));
|
||||
$userGroups = $this->loadModel('group')->getByAccount($user->account, count($userVisionList) > 1 ? true : false);
|
||||
|
||||
$title = $this->lang->company->common . $this->lang->colon . $this->lang->user->edit;
|
||||
$position[] = $this->lang->user->edit;
|
||||
@@ -650,7 +650,7 @@ class user extends control
|
||||
$this->view->companies = $this->loadModel('company')->getOutsideCompanies();
|
||||
$this->view->groups = $this->dao->select('id, name')->from(TABLE_GROUP)->where('project')->eq(0)->fetchPairs('id', 'name');
|
||||
$this->view->rand = $this->user->updateSessionRandom();
|
||||
$this->view->visionList = $visionList;
|
||||
$this->view->visionList = $userVisionList;
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user