Skip to content
Snippets Groups Projects
Commit ac1b2a66 authored by Moritz Strohm's avatar Moritz Strohm
Browse files

do not allow copying a booking into its resource, closes #840

Closes #840

Merge request studip/studip!943
parent 28e2c369
No related branches found
No related tags found
No related merge requests found
...@@ -1550,13 +1550,19 @@ class Resources_BookingController extends AuthenticatedController ...@@ -1550,13 +1550,19 @@ class Resources_BookingController extends AuthenticatedController
$this->show_form = false; $this->show_form = false;
$this->available_resources = ResourceManager::getUserResources( $unfiltered_available_resources = ResourceManager::getUserResources(
$current_user, $current_user,
'autor', 'autor',
null, null,
[$this->booking->resource->class_name], [$this->booking->resource->class_name],
true true
); );
//Filter out the resource of the booking since we only want to allow copying the
//booking into other resources:
$booking_resource_id = $this->booking->resource_id;
$this->available_resources = array_filter($unfiltered_available_resources, function ($item) use ($booking_resource_id) {
return $item->id !== $booking_resource_id;
});
$this->show_form = true; $this->show_form = true;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment