From 36798071f8bc68e0f423293b9c9006655cfcc1ad Mon Sep 17 00:00:00 2001 From: Moritz Strohm <strohm@data-quest.de> Date: Thu, 21 Mar 2024 15:25:51 +0000 Subject: [PATCH] reverted changes from StEP #1354 in lib/modules/ScheduleWidget.php, fixes #3836 Closes #3836 Merge request studip/studip!2703 --- lib/modules/ScheduleWidget.php | 42 +++++----------------------------- 1 file changed, 6 insertions(+), 36 deletions(-) diff --git a/lib/modules/ScheduleWidget.php b/lib/modules/ScheduleWidget.php index 0393176827d..5adc8017c38 100644 --- a/lib/modules/ScheduleWidget.php +++ b/lib/modules/ScheduleWidget.php @@ -39,45 +39,15 @@ class ScheduleWidget extends CorePlugin implements PortalPlugin */ public function getPortalTemplate() { - $week_slot_duration = \Studip\Calendar\Helper::getCalendarSlotDuration('week'); - $calendar_settings = $GLOBALS['user']->cfg->CALENDAR_SETTINGS ?? []; - - $semester = Semester::findCurrent(); - $fullcalendar = \Studip\Fullcalendar::create( - '', - [ - 'minTime' => '08:00', - 'maxTime' => '20:00', - 'allDaySlot' => false, - 'header' => [ - 'left' => '', - 'right' => '' - ], - 'views' => [ - 'timeGridWeek' => [ - 'columnHeaderFormat' => ['weekday' => 'long'], - 'weekends' => $calendar_settings['type_week'] === 'LONG', - 'slotDuration' => $week_slot_duration - ] - ], - 'defaultView' => 'timeGridWeek', - 'defaultDate' => date('Y-m-d'), - 'timeGridEventMinHeight' => 20, - 'eventSources' => [ - [ - 'url' => URLHelper::getURL('dispatch.php/calendar/calendar/schedule_data'), - 'method' => 'GET', - 'extraParams' => [ - 'semester_id' => $semester->id, - 'full_semester_time_range' => false - ] - ] - ] - ] + $view = CalendarScheduleModel::getUserCalendarView( + $GLOBALS['user']->id, + false, + false, + $days = [0, 1, 2, 3, 4] ); $template = $GLOBALS['template_factory']->open('shared/string'); - $template->content = $fullcalendar; + $template->content = CalendarWidgetView::createFromWeekView($view)->render(); return $template; } -- GitLab