summaryrefslogtreecommitdiff
path: root/includes/controller/shifts_controller.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/controller/shifts_controller.php')
-rw-r--r--includes/controller/shifts_controller.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/includes/controller/shifts_controller.php b/includes/controller/shifts_controller.php
index 1e04c5a8..9ac8a766 100644
--- a/includes/controller/shifts_controller.php
+++ b/includes/controller/shifts_controller.php
@@ -202,13 +202,17 @@ function shift_controller() {
$user_shifts = Shifts_by_user($user);
$shift_signup_state = new ShiftSignupState(ShiftSignupState::OCCUPIED, 0);
- foreach ($angeltypes as $angeltype) {
- $angeltype_signup_state = Shift_signup_allowed($user, $shift, $angeltype, null, $user_shifts);
+ foreach ($angeltypes as &$angeltype) {
+ $needed_angeltype = NeededAngeltype_by_Shift_and_Angeltype($shift, $angeltype);
+ $shift_entries = ShiftEntries_by_shift_and_angeltype($shift['SID'], $angeltype['id']);
+
+ $angeltype_signup_state = Shift_signup_allowed($user, $shift, $angeltype, null, $user_shifts, $needed_angeltype, $shift_entries);
if ($shift_signup_state == null) {
$shift_signup_state = $angeltype_signup_state;
} else {
$shift_signup_state->combineWith($angeltype_signup_state);
}
+ $angeltype['shift_signup_state'] = $angeltype_signup_state;
}
return [