From d208cab1ac17a958fcd070c67e07b56e6caadff9 Mon Sep 17 00:00:00 2001 From: Igor Scheller Date: Sun, 30 Dec 2018 04:39:47 +0100 Subject: [PATCH] When only free shifts should be shown: filter for selected angel types closes #556 (shifts shown, where not selected angeltype is free) --- includes/controller/users_controller.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/includes/controller/users_controller.php b/includes/controller/users_controller.php index 393acca8..dea27645 100644 --- a/includes/controller/users_controller.php +++ b/includes/controller/users_controller.php @@ -492,6 +492,13 @@ function shiftCalendarRendererByShiftFilter(ShiftsFilter $shiftsFilter) foreach ($needed_angeltypes[$shift['SID']] as $needed_angeltype) { $taken = 0; + if ( + !in_array(ShiftsFilter::FILLED_FILLED, $shiftsFilter->getFilled()) + && !in_array($needed_angeltype['angel_type_id'], $shiftsFilter->getTypes()) + ) { + continue; + } + foreach ($shift_entries[$shift['SID']] as $shift_entry) { if ( $needed_angeltype['angel_type_id'] == $shift_entry['TID']