summaryrefslogtreecommitdiff
path: root/includes/controller/shifts_controller.php
diff options
context:
space:
mode:
authormsquare <msquare@notrademark.de>2016-12-27 23:02:05 +0100
committermsquare <msquare@notrademark.de>2016-12-27 23:02:05 +0100
commit46528fe1d888ae09d125c2ae8ac1952f1d7f29f6 (patch)
treeb8361bb6aff1307845c9903d2693121835e8d033 /includes/controller/shifts_controller.php
parentffc33993d4cea15d4d8a4af631afdd97c3567c36 (diff)
shift view performance improvements
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 [