From b837adff579fe753d5ccf367470dd46edd36d588 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Till=20Gl=C3=B6ggler?= <till@gundk.it> Date: Fri, 8 Oct 2021 12:31:39 +0200 Subject: [PATCH] fixes #281 --- app/controllers/resources/room_request.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/controllers/resources/room_request.php b/app/controllers/resources/room_request.php index b6568a4f4ea..b10afcf15b7 100644 --- a/app/controllers/resources/room_request.php +++ b/app/controllers/resources/room_request.php @@ -197,7 +197,13 @@ class Resources_RoomRequestController extends AuthenticatedController } if ($this->filter['request_periods'] == 'periodic') { - $sql .= " AND resource_requests.termin_id = '' "; + // get rid of requests for single dates AND requests for multiple single dates + $sql .= " AND resource_requests.termin_id = '' + AND NOT EXISTS + ( + SELECT * FROM resource_request_appointments + WHERE resource_request_appointments.request_id = resource_requests.id + )"; } if ($this->filter['request_periods'] == 'aperiodic') { $sql .= " AND resource_requests.termin_id <> '' "; -- GitLab