Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Stud.IP
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jan-Hendrik Willms
Stud.IP
Commits
4c06fda4
Verified
Commit
4c06fda4
authored
3 years ago
by
Till Glöggler
Browse files
Options
Downloads
Patches
Plain Diff
fixes #281, improve query, consider aperiodic case as well
parent
b837adff
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/controllers/resources/room_request.php
+17
-1
17 additions, 1 deletion
app/controllers/resources/room_request.php
with
17 additions
and
1 deletion
app/controllers/resources/room_request.php
+
17
−
1
View file @
4c06fda4
...
@@ -198,15 +198,31 @@ class Resources_RoomRequestController extends AuthenticatedController
...
@@ -198,15 +198,31 @@ class Resources_RoomRequestController extends AuthenticatedController
if
(
$this
->
filter
[
'request_periods'
]
==
'periodic'
)
{
if
(
$this
->
filter
[
'request_periods'
]
==
'periodic'
)
{
// get rid of requests for single dates AND requests for multiple single dates
// get rid of requests for single dates AND requests for multiple single dates
// also check if there exists cycle dates in case it is a request for the whole seminar
$sql
.
=
" AND resource_requests.termin_id = ''
$sql
.
=
" AND resource_requests.termin_id = ''
AND NOT EXISTS
AND NOT EXISTS
(
(
SELECT * FROM resource_request_appointments
SELECT * FROM resource_request_appointments
WHERE resource_request_appointments.request_id = resource_requests.id
WHERE resource_request_appointments.request_id = resource_requests.id
)
AND EXISTS (
SELECT * FROM seminar_cycle_dates
WHERE seminar_cycle_dates.seminar_id = resource_requests.course_id
)"
;
)"
;
}
}
if
(
$this
->
filter
[
'request_periods'
]
==
'aperiodic'
)
{
if
(
$this
->
filter
[
'request_periods'
]
==
'aperiodic'
)
{
$sql
.
=
" AND resource_requests.termin_id <> '' "
;
$sql
.
=
" AND (
resource_requests.termin_id <> ''
OR EXISTS
(
SELECT * FROM resource_request_appointments
WHERE resource_request_appointments.request_id = resource_requests.id
)
OR NOT EXISTS (
SELECT * FROM seminar_cycle_dates
WHERE seminar_cycle_dates.seminar_id = resource_requests.course_id
)
)"
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment