aboutsummaryrefslogtreecommitdiff
path: root/app/views/admin/courseplanning/index.php
blob: 5fd28e95096143c220a443354f016e39d2eea505 (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
<?php
/**
 * @var string $plan_title
 * @var array $events
 * @var array $eventless_courses
 * @var Admin_CourseplanningController $controller
 */

$min_time = Config::get()->INSTITUTE_COURSE_PLAN_START_HOUR . ':00';
$max_time = Config::get()->INSTITUTE_COURSE_PLAN_END_HOUR . ':00';
?>

<?= Studip\Fullcalendar::create($plan_title, [
    'minTime' => $min_time,
    'maxTime' => $max_time,
    'allDaySlot' => false,
    'nowIndicator' => false,
    'slotDuration' => '01:00:00',
    'slotLabelInterval' => '01:00',
    'slotLabelFormat' => ['hour' => '2-digit', 'minute' => '2-digit'],
    'timeZone' => 'UTC',
    'header' => [
        'left' => '',
        'right' => ''
    ],
    'columnHeaderFormat' => ['weekday' => 'long'],
    'defaultView' => 'timeGridWeek',
    'eventSources' => [compact('events')],
    'slotEventOverlap' => false,
    'displayEventTime' => false,
    'editable' => true,
    'droppable' => true, // this allows things to be dropped onto the calendar
    'actionCalled' => 'index'
], [
    'class' => 'institute-plan'
]) ?>

<br>

<? if (count($eventless_courses)) : ?>
<table class="default" id="external-events">
    <tr>
        <th><?= _('Veranstaltungen ohne Termine') ?></th>
    </tr>
    <tr>
    <? foreach ($eventless_courses as $cid => $cname): ?>
        <td class="fc-event"
            data-event-course="<?= $cid ?>"
            data-event-title="<?= htmlReady($cname) ?>"
            data-event-duration="02:00"
            data-event-drop-url="<?= $controller->link_for('admin/courseplanning/add_event') ?>"
            data-event-tooltip=""
        >
            <?= htmlReady($cname) ?>
        </td>
    <? endforeach; ?>
    </tr>
</table>
<? endif; ?>