mirror of
https://github.com/Karaka-Management/oms-Admin.git
synced 2026-02-03 23: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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -85,4 +85,23 @@ final class GroupMapper extends DataMapperAbstract
|
|||
'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 class="col-xs-12 col-md-4">
|
||||
<section class="box wf-100">
|
||||
<header><h1><?= $this->getHtml('Groups'); ?></h1></header>
|
||||
|
||||
<div class="inner">
|
||||
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-12 col-md-4">
|
||||
<section class="box wf-100">
|
||||
<header><h1><?= $this->getHtml('Permissions'); ?></h1></header>
|
||||
|
||||
<div class="inner">
|
||||
|
||||
</div>
|
||||
</section>
|
||||
<table id="iModuleGroupList" class="box table default wf-100">
|
||||
<caption><?= $this->getHtml('Permissions') ?><i class="fa fa-download floatRight download btn"></i></caption>
|
||||
<thead>
|
||||
<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>
|
||||
<td>Type<i class="sort-asc fa fa-chevron-up"></i><i class="sort-desc fa fa-chevron-down"></i>
|
||||
<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>
|
||||
<tbody>
|
||||
<?php $c = 0; $groupPermissions = $this->getData('groupPermissions');
|
||||
foreach ($groupPermissions as $key => $value) : ++$c;
|
||||
$url = \phpOMS\Uri\UriFactory::build('{/prefix}admin/group/settings?{?}&id=' . $value->getId()); ?>
|
||||
<tr data-href="<?= $url; ?>">
|
||||
<td><a href="<?= $url; ?>"><i class="fa fa-times"></i></a>
|
||||
<td><a href="<?= $url; ?>">Group</a>
|
||||
<td><a href="<?= $url; ?>"><?= $value->getName(); ?></a>
|
||||
<?php endforeach; ?>
|
||||
<?php if ($c === 0) : ?>
|
||||
<tr><td colspan="3" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
|
||||
<?php endif; ?>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user