* Task #5423
This commit is contained in:
yfl
2019-05-06 16:33:10 +08:00
13 changed files with 538 additions and 454 deletions
+6 -1
View File
@@ -142,10 +142,15 @@ class group extends control
$this->view->title = $this->lang->company->common . $this->lang->colon . $group->name . $this->lang->colon . $this->lang->group->manageView;
$this->view->position[] = $group->name;
$this->view->position[] = $this->lang->group->manageView;
$this->view->group = $group;
$this->view->products = $this->dao->select('*')->from(TABLE_PRODUCT)->where('deleted')->eq('0')->orderBy('order_desc')->fetchPairs('id', 'name');
$this->view->projects = $this->dao->select('*')->from(TABLE_PROJECT)->where('deleted')->eq('0')->orderBy('order_desc')->fetchPairs('id', 'name');
$menugroup = array();
foreach($this->lang->menugroup as $moduleName => $groupName) $menugroup[$groupName][$moduleName] = $moduleName;
$this->view->menugroup = $menugroup;
$this->display();
}
+4
View File
@@ -1 +1,5 @@
.group-item {display:block; width:90px; float:left; margin-top:5px;}
.action-item {display:block; width:150px; float:left; margin-top:5px;}
.pl-0px {padding-left:0px !important;}
.pt-0px {padding-top:0px !important;}
+10 -3
View File
@@ -12,11 +12,11 @@ function selectAll(obj)
{
if($(obj).prop('checked'))
{
$(obj).closest('td').find(':checkbox').attr('checked', 'checked');
$(obj).closest('tr').find(':checkbox').attr('checked', 'checked');
}
else
{
$(obj).closest('td').find(':checkbox').removeAttr('checked');
$(obj).closest('tr').find(':checkbox').removeAttr('checked');
}
}
@@ -38,6 +38,13 @@ $(function()
{
if(!$(this).prop('checked')) allChecked = false;
})
$('input:checkbox[name^="allchecker"]').prop('checked', allChecked);
$('.group-item input:checkbox[name^="allchecker"]').prop('checked', allChecked);
var id = $(this).attr('id');
if($('#' + id + 'ActionBox').length == 1)
{
$('#' + id + 'ActionBox').toggle($(this).prop("checked"));
$('#' + id + 'ActionBox').closest('tr').find('td :checkbox').prop('checked', $(this).prop("checked"));
}
})
})
+1
View File
@@ -27,6 +27,7 @@ $lang->group->errorNotSaved = '没有保存,请确认选择了权限数
$lang->group->viewList = '可访问视图';
$lang->group->productList = '可访问' . $lang->productCommon;
$lang->group->projectList = '可访问' . $lang->projectCommon;
$lang->group->dynamic = '可访问动态';
$lang->group->noticeVisit = '空代表访问没有访问限制';
$lang->group->id = '编号';
+2 -1
View File
@@ -266,7 +266,8 @@ class groupModel extends model
public function updateView($groupID)
{
$actions = $this->post->actions;
if(isset($_POST['allchecker']))$actions['views'] = array();
if(isset($_POST['allchecker']))$actions['views'] = array();
if(!isset($actions['actions']))$actions['actions'] = array();
$actions = empty($actions) ? '' : json_encode($actions);
$this->dao->update(TABLE_GROUP)->set('acl')->eq($actions)->where('id')->eq($groupID)->exec();
+51 -1
View File
@@ -21,7 +21,7 @@
<form class="load-indicator main-form form-ajax" id="manageViewForm" method="post" target='hiddenwin'>
<table class='table table-form'>
<tr>
<th class='w-100px'>
<th class='w-110px'>
<?php echo $lang->group->viewList;?>
</th>
<td>
@@ -67,6 +67,56 @@
</div>
</td>
</tr>
<tr>
<th class='text-right text-top'><?php echo $lang->group->dynamic?></th>
<td class='pl-0px pt-0px'>
<table class='table table-form'>
<?php foreach($lang->menu as $module => $title):?>
<?php if(!isset($lang->action->dynamicAction->$module) and !isset($menugroup[$module])) continue;?>
<tr id='<?php echo "{$module}ActionBox";?>'>
<th class='w-100px text-left'>
<div class='action-item'>
<div class='checkbox-primary'>
<input type="checkbox" id='allchecker' name="allchecker" onclick="selectAll(this)"/>
<label class='priv' for='allchecker'><?php echo substr($title, 0, strpos($title, '|'));?></label>
</div>
</div>
</th>
<td>
<?php if(isset($lang->action->dynamicAction->$module)):?>
<div class='clearfix'>
<?php foreach($lang->action->dynamicAction->$module as $action => $actionTitle):?>
<div class='action-item'>
<div class='checkbox-primary'>
<input type='checkbox' id='<?php echo "$module-$action";?>' name='actions[actions][<?php echo $module;?>][<?php echo $action;?>]' value='<?php echo $action;?>' <?php if(isset($group->acl['actions'][$module][$action]) or empty($group->acl['actions'])) echo "checked";?> />
<label class='priv' for='<?php echo "$module-$action";?>'><?php echo $actionTitle;?></label>
</div>
</div>
<?php endforeach;?>
</div>
<?php endif;?>
<?php if(isset($menugroup[$module])):?>
<?php foreach($menugroup[$module] as $subModule):?>
<?php if(isset($lang->action->dynamicAction->$subModule)):?>
<div class='clearfix'>
<?php foreach($lang->action->dynamicAction->$subModule as $action => $actionTitle):?>
<div class='action-item'>
<div class='checkbox-primary'>
<input type='checkbox' id='<?php echo "$subModule-$action";?>' name='actions[actions][<?php echo $subModule;?>][<?php echo $action;?>]' value='<?php echo $action;?>' <?php if(isset($group->acl['actions'][$subModule][$action]) or empty($group->acl['actions'])) echo "checked";?> />
<label class='priv' for='<?php echo "$subModule-$action";?>'><?php echo $actionTitle;?></label>
</div>
</div>
<?php endforeach;?>
</div>
<?php endif;?>
<?php endforeach;?>
<?php endif;?>
</td>
</tr>
<?php endforeach;?>
</table>
</td>
</tr>
<tr>
<td colspan='2' class='form-actions text-center'>
<?php echo html::submitButton('', "onclick='setNoChecked()'");?>