Skip to content
Snippets Groups Projects
Commit 36798071 authored by Moritz Strohm's avatar Moritz Strohm Committed by Peter Thienel
Browse files

reverted changes from StEP #1354 in lib/modules/ScheduleWidget.php, fixes #3836

Closes #3836

Merge request studip/studip!2703
parent 0dfa6387
No related branches found
No related tags found
No related merge requests found
......@@ -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;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment