aboutsummaryrefslogtreecommitdiff
path: root/app/views/admin/courseplanning/index.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/views/admin/courseplanning/index.php')
-rw-r--r--app/views/admin/courseplanning/index.php61
1 files changed, 37 insertions, 24 deletions
diff --git a/app/views/admin/courseplanning/index.php b/app/views/admin/courseplanning/index.php
index 5fd28e9..75803ec 100644
--- a/app/views/admin/courseplanning/index.php
+++ b/app/views/admin/courseplanning/index.php
@@ -11,26 +11,36 @@ $max_time = Config::get()->INSTITUTE_COURSE_PLAN_END_HOUR . ':00';
?>
<?= Studip\Fullcalendar::create($plan_title, [
- 'minTime' => $min_time,
- 'maxTime' => $max_time,
+ 'slotMinTime' => $min_time,
+ 'slotMaxTime' => $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' => ''
+ 'headerToolbar' => [
+ 'start' => '',
+ 'end' => ''
],
- 'columnHeaderFormat' => ['weekday' => 'long'],
- 'defaultView' => 'timeGridWeek',
+ 'dayHeaderFormat' => ['weekday' => 'long'],
+ 'views' => [
+ \Studip\Fullcalendar::VIEW_WEEK => [
+ 'dayHeaderFormat' => ['weekday' => 'short'],
+ 'weekends' => true,
+ 'titleFormat' => [],
+ 'weekText' => ''
+ ]
+ ],
+ 'initialView' => \Studip\Fullcalendar::VIEW_WEEK,
+ 'display_holidays' => false,
+ 'display_vacations' => false,
'eventSources' => [compact('events')],
'slotEventOverlap' => false,
'displayEventTime' => false,
'editable' => true,
'droppable' => true, // this allows things to be dropped onto the calendar
- 'actionCalled' => 'index'
+ 'external_droppable_container_id' => 'droppable-course-container',
+ 'external_droppable_event_selector' => 'td.draggable-course'
], [
'class' => 'institute-plan'
]) ?>
@@ -38,22 +48,25 @@ $max_time = Config::get()->INSTITUTE_COURSE_PLAN_END_HOUR . ':00';
<br>
<? if (count($eventless_courses)) : ?>
-<table class="default" id="external-events">
+<table class="default course-planning" id="droppable-course-container">
<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>
+ <? foreach ($eventless_courses as $cid => $cname) : ?>
+ <tr>
+ <?
+ $event_object = [
+ 'title' => $cname,
+ 'duration' => '02:00',
+ 'studip_api_urls' => [
+ 'receive' => $controller->link_for('admin/courseplanning/add_event/' . $cid)
+ ]
+ ];
+ ?>
+ <td class="draggable-course" data-event="<?= htmlReady(json_encode($event_object)) ?>">
+ <?= htmlReady($cname) ?>
+ </td>
+ </tr>
+ <? endforeach ?>
</table>
-<? endif; ?>
+<? endif ?>