Skip to content
Snippets Groups Projects
Commit 03ee4140 authored by Moritz Strohm's avatar Moritz Strohm
Browse files

Tic 11: Raumverwaltung: Berechtigungsübersicht soll eine Liste mit Personen...

Tic 11: Raumverwaltung: Berechtigungsübersicht soll eine Liste mit Personen anzeigen, die Berechtigungen haben
parent 165caf7c
No related branches found
No related tags found
No related merge requests found
...@@ -196,6 +196,32 @@ class Resources_AdminController extends AuthenticatedController ...@@ -196,6 +196,32 @@ class Resources_AdminController extends AuthenticatedController
$last_activity_date = $this->now->sub($this->last_activity); $last_activity_date = $this->now->sub($this->last_activity);
$this->last_activity_date = $last_activity_date->format('d.m.Y H:i'); $this->last_activity_date = $last_activity_date->format('d.m.Y H:i');
} }
} else {
//No user selected. Show a list of all users that have
//at least one permission in the room management system.
if ($user_id) {
//User-ID specified, but no user could be found.
PageLayout::postError(
_('Die angegebene Person wurde nicht gefunden!')
);
}
$this->users = User::findBySql(
'`user_id` IN (
SELECT `user_id`
FROM `resource_permissions`
UNION
SELECT `user_id`
FROM `resource_temporary_permissions`
)
ORDER BY `nachname` ASC, `vorname` ASC'
);
if (!$this->users) {
//No user found.
PageLayout::postInfo(
_('Es gibt keine Personen, zu denen Berechtigungen in der Raumverwaltung eingetragen sind!')
);
}
} }
} }
......
...@@ -206,8 +206,34 @@ ...@@ -206,8 +206,34 @@
</tbody> </tbody>
</table> </table>
<? endif ?> <? endif ?>
<? else: ?> <? elseif ($users) : ?>
<?= MessageBox::info( <table class="default sortable-table" data-sortlist="[[0, 0]]">
_('Es wurde keine Person ausgewählt!') <caption>
) ?> <?= _('Personen mit Berechtigungen an der Raumverwaltung') ?>
</caption>
<thead>
<tr>
<th data-sort="text"><?= _('Nachname, Vorname') ?></th>
</tr>
</thead>
<tbody>
<? foreach ($users as $user) : ?>
<tr>
<td>
<a href="<?= $controller->link_for(
'resources/admin/user_permissions',
['user_id' => $user->id]
) ?>">
<?= htmlReady($user->getFullName('full_rev')) ?>
<?= Icon::create('link-intern')->asImg(
[
'class' => 'text-bottom'
]
) ?>
</a>
</td>
</tr>
<? endforeach ?>
</tbody>
</table>
<? endif ?> <? endif ?>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment