mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-03-23 17:33:38 -04:00
Merge pull request #1574 from RuleDomain/backoffice-2
Backoffice Permissions Fix (#1543)
This commit is contained in:
@@ -134,16 +134,18 @@ class Employees extends Persons
|
||||
'country' => $this->input->post('country'),
|
||||
'comments' => $this->input->post('comments'),
|
||||
);
|
||||
$grants_data = $this->input->post('grants') != NULL ? $this->input->post('grants') : array();
|
||||
$menu_groups = $this->input->post('menu_groups') != NULL ? $this->input->post('menu_groups') : array();
|
||||
|
||||
$grants_array = array();
|
||||
foreach ($grants_data as $key => $value)
|
||||
foreach($this->Module->get_all_permissions()->result() as $permission)
|
||||
{
|
||||
$grants = array();
|
||||
$grants['permission_id'] = $value;
|
||||
$grants['menu_group'] = $menu_groups[$key];
|
||||
$grants_array[] = $grants;
|
||||
$grant = $this->input->post('grant_'.$permission->permission_id) != NULL ? $this->input->post('grant_'.$permission->permission_id) : '';
|
||||
if($grant == $permission->permission_id)
|
||||
{
|
||||
$grants['permission_id'] = $permission->permission_id;
|
||||
$grants['menu_group'] = $this->input->post('menu_group_'.$permission->permission_id) != NULL ? $this->input->post('menu_group_'.$permission->permission_id) : '--';
|
||||
$grants_array[] = $grants;
|
||||
}
|
||||
}
|
||||
|
||||
//Password has been changed OR first time password set
|
||||
|
||||
@@ -81,8 +81,8 @@
|
||||
{
|
||||
?>
|
||||
<li>
|
||||
<?php echo form_checkbox("grants[]", $module->module_id, $module->grant, "class='module'"); ?>
|
||||
<?php echo form_dropdown("menu_groups[]", array(
|
||||
<?php echo form_checkbox("grant_".$module->module_id, $module->module_id, $module->grant, "class='module'"); ?>
|
||||
<?php echo form_dropdown("menu_group_".$module->module_id, array(
|
||||
'home' => $this->lang->line('module_home'),
|
||||
'office' => $this->lang->line('module_office'),
|
||||
'both' => $this->lang->line('module_both')
|
||||
@@ -103,8 +103,8 @@
|
||||
?>
|
||||
<ul>
|
||||
<li>
|
||||
<?php echo form_checkbox("grants[]", $permission->permission_id, $permission->grant); ?>
|
||||
<?php echo form_hidden("menu_groups[]", "--"); ?>
|
||||
<?php echo form_checkbox("grant_".$permission->permission_id, $permission->permission_id, $permission->grant); ?>
|
||||
<?php echo form_hidden("menu_group_".$permission->permission_id, "--"); ?>
|
||||
<span class="medium"><?php echo $lang_line ?></span>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
Reference in New Issue
Block a user