From 0ec8850969175e6ed7fc8e5e3c451668620252b3 Mon Sep 17 00:00:00 2001 From: Murtaza Sultani Date: Thu, 8 May 2025 15:02:09 +0200 Subject: Set booking_type value if is missing --- app/controllers/resources/booking.php | 2 +- lib/models/resources/Resource.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/resources/booking.php b/app/controllers/resources/booking.php index b2ab0da..a9aeaf1 100644 --- a/app/controllers/resources/booking.php +++ b/app/controllers/resources/booking.php @@ -1533,7 +1533,7 @@ class Resources_BookingController extends AuthenticatedController } } - $this->booking_type = $booking_type; + $this->booking_type = $booking_type ?: Request::int('booking_type'); $this->addEditHandler('add'); } diff --git a/lib/models/resources/Resource.php b/lib/models/resources/Resource.php index 6c3d095..8c1158a 100644 --- a/lib/models/resources/Resource.php +++ b/lib/models/resources/Resource.php @@ -860,7 +860,7 @@ class Resource extends SimpleORMap implements StudipItem $booking->internal_comment = $internal_comment; $booking->booking_type = (int)$booking_type; - if ($booking_type === ResourceBooking::TYPE_LOCK && $GLOBALS['perm']->have_perm('admin')) { + if ($booking_type === ResourceBooking::TYPE_LOCK) { $force_booking = true; } -- cgit v1.0