aboutsummaryrefslogtreecommitdiff
path: root/app/views/resources/resource/booking_plan.php
blob: b9400dc63436eca1579162517db1b62c8f86bcfa (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
<? if (Request::get("allday")) {
        $min_time = '00:00:00';
        $max_time = '24:00:00';
    } else {
        $min_time = Config::get()->RESOURCES_BOOKING_PLAN_START_HOUR . ':00';
        $max_time = Config::get()->RESOURCES_BOOKING_PLAN_END_HOUR . ':00';
    } ?>
<?= \Studip\Fullcalendar::create(
    _('Belegungsplan'),
    [
        'minTime' => ($min_time),
        'maxTime' => ($max_time),
        'allDaySlot' => false,
        'defaultView' =>
            in_array(Request::get("defaultView"), ['dayGridMonth','timeGridWeek','timeGridDay'])
            ? Request::get("defaultView")
            : 'timeGridWeek',
        'defaultDate' => Request::get("defaultDate"),
        'eventSources' => [
            [
                'url' => URLHelper::getLink(
                    'dispatch.php/resources/ajax/get_semester_booking_plan/' . $resource->id
                ),
                'method' => 'GET',
                'extraParams' => [
                    'booking_types' => [
                        ResourceBooking::TYPE_NORMAL,
                        ResourceBooking::TYPE_RESERVATION,
                        ResourceBooking::TYPE_LOCK,
                    ],
                    'display_requests' => 0
                ]
            ]
        ]
    ],
    [],
    'resources-fullcalendar'
) ?>
<ul class="map-key-list">
    <? foreach ($table_keys as $key): ?>
        <li class="map-key">
            <span style="background-color:<?= $key['colour'] ?>">
                    &nbsp;
            </span>
            <?= htmlReady($key['text']) ?>
        </li>
        <li class="map-key">
            <?= Icon::create('refresh', Icon::ROLE_INFO, ['class' => 'text-bottom']); ?>
            <?= _('Wiederholungstermin') ?>
        </li>
        <li class="map-key">
            <?= Icon::create('chat2', Icon::ROLE_INFO, ['class' => 'text-bottom']); ?>
            <?= _('Kommentar') ?>
        </li>
    <? endforeach ?>
</ul>