aboutsummaryrefslogtreecommitdiff
path: root/app/views/resources/room_group/permissions.php
blob: 1dd970d4f064259f8abd03c4b896622aec5fd56f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<? if ($rooms): ?>
    <table class="default">
        <caption><?= _('Räume') ?></caption>
        <thead>
            <tr>
                <th><?= _('Name') ?></th>
                <th><?= _('Sitzplätze') ?></th>
            </tr>
        </thead>
        <tbody>
            <? foreach ($rooms as $room): ?>
                <?= $this->render_partial(
                    'resources/_common/_room_tr.php',
                    [
                        'room' => $room,
                        //The permissions view is only accessible
                        //for admin users.
                        'show_user_actions' => false,
                        'show_autor_actions' => false,
                        'show_tutor_actions' => false,
                        'show_admin_actions' => false
                    ]
                ) ?>
            <? endforeach ?>
        </tbody>
    </table>
    <? if ($show_form): ?>
        <?= $this->render_partial(
            'resources/resource/permissions',
            [
                'custom_empty_list_message' => _('Es sind keine gemeinsamen Rechte für die zuvor aufgelisteten Räume vorhanden.'),
                'custom_save_button_text' => _('Zuweisen'),
                'custom_form_action_link' => URLHelper::getLink('dispatch.php/resources/room_group/permissions/' . $clipboard->id),
                'custom_hidden_fields' => [
                    'room_ids[]' => $room_ids
                ],
                'permissions' => $common_permissions,
                'table_caption' => _('Gemeinsame Rechte'),
                'table_id' => 'RoomGroupCommonPermissionTable',
                'user_search' => $user_search
            ]
        ) ?>
        <? if ($partial_permissions): ?>
            <?= $this->render_partial(
                'resources/_common/_special_permission_table.php',
                [
                    'permissions' => $partial_permissions,
                    'custom_columns' => [
                        _('Raum') => $permission_room_list
                    ],
                    'custom_actions' => [
                        [
                            'icon' => Icon::create('arr_2up'),
                            'title' => _('Berechtigung für alle Räume übernehmen'),
                            'link_classes' => 'apply-to-all-action'
                        ]
                    ],
                    'show_delete_action' => false,
                    'table_caption' => _('Spezielle Rechte'),
                    'user_search' => $user_search
                ]
            ) ?>
        <? endif ?>
    <? endif ?>
<? endif ?>