Fix list of additional angeltypes on shift view

This commit is contained in:
Igor Scheller 2022-01-01 17:24:40 +01:00 committed by msquare
parent 80d87617f2
commit 38043ee35f
1 changed files with 6 additions and 3 deletions

View File

@ -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); $needed_angels .= Shift_view_render_needed_angeltype($needed_angeltype, $angeltypes, $shift, $user_shift_admin);
} }
foreach ($shift['ShiftEntry'] as $shiftEntry) { $shiftEntry = new Collection($shift['ShiftEntry']);
if (!$neededAngels->where('TID', $shiftEntry['TID'])->first()) { 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([ $needed_angels .= Shift_view_render_needed_angeltype([
'TID' => $shiftEntry['TID'], 'TID' => $type,
'count' => 0, 'count' => 0,
'restricted' => true, 'restricted' => true,
'taken' => true, 'taken' => true,