Add option for minutes after shift start where signup is allowed

This commit is contained in:
Tim Neumann 2020-09-01 12:46:44 +02:00 committed by Igor Scheller
parent dae856e87e
commit a50dd9cae0
2 changed files with 4 additions and 1 deletions

View File

@ -103,6 +103,9 @@ return [
// Setting this to 0 disables the feature
'signup_advance_hours' => 0,
// Allow signup this many minutes after the start of the shift
'signup_post_minutes' => 0,
// Number of hours that an angel has to sign out own shifts
'last_unsubscribe' => 3,

View File

@ -353,7 +353,7 @@ function Shift_signup_allowed_angel(
return new ShiftSignupState(ShiftSignupState::SIGNED_UP, $free_entries);
}
if (time() > $shift['start']) {
if (time() > $shift['start'] + config('signup_post_minutes') * 60) {
// you can only join if the shift is in future
return new ShiftSignupState(ShiftSignupState::SHIFT_ENDED, $free_entries);
}