From c5dd21cbd6d0d8f3fe8e003e6b75b3b46a54fa00 Mon Sep 17 00:00:00 2001 From: Igor Scheller Date: Wed, 18 Sep 2019 04:38:49 +0200 Subject: Deleted shift: Added message about worklog entry --- includes/mailer/shifts_mailer.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'includes/mailer') diff --git a/includes/mailer/shifts_mailer.php b/includes/mailer/shifts_mailer.php index 37b26838..b496a007 100644 --- a/includes/mailer/shifts_mailer.php +++ b/includes/mailer/shifts_mailer.php @@ -94,7 +94,12 @@ function mail_shift_delete($shift) foreach ($users as $user) { $user = (new User())->forceFill($user); if ($user->settings->email_shiftinfo) { - engelsystem_email_to_user($user, __('Your Shift was deleted'), $message, true); + $userMessage = $message; + if ($shift['start'] < time() && !$user['freeloaded']) { + $userMessage .= "\n" . __('Since the deleted shift was already done, we added a worklog entry instead, to keep your work hours correct.') . "\n"; + } + + engelsystem_email_to_user($user, __('Your Shift was deleted'), $userMessage, true); } } } -- cgit v1.2.3-70-g09d2