diff --git a/includes/view/Shifts_view.php b/includes/view/Shifts_view.php index 859c723e..60c54484 100644 --- a/includes/view/Shifts_view.php +++ b/includes/view/Shifts_view.php @@ -128,10 +128,13 @@ function Shift_view($shift, $shifttype, Room $room, $angeltypes_source, ShiftSig $needed_angels .= Shift_view_render_needed_angeltype($needed_angeltype, $angeltypes, $shift, $user_shift_admin); } - foreach ($shift['ShiftEntry'] as $shiftEntry) { - if (!$neededAngels->where('TID', $shiftEntry['TID'])->first()) { + $shiftEntry = new Collection($shift['ShiftEntry']); + foreach ($shiftEntry->groupBy('TID') as $angelTypes) { + /** @var Collection $angelTypes */ + $type = $angelTypes->first()['TID']; + if (!$neededAngels->where('TID', $type)->first()) { $needed_angels .= Shift_view_render_needed_angeltype([ - 'TID' => $shiftEntry['TID'], + 'TID' => $type, 'count' => 0, 'restricted' => true, 'taken' => true,