mirror of
https://github.com/Karaka-Management/oms-Admin.git
synced 2026-02-15 20:18:40 +00:00
show groups_permissions in groups and cleanup module profile
This commit is contained in:
parent
664169d81c
commit
d04260f4c6
|
|
@ -311,6 +311,9 @@ final class BackendController extends Controller
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$groupPermission = GroupMapper::getPermissionForModule($id);
|
||||||
|
$view->setData('groupPermissions', $groupPermission);
|
||||||
|
|
||||||
return $view;
|
return $view;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -85,4 +85,23 @@ final class GroupMapper extends DataMapperAbstract
|
||||||
'src' => 'account_group_account',
|
'src' => 'account_group_account',
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get groups which reference a certain module
|
||||||
|
*
|
||||||
|
* @param string $module Module
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
public static function getPermissionForModule(string $module) : array
|
||||||
|
{
|
||||||
|
$query = self::getQuery();
|
||||||
|
$query->innerJoin(GroupPermissionMapper::getTable())
|
||||||
|
->on(self::$table . '.group_id', '=', GroupPermissionMapper::getTable() . '.group_permission_group')
|
||||||
|
->where(GroupPermissionMapper::getTable() . '.group_permission_module', '=', $module);
|
||||||
|
|
||||||
|
return self::getAllByQuery($query);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -100,22 +100,25 @@ if ($nav !== null) {
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-xs-12 col-md-4">
|
<div class="col-xs-12 col-md-4">
|
||||||
<section class="box wf-100">
|
<table id="iModuleGroupList" class="box table default wf-100">
|
||||||
<header><h1><?= $this->getHtml('Groups'); ?></h1></header>
|
<caption><?= $this->getHtml('Permissions') ?><i class="fa fa-download floatRight download btn"></i></caption>
|
||||||
|
<thead>
|
||||||
<div class="inner">
|
<tr>
|
||||||
|
<td><?= $this->getHtml('ID', '0', '0'); ?><i class="sort-asc fa fa-chevron-up"></i><i class="sort-desc fa fa-chevron-down"></i>
|
||||||
</div>
|
<td>Type<i class="sort-asc fa fa-chevron-up"></i><i class="sort-desc fa fa-chevron-down"></i>
|
||||||
</section>
|
<td class="wf-100"><?= $this->getHtml('Name'); ?><i class="sort-asc fa fa-chevron-up"></i><i class="sort-desc fa fa-chevron-down"></i>
|
||||||
</div>
|
<tbody>
|
||||||
|
<?php $c = 0; $groupPermissions = $this->getData('groupPermissions');
|
||||||
<div class="col-xs-12 col-md-4">
|
foreach ($groupPermissions as $key => $value) : ++$c;
|
||||||
<section class="box wf-100">
|
$url = \phpOMS\Uri\UriFactory::build('{/prefix}admin/group/settings?{?}&id=' . $value->getId()); ?>
|
||||||
<header><h1><?= $this->getHtml('Permissions'); ?></h1></header>
|
<tr data-href="<?= $url; ?>">
|
||||||
|
<td><a href="<?= $url; ?>"><i class="fa fa-times"></i></a>
|
||||||
<div class="inner">
|
<td><a href="<?= $url; ?>">Group</a>
|
||||||
|
<td><a href="<?= $url; ?>"><?= $value->getName(); ?></a>
|
||||||
</div>
|
<?php endforeach; ?>
|
||||||
</section>
|
<?php if ($c === 0) : ?>
|
||||||
|
<tr><td colspan="3" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
|
||||||
|
<?php endif; ?>
|
||||||
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user