Skip to content
Snippets Groups Projects
Commit bd65b830 authored by André Noack's avatar André Noack
Browse files

Resolve #2938 "Manuelle Buchung: Alle Räume werden als Teilraum angezeigt"

Closes #2938

Merge request studip/studip!1979
parent befecb52
No related branches found
No related tags found
No related merge requests found
...@@ -633,7 +633,7 @@ class Resources_BookingController extends AuthenticatedController ...@@ -633,7 +633,7 @@ class Resources_BookingController extends AuthenticatedController
{ {
$this->current_user = User::findCurrent(); $this->current_user = User::findCurrent();
$only_one_room = null; $only_one_room = true;
if (Request::submitted('semester_id')) { if (Request::submitted('semester_id')) {
URLHelper::addLinkParam('semester_id', Request::get('semester_id')); URLHelper::addLinkParam('semester_id', Request::get('semester_id'));
...@@ -927,14 +927,12 @@ class Resources_BookingController extends AuthenticatedController ...@@ -927,14 +927,12 @@ class Resources_BookingController extends AuthenticatedController
if ($resource instanceof Room) { if ($resource instanceof Room) {
$other_room_parts = Room::findOtherRoomParts($resource); $other_room_parts = Room::findOtherRoomParts($resource);
$simple_message = true;
if ($other_room_parts) { if ($other_room_parts) {
$this->other_room_parts[$resource->id] = $other_room_parts; $this->other_room_parts[$resource->id] = $other_room_parts;
$this->separable_rooms_selected = true; $this->separable_rooms_selected = true;
if ($only_one_room and $other_room_parts) { if ($only_one_room) {
//If there is only one room we can be informative. //If there is only one room we can be informative.
$simple_message = false;
$other_room_links = []; $other_room_links = [];
foreach ($other_room_parts as $room_part) { foreach ($other_room_parts as $room_part) {
$other_room_links[] = sprintf( $other_room_links[] = sprintf(
...@@ -950,14 +948,13 @@ class Resources_BookingController extends AuthenticatedController ...@@ -950,14 +948,13 @@ class Resources_BookingController extends AuthenticatedController
', ', ', ',
$other_room_links $other_room_links
); );
} else {
$separable_room_messages[] = sprintf(
_('Der Raum %1$s ist ein Teilraum eines teilbaren Raumes.'),
htmlReady($resource->name)
);
} }
} }
if ($simple_message) {
$separable_room_messages[] = sprintf(
_('Der Raum %1$s ist ein Teilraum eines teilbaren Raumes.'),
htmlReady($resource->name)
);
}
} }
} }
......
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