aboutsummaryrefslogtreecommitdiff
path: root/app/views/room_management/overview/rooms.php
blob: 08b5d0e862a8944823a4d960834067fa609a3f41 (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
<? if ($rooms): ?>
    <table class="default sortable-table rooms-list">
        <colgroup>
            <col style="width: 70%">
            <col style="width: 10%">
            <col>
            <col style="width: 20px">
        </colgroup>
        <thead>
            <tr>
                <th data-sort="text"><?= _('Name') ?></th>
                <th data-sort="number"><?= _('Sitzplätze') ?></th>
                <th data-sort="text"><?= _('Raumkategorie') ?></th>
                <th class="actions"><?= _('Aktionen') ?></th>
            </tr>
        </thead>
        <tbody>
            <? foreach ($rooms as $room): ?>
                <?
                $room_tooltip = null;
                $separable_room = SeparableRoom::findByRoomPart($room);
                if ($separable_room) {
                    $room_tooltip = studip_interpolate(
                        _('Dieser Raum gehört zum teilbaren Raum %{room_name}.'),
                        ['room_name' => $separable_room->name]
                    );
                }
                ?>
                <?= $this->render_partial(
                    'resources/_common/_room_tr.php',
                    [
                        'room' => $room,
                        'room_tooltip' => $room_tooltip,
                        'show_global_admin_actions' => $show_global_admin_actions,
                        'show_admin_actions' => $room->userHasPermission(
                            $user,
                            'admin'
                        ),
                        'show_tutor_actions' => $room->userHasPermission(
                            $user,
                            'tutor'
                        ),
                        'show_autor_actions' => $room->userHasPermission(
                            $user,
                            'autor'
                        ),
                        'show_user_actions' => $room->userHasPermission(
                            $user,
                            'user'
                        ),
                        'user_has_booking_rights' => $room->userHasBookingRights(
                            $user
                        ),
                        'show_picture' => true,
                        'additional_columns' => [
                            $room->category->name,
                        ]
                    ]
                ) ?>
            <? endforeach ?>
        </tbody>
    </table>
<? endif ?>