* Finish task#8761.

This commit is contained in:
hufangzhou
2020-12-28 15:35:26 +08:00
parent 494b5f549c
commit 4acf89e286
9 changed files with 23 additions and 17 deletions
+3
View File
@@ -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;
+2
View File
@@ -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.';
+2
View File
@@ -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.';
+2
View File
@@ -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.';
+2
View File
@@ -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.';
+2
View File
@@ -21,3 +21,5 @@ $lang->personnel->whitelist = '白名单列表';
$lang->personnel->addWhitelist = '添加白名单';
$lang->personnel->unbindWhielist = '删除白名单';
$lang->personnel->confirmDelete = '确认将该用户移除白名单?';
$lang->personnel->openedPGMTip = '该项目集是公开状态,有项目集视图权限的人员即可访问。';
+2
View File
@@ -21,3 +21,5 @@ $lang->personnel->whitelist = '白名單列表';
$lang->personnel->addWhitelist = '添加白名單';
$lang->personnel->unbindWhielist = '刪除白名單';
$lang->personnel->confirmDelete = '確認將該用戶移除白名單?';
$lang->personnel->openedPGMTip = '該項目集是公開狀態,有項目集視圖權限的人員即可訪問。';
+3 -16
View File
@@ -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;
}
+5 -1
View File
@@ -12,6 +12,7 @@
<?php include '../../common/view/header.html.php';
js::set('deptID', $deptID);
?>
<?php if($acl != 'open'): ?>
<div id="mainMenu" class="clearfix">
<div id="sidebarHeader">
<div class="title">
@@ -23,13 +24,16 @@ js::set('deptID', $deptID);
<a id="bysearchTab" class="btn btn-link querybox-toggle"><i class="icon icon-search muted"></i><?php echo $lang->personnel->search;?></a>
</div>
</div>
<?php endif;?>
<div id="mainContent" class="main-row fade">
<?php if($acl != 'open'): ?>
<div id="sidebar" class="side-col">
<div class="sidebar-toggle"><i class="icon icon-angle-left"></i></div>
<div class="cell">
<?php echo $deptTree;?>
</div>
</div>
<?php endif;?>
<div class="main-col">
<?php if(!empty($personnelList)):?>
<div id="queryBox" class="cell" data-module="accessible"></div>
@@ -66,7 +70,7 @@ js::set('deptID', $deptID);
<?php else:?>
<div class="table-empty-tip">
<p>
<span class="text-muted"><?php echo $lang->personnel->emptyTip;?></span>
<span class="text-muted"><?php echo $acl == 'open' ? $lang->personnel->openedPGMTip : $lang->personnel->emptyTip;?></span>
</p>
</div>
<?php endif;?>