redo fix shift view bug

main
msquare 5 years ago
parent a521ace9f7
commit 8139f2fb4e

@ -269,12 +269,11 @@ function shift_controller()
$shifttype = ShiftType($shift['shifttype_id']); $shifttype = ShiftType($shift['shifttype_id']);
$room = Room($shift['RID']); $room = Room($shift['RID']);
$angeltypes_source = AngelTypes(); $angeltypes = AngelTypes();
$angeltypes = [];
$user_shifts = Shifts_by_user($user->id); $user_shifts = Shifts_by_user($user->id);
$shift_signup_state = new ShiftSignupState(ShiftSignupState::OCCUPIED, 0); $shift_signup_state = new ShiftSignupState(ShiftSignupState::OCCUPIED, 0);
foreach ($angeltypes_source as &$angeltype) { foreach ($angeltypes as &$angeltype) {
$needed_angeltype = NeededAngeltype_by_Shift_and_Angeltype($shift, $angeltype); $needed_angeltype = NeededAngeltype_by_Shift_and_Angeltype($shift, $angeltype);
if (empty($needed_angeltype)) { if (empty($needed_angeltype)) {
continue; continue;
@ -293,7 +292,6 @@ function shift_controller()
); );
$shift_signup_state->combineWith($angeltype_signup_state); $shift_signup_state->combineWith($angeltype_signup_state);
$angeltype['shift_signup_state'] = $angeltype_signup_state; $angeltype['shift_signup_state'] = $angeltype_signup_state;
$angeltypes[] = $angeltype;
} }
return [ return [

Loading…
Cancel
Save