From 537179df66b1245f034e9bedeff7d74cbc6a7f5c Mon Sep 17 00:00:00 2001 From: Igor Scheller Date: Fri, 27 Dec 2019 18:58:27 +0100 Subject: Shifts overview: Added filter_max_duration to limit max runtime --- includes/model/ShiftsFilter.php | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'includes') diff --git a/includes/model/ShiftsFilter.php b/includes/model/ShiftsFilter.php index fe3bfa56..c3811977 100644 --- a/includes/model/ShiftsFilter.php +++ b/includes/model/ShiftsFilter.php @@ -119,6 +119,11 @@ class ShiftsFilter */ public function setEndTime($endTime) { + $filterMaxDuration = config('filter_max_duration') * 60 * 60; + if ($filterMaxDuration && ($endTime - $this->startTime > $filterMaxDuration)) { + $endTime = $this->startTime + $filterMaxDuration; + } + $this->endTime = $endTime; } -- cgit v1.2.3-54-g00ecf