summaryrefslogtreecommitdiff
path: root/includes/model
diff options
context:
space:
mode:
authormsquare <msquare@notrademark.de>2017-12-20 23:05:46 +0100
committermsquare <msquare@notrademark.de>2017-12-20 23:05:46 +0100
commit2c04e35bed483dfe31eda465345602a117054f44 (patch)
treed9b0fd897ae91b4e3a11010e79715b28c0d8ee8c /includes/model
parent7a3bdda483be2a32cc67bcf97b246edcb48c124e (diff)
introduce new shift signup state for not arrived angels
Diffstat (limited to 'includes/model')
-rw-r--r--includes/model/ShiftSignupState.php8
-rw-r--r--includes/model/Shifts_model.php2
2 files changed, 8 insertions, 2 deletions
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) {