diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/models/CourseDate.php | 6 | ||||
| -rw-r--r-- | lib/models/SeminarCycleDate.php | 28 | ||||
| -rw-r--r-- | lib/models/resources/ResourceRequest.php | 2 |
3 files changed, 22 insertions, 14 deletions
diff --git a/lib/models/CourseDate.php b/lib/models/CourseDate.php index 87a56e8..91182c6 100644 --- a/lib/models/CourseDate.php +++ b/lib/models/CourseDate.php @@ -370,11 +370,7 @@ class CourseDate extends SimpleORMap implements PrivacyObject, Event $rooms = $this->getRooms(); if ($rooms) { foreach ($rooms as $room) { - $string = sprintf('%s <a href="%s" target="_blank">%s</a>', - $string, - $room->getActionURL('booking_plan'), - htmlReady($room->name) - ); + $string .= ' ' . $room->name; } } elseif ($this->raum) { //Use the freetext room name: diff --git a/lib/models/SeminarCycleDate.php b/lib/models/SeminarCycleDate.php index e400665..799cd4a 100644 --- a/lib/models/SeminarCycleDate.php +++ b/lib/models/SeminarCycleDate.php @@ -214,7 +214,7 @@ class SeminarCycleDate extends SimpleORMap * * @returns string The formatted string. */ - public function toString(string $format = 'short') : string + public function toString(string $format = 'short', bool $as_html = false) : string { if (!in_array($format, ['short', 'long', 'long-start', 'full'])) { //Invalid format: @@ -246,16 +246,24 @@ class SeminarCycleDate extends SimpleORMap $room = $this->getMostBookedRoom(); if ($room) { - $parameters['room_name'] = sprintf( - '<a href="%1$s" data-dialog="size=auto">%2$s</a>', - $room->getActionLink(), - htmlReady($room->name) - ); + if ($as_html) { + $parameters['room_name'] = sprintf( + '<a href="%1$s" data-dialog="size=auto">%2$s</a>', + $room->getActionLink(), + htmlReady($room->name) + ); + } else { + $parameters['room_name'] = $room->name; + } } else { //Use the freetext room name: $room = $this->getMostUsedFreetextRoomName(); if ($room) { - $parameters['room_name'] = $room; + if ($as_html) { + $parameters['room_name'] = htmlReady($room); + } else { + $parameters['room_name'] = $room; + } } } $first_date = $this->getFirstDate(); @@ -273,7 +281,11 @@ class SeminarCycleDate extends SimpleORMap } elseif ($format === 'full') { $parameters['start_week'] = $this->week_offset + 1; if ($this->description) { - $parameters['description'] = $this->description; + if ($as_html) { + $parameters['description'] = htmlReady($this->description); + } else { + $parameters['description'] = $this->description; + } } if ($this->end_offset) { $parameters['end_week'] = $this->end_offset; diff --git a/lib/models/resources/ResourceRequest.php b/lib/models/resources/ResourceRequest.php index 0fe0342..79969b3 100644 --- a/lib/models/resources/ResourceRequest.php +++ b/lib/models/resources/ResourceRequest.php @@ -1577,7 +1577,7 @@ class ResourceRequest extends SimpleORMap implements PrivacyObject, Studip\Calen $begin_date = date('Ymd', $this->begin); $end_date = date('Ymd', $this->end); if($this->resource) { - $resource_name = htmlReady($this->resource->getFullName()); + $resource_name = $this->resource->getFullName(); } if ($begin_date == $end_date) { $strings[] = strftime('%a., %x, %R', $this->begin) . ' - ' |
