summaryrefslogtreecommitdiff
path: root/includes/model
diff options
context:
space:
mode:
Diffstat (limited to 'includes/model')
-rw-r--r--includes/model/Shifts_model.php7
-rw-r--r--includes/model/User_model.php2
2 files changed, 7 insertions, 2 deletions
diff --git a/includes/model/Shifts_model.php b/includes/model/Shifts_model.php
index 88b28998..03f8341f 100644
--- a/includes/model/Shifts_model.php
+++ b/includes/model/Shifts_model.php
@@ -45,7 +45,7 @@ function Shifts_by_ShiftsFilter(ShiftsFilter $shiftsFilter)
AND NOT `Shifts`.`PSID` IS NULL) AS tmp_shifts
ORDER BY `start`';
-
+
return DB::select(
$sql,
[
@@ -245,6 +245,10 @@ 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);
+ }
+
if ($user_shifts == null) {
$user_shifts = Shifts_by_user($user);
}
@@ -444,6 +448,7 @@ function Shift_update($shift)
*
* @param array $shift
* @return bool|null
+ * @throws Exception
*/
function Shift_update_by_psid($shift)
{
diff --git a/includes/model/User_model.php b/includes/model/User_model.php
index 4757ed3c..0ed602e0 100644
--- a/includes/model/User_model.php
+++ b/includes/model/User_model.php
@@ -241,7 +241,7 @@ function Users_by_angeltype($angeltype)
`UserAngelTypes`.`id` AS `user_angeltype_id`,
`UserAngelTypes`.`confirm_user_id`,
`UserAngelTypes`.`supporter`,
- (`UserDriverLicenses`.`user_id` IS NOT NULL) as `wants_to_drive`,
+ (`UserDriverLicenses`.`user_id` IS NOT NULL) AS `wants_to_drive`,
`UserDriverLicenses`.*
FROM `User`
JOIN `UserAngelTypes` ON `User`.`UID`=`UserAngelTypes`.`user_id`