diff options
| author | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2025-02-28 15:23:41 +0000 |
|---|---|---|
| committer | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2025-02-28 15:23:41 +0000 |
| commit | 17dbe0865a05cf41c9a180ca3cddf21201f0d2d3 (patch) | |
| tree | 6a1a0380a1ade6806aa775d719aac2b2948b3316 /lib/models/CourseDate.php | |
| parent | 2b384f81f05078ecbac565420881150077fca5f6 (diff) | |
display booked room first if present for Course(Ex?)Date::getLocation(), fixes #4836
Closes #4836
Merge request studip/studip!3623
Diffstat (limited to 'lib/models/CourseDate.php')
| -rw-r--r-- | lib/models/CourseDate.php | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/models/CourseDate.php b/lib/models/CourseDate.php index 9a8d553..7f93ec0 100644 --- a/lib/models/CourseDate.php +++ b/lib/models/CourseDate.php @@ -226,10 +226,10 @@ class CourseDate extends SimpleORMap implements PrivacyObject, Event */ public function getRoomName() { - if (Config::get()->RESOURCES_ENABLE && !empty($this->room_booking->resource)) { - return $this->room_booking->resource->name; + if (Config::get()->RESOURCES_ENABLE && isset($this->room_booking->resource)) { + return $this->getRoom()->name; } - return $this['raum']; + return $this->raum ?? ''; } /** @@ -611,7 +611,7 @@ class CourseDate extends SimpleORMap implements PrivacyObject, Event public function getLocation(): string { - return $this->raum ?? ''; + return $this->getRoomName(); } public function getUniqueId(): string |
