summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorIgor Scheller <igor.scheller@igorshp.de>2019-09-18 04:38:49 +0200
committerIgor Scheller <igor.scheller@igorshp.de>2019-09-18 04:38:49 +0200
commitc5dd21cbd6d0d8f3fe8e003e6b75b3b46a54fa00 (patch)
treeb85814fd7a014b37317671c0b76ccce1f9d3d97e /includes
parent85e440339267859f9d3f70183c32f9443ca9a27a (diff)
Deleted shift: Added message about worklog entry
Diffstat (limited to 'includes')
-rw-r--r--includes/mailer/shifts_mailer.php7
1 files changed, 6 insertions, 1 deletions
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);
}
}
}