From 2fdb1de49074f8b9ebe88bddec7bc77d80d3482b Mon Sep 17 00:00:00 2001 From: Wenrui LI Date: Tue, 22 Feb 2022 14:52:36 +0800 Subject: [PATCH] * show only groups of current vision on user create, bug #18849. --- module/user/control.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/module/user/control.php b/module/user/control.php index 17dbd92726..066bd48f55 100644 --- a/module/user/control.php +++ b/module/user/control.php @@ -524,7 +524,10 @@ class user extends control return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $this->createLink('company', 'browse'))); } - $groups = $this->dao->select('id, name, role')->from(TABLE_GROUP)->fetchAll(); + $groups = $this->dao->select('id, name, role') + ->from(TABLE_GROUP) + ->where('vision')->eq($this->config->vision) + ->fetchAll(); $groupList = array('' => ''); $roleGroup = array(); foreach($groups as $group) @@ -556,7 +559,10 @@ class user extends control */ public function batchCreate($deptID = 0) { - $groups = $this->dao->select('id, name, role')->from(TABLE_GROUP)->fetchAll(); + $groups = $this->dao->select('id, name, role') + ->from(TABLE_GROUP) + ->where('vision')->eq($this->config->vision) + ->fetchAll(); $groupList = array('' => ''); $roleGroup = array(); foreach($groups as $group)