Skip to content
Snippets Groups Projects
Commit e70f6eb0 authored by David Siegfried's avatar David Siegfried Committed by Jan-Hendrik Willms
Browse files

fix errors in cal-export, re #3832

Merge request studip/studip!2696
parent a5d02f3c
Branches
No related tags found
No related merge requests found
...@@ -124,13 +124,12 @@ class ICalendarExport ...@@ -124,13 +124,12 @@ class ICalendarExport
} }
/** /**
* @param CalendarDate $date * @param CalendarDate | CourseExDate $date
* @return array * @return array
*/ */
public function prepareCalendarDate(CalendarDate $date): array public function prepareCalendarDate($date): array
{ {
$properties = return [
[
'SUMMARY' => $date->title, 'SUMMARY' => $date->title,
'DESCRIPTION' => $date->description, 'DESCRIPTION' => $date->description,
'LOCATION' => $date->location, 'LOCATION' => $date->location,
...@@ -152,13 +151,15 @@ class ICalendarExport ...@@ -152,13 +151,15 @@ class ICalendarExport
'month' => $date->month 'month' => $date->month
] ]
]; ];
return $properties;
} }
public function prepareCourseDate(CourseDate $date): array /**
* @param CalendarDate | CourseExDate $date
* @return array
*/
public function prepareCourseDate($date): array
{ {
$properties = return [
[
'SUMMARY' => $date->course->getFullName(), 'SUMMARY' => $date->course->getFullName(),
'DESCRIPTION' => '', 'DESCRIPTION' => '',
'LOCATION' => $date->getRoomName(), 'LOCATION' => $date->getRoomName(),
...@@ -170,7 +171,6 @@ class ICalendarExport ...@@ -170,7 +171,6 @@ class ICalendarExport
'DTEND' => $date->end_time, 'DTEND' => $date->end_time,
'PRIORITY' => '' 'PRIORITY' => ''
]; ];
return $properties;
} }
/** /**
...@@ -600,14 +600,12 @@ class ICalendarExport ...@@ -600,14 +600,12 @@ class ICalendarExport
*/ */
private function getFacultyEmail(string $user_id): string private function getFacultyEmail(string $user_id): string
{ {
$stmt = DBManager::get()->prepare(' return DBManager::get()->fetchColumn('
SELECT `email` SELECT `email`
FROM `Institute` FROM `Institute`
LEFT JOIN `user_inst` USING(`institut_id`) LEFT JOIN `user_inst` USING(`institut_id`)
WHERE `Institute`.`Institut_id` = `fakultaets_id` WHERE `Institute`.`Institut_id` = `fakultaets_id`
AND `user_id` = ?'); AND `user_id` = ?', [$user_id]);
$stmt->execute([$user_id]);
return $stmt->fetchColumn();
} }
/** /**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment