From 2c04e35bed483dfe31eda465345602a117054f44 Mon Sep 17 00:00:00 2001 From: msquare Date: Wed, 20 Dec 2017 23:05:46 +0100 Subject: introduce new shift signup state for not arrived angels --- includes/model/ShiftSignupState.php | 8 +++++++- includes/model/Shifts_model.php | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'includes/model') diff --git a/includes/model/ShiftSignupState.php b/includes/model/ShiftSignupState.php index 9b3de496..1ab7c362 100644 --- a/includes/model/ShiftSignupState.php +++ b/includes/model/ShiftSignupState.php @@ -42,7 +42,12 @@ class ShiftSignupState * User is already signed up */ const SIGNED_UP = 'SIGNED_UP'; - + + /** + * User has to be arrived + */ + const NOT_ARRIVED = 'NOT_ARRIVED'; + /** @var string */ private $state; @@ -83,6 +88,7 @@ class ShiftSignupState private function valueForState($state) { switch ($state) { + case ShiftSignupState::NOT_ARRIVED: case ShiftSignupState::SHIFT_ENDED: return 100; diff --git a/includes/model/Shifts_model.php b/includes/model/Shifts_model.php index f3bb042a..ad64e9b9 100644 --- a/includes/model/Shifts_model.php +++ b/includes/model/Shifts_model.php @@ -312,7 +312,7 @@ function Shift_signup_allowed_angel( $free_entries = Shift_free_entries($needed_angeltype, $shift_entries); if (config('signup_requires_arrival') && !$user['Gekommen']) { - return new ShiftSignupState(ShiftSignupState::SHIFT_ENDED, $free_entries); + return new ShiftSignupState(ShiftSignupState::NOT_ARRIVED, $free_entries); } if ($user_shifts == null) { -- cgit v1.2.3-70-g09d2