From 4acf89e28658952e51221f9b8a0871f604475f01 Mon Sep 17 00:00:00 2001 From: hufangzhou <746775970@qq.com> Date: Mon, 28 Dec 2020 15:35:26 +0800 Subject: [PATCH] * Finish task#8761. --- module/personnel/control.php | 3 +++ module/personnel/lang/de.php | 2 ++ module/personnel/lang/en.php | 2 ++ module/personnel/lang/fr.php | 2 ++ module/personnel/lang/vi.php | 2 ++ module/personnel/lang/zh-cn.php | 2 ++ module/personnel/lang/zh-tw.php | 2 ++ module/personnel/model.php | 19 +++---------------- module/personnel/view/accessible.html.php | 6 +++++- 9 files changed, 23 insertions(+), 17 deletions(-) diff --git a/module/personnel/control.php b/module/personnel/control.php index 38fbf1247b..e7ab9b9d01 100644 --- a/module/personnel/control.php +++ b/module/personnel/control.php @@ -29,6 +29,8 @@ class personnel extends control $this->setProgramNavMenu($programID); $this->app->loadLang('user'); + $program = $this->loadModel('program')->getPGMByID($programID); + /* Set the pager. */ $this->app->loadClass('pager', true); $pager = pager::init($recTotal, $recPerPage, $pageID); @@ -45,6 +47,7 @@ class personnel extends control $this->view->deptID = $deptID; $this->view->programID = $programID; + $this->view->acl = $program->acl; $this->view->recTotal = $recTotal; $this->view->recPerPage = $recPerPage; $this->view->pageID = $pageID; diff --git a/module/personnel/lang/de.php b/module/personnel/lang/de.php index 3157c67a23..a0546708dc 100644 --- a/module/personnel/lang/de.php +++ b/module/personnel/lang/de.php @@ -21,3 +21,5 @@ $lang->personnel->whitelist = 'Whitelist'; $lang->personnel->addWhitelist = 'Add Whitelist'; $lang->personnel->unbindWhielist = 'Remove Whitelist'; $lang->personnel->confirmDelete = 'Confirm removal of the user from the whitelist?'; + +$lang->personnel->openedPGMTip = 'The program is public and can be accessed by users with Program privileges.'; diff --git a/module/personnel/lang/en.php b/module/personnel/lang/en.php index 3157c67a23..a0546708dc 100644 --- a/module/personnel/lang/en.php +++ b/module/personnel/lang/en.php @@ -21,3 +21,5 @@ $lang->personnel->whitelist = 'Whitelist'; $lang->personnel->addWhitelist = 'Add Whitelist'; $lang->personnel->unbindWhielist = 'Remove Whitelist'; $lang->personnel->confirmDelete = 'Confirm removal of the user from the whitelist?'; + +$lang->personnel->openedPGMTip = 'The program is public and can be accessed by users with Program privileges.'; diff --git a/module/personnel/lang/fr.php b/module/personnel/lang/fr.php index 3157c67a23..a0546708dc 100644 --- a/module/personnel/lang/fr.php +++ b/module/personnel/lang/fr.php @@ -21,3 +21,5 @@ $lang->personnel->whitelist = 'Whitelist'; $lang->personnel->addWhitelist = 'Add Whitelist'; $lang->personnel->unbindWhielist = 'Remove Whitelist'; $lang->personnel->confirmDelete = 'Confirm removal of the user from the whitelist?'; + +$lang->personnel->openedPGMTip = 'The program is public and can be accessed by users with Program privileges.'; diff --git a/module/personnel/lang/vi.php b/module/personnel/lang/vi.php index 3157c67a23..a0546708dc 100644 --- a/module/personnel/lang/vi.php +++ b/module/personnel/lang/vi.php @@ -21,3 +21,5 @@ $lang->personnel->whitelist = 'Whitelist'; $lang->personnel->addWhitelist = 'Add Whitelist'; $lang->personnel->unbindWhielist = 'Remove Whitelist'; $lang->personnel->confirmDelete = 'Confirm removal of the user from the whitelist?'; + +$lang->personnel->openedPGMTip = 'The program is public and can be accessed by users with Program privileges.'; diff --git a/module/personnel/lang/zh-cn.php b/module/personnel/lang/zh-cn.php index 7b82c4054f..bb0dd97853 100644 --- a/module/personnel/lang/zh-cn.php +++ b/module/personnel/lang/zh-cn.php @@ -21,3 +21,5 @@ $lang->personnel->whitelist = '白名单列表'; $lang->personnel->addWhitelist = '添加白名单'; $lang->personnel->unbindWhielist = '删除白名单'; $lang->personnel->confirmDelete = '确认将该用户移除白名单?'; + +$lang->personnel->openedPGMTip = '该项目集是公开状态,有项目集视图权限的人员即可访问。'; diff --git a/module/personnel/lang/zh-tw.php b/module/personnel/lang/zh-tw.php index e831503c7f..d03fb232c9 100644 --- a/module/personnel/lang/zh-tw.php +++ b/module/personnel/lang/zh-tw.php @@ -21,3 +21,5 @@ $lang->personnel->whitelist = '白名單列表'; $lang->personnel->addWhitelist = '添加白名單'; $lang->personnel->unbindWhielist = '刪除白名單'; $lang->personnel->confirmDelete = '確認將該用戶移除白名單?'; + +$lang->personnel->openedPGMTip = '該項目集是公開狀態,有項目集視圖權限的人員即可訪問。'; diff --git a/module/personnel/model.php b/module/personnel/model.php index 80be383e66..3c6f0d3368 100644 --- a/module/personnel/model.php +++ b/module/personnel/model.php @@ -40,22 +40,8 @@ class personnelModel extends model /* Determine who can be accessed based on access control. */ $program = $this->loadModel('program')->getPGMByID($programID); - if($program->acl == 'open') - { - /* The program is public, and users are judged to be accessible by permission groups. */ - $accessibleGroupID = $this->loadModel('group')->getAccessProgramGroup(); - $personnelList = $this->dao->select('t1.account,t3.role,t3.dept,t3.realname,t3.gender,t3.id')->from(TABLE_USERGROUP)->alias('t1') - ->leftJoin(TABLE_GROUPPRIV)->alias('t2')->on('t1.group = t2.group') - ->leftJoin(TABLE_USER)->alias('t3')->on('t1.account = t3.account') - ->where('t1.group')->in($accessibleGroupID) - ->andWhere('t2.module')->eq('program') - ->andWhere('t2.method')->eq('PGMBrowse') - ->beginIF($deptID > 0)->andWhere('t3.dept')->eq($deptID)->fi() - ->beginIF($browseType == 'bysearch')->andWhere($accessibleQuery)->fi() - ->page($pager) - ->fetchAll('account'); - } - else + $personnelList = array(); + if($program->acl != 'open') { $personnelList = $this->dao->select('t2.id,t2.dept,t2.account,t2.role,t2.realname,t2.gender')->from(TABLE_USERVIEW)->alias('t1') ->leftJoin(TABLE_USER)->alias('t2')->on('t1.account=t2.account') @@ -264,6 +250,7 @@ class personnelModel extends model $acl->type = $type; $acl->source = $source; $this->dao->insert(TABLE_ACL)->data($acl)->autoCheck()->exec(); + if(!dao::isError()) $this->loadModel('user')->updateUserView($acl->objectID, $acl->objectType, $acl->account); $accounts[$account] = $account; } diff --git a/module/personnel/view/accessible.html.php b/module/personnel/view/accessible.html.php index 667fb459ea..80c93558d6 100644 --- a/module/personnel/view/accessible.html.php +++ b/module/personnel/view/accessible.html.php @@ -12,6 +12,7 @@ +