From 46528fe1d888ae09d125c2ae8ac1952f1d7f29f6 Mon Sep 17 00:00:00 2001 From: msquare Date: Tue, 27 Dec 2016 23:02:05 +0100 Subject: shift view performance improvements --- includes/controller/shift_entries_controller.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'includes/controller/shift_entries_controller.php') diff --git a/includes/controller/shift_entries_controller.php b/includes/controller/shift_entries_controller.php index 32c94a6b..d0a12288 100644 --- a/includes/controller/shift_entries_controller.php +++ b/includes/controller/shift_entries_controller.php @@ -48,7 +48,10 @@ function shift_entry_add_controller() { $user_id = $user['UID']; } - $shift_signup_allowed = Shift_signup_allowed(User($user_id), $shift, $type); + $needed_angeltype = NeededAngeltype_by_Shift_and_Angeltype($shift, $type); + $shift_entries = ShiftEntries_by_shift_and_angeltype($shift['SID'], $type['id']); + + $shift_signup_allowed = Shift_signup_allowed(User($user_id), $shift, $type, null, null, $needed_angeltype, $shift_entries); if (! $shift_signup_allowed->isSignupAllowed()) { error(_("You are not allowed to sign up for this shift. Maybe shift is full or already running.")); redirect(shift_link($shift)); -- cgit v1.2.3-54-g00ecf