aboutsummaryrefslogtreecommitdiff
path: root/app/views/resources/_common/_room_tr.php
blob: 1b9f46a327e15acc87a1b94652b964d0a26a5c35 (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
66
67
68
69
70
71
72
73
74
75
76
77
78
<?
/**
 * This is a specialisation of the _resource_tr template for rooms.
 *
 * Template variables:
 *
 * $room: A Room object.
 * $show_admin_actions: Boolean: Whether to display actions which are
 *     designed for users with 'admin' resource permissions.
 *     Defaults to false (do not show actions).
 * $show_tutor_actions: Boolean: Whether to display actions which are
 *     designed for users with 'tutor' resource permissions.
 *     Defaults to false (do not show actions).
 * $show_autor_actions: Boolean: Whether to display actions which are
 *     designed for users with 'autor' resource permissions.
 *     Defaults to false (do not show actions).
 * $show_user_actions: Boolean: Whether to display actions which are
 *     designed for users with 'user' resource permissions.
 *     Defaults to false (do not show actions).
 * $user_has_booking_rights: Boolean: Whether the user for which this template
 *     is rendered has booking rights on the resource (true) or not (false).
 * $show_picture: Boolean: Whether to display the room picture or not.
 *     Defaults to false (do not show picture).
 * $additional_properties: Array: Additional properties
 *     that shall be displayed in extra columns.
 * $additional_columns: Array: Additional columns for the table.
 * $additional_actions: Array: Additional actions for the action menu.
 *     This array contains associative arrays where each of those arrays
 *     has the following structure and indexes:
 *     [
 *         0 => Link
 *         1 => Label
 *         2 => Icon
 *         3 => Link attributes
 *     ]
 */
?>

<?
$room_actions = [];
if ($room->requestable && $show_autor_actions) {
    $room_actions = [
        '0071' => [
            $room->getActionLink('request_list'),
            _('Anfragen auflösen'),
            Icon::create('room-request'),
            ['target' => '_blank']
        ]
    ];
} ?>

<?= $this->render_partial(
    'resources/_common/_resource_tr.php',
    [
        'checkbox_data' => $checkbox_data ?? '',
        'resource' => $room,
        'booking_plan_link_on_name' => true,
        'resource_tooltip' => $room_tooltip ?? '',
        'show_global_admin_actions' => $show_global_admin_actions,
        'show_admin_actions' => $show_admin_actions,
        'show_tutor_actions' => $show_tutor_actions,
        'show_autor_actions' => $show_autor_actions,
        'show_user_actions' => $show_user_actions,
        'user_has_booking_rights' => $user_has_booking_rights,
        'show_picture' => true,
        'show_full_name' => false,
        'additional_properties' => ['seats'],
        'clipboard_range_type' => 'Room',
        'additional_actions' => (
        (!empty($additional_actions) && is_array($additional_actions))
            ? array_merge(
                $room_actions,
                $additional_actions
            )
            : $room_actions
        )
    ]
) ?>