diff --git a/lib/models/calendar/CalendarDateAssignment.class.php b/lib/models/calendar/CalendarDateAssignment.class.php index 4e084c2436e867b89c7770539c1a78cb41228129..18cd6101cb39502e1f058e7c069e8523c05e76d6 100644 --- a/lib/models/calendar/CalendarDateAssignment.class.php +++ b/lib/models/calendar/CalendarDateAssignment.class.php @@ -102,7 +102,9 @@ class CalendarDateAssignment extends SimpleORMap implements Event if ($this->suppress_mails) { return; } - if ($this->range_id === $this->calendar_date->editor_id) { + $actor = User::findCurrent() ?? $this->calendar_date->editor; + if ($this->range_id === $actor->id) { + //The user who deleted the date shall not get notified about this. return; } if (!$this->calendar_date || !$this->user) { @@ -116,12 +118,13 @@ class CalendarDateAssignment extends SimpleORMap implements Event $lang_path = getUserLanguagePath($this->range_id); $template = $template_factory->open($lang_path . '/LC_MAILS/date_deleted.php'); $template->set_attribute('date', $this->calendar_date); + $template->set_attribute('actor', $actor); $template->set_attribute('receiver', $this->user); $mail_text = $template->render(); Message::send( '____%system%____', [$this->user->username], - sprintf(_('%s hat einen Termin im Kalender gelöscht'), $this->calendar_date->editor->getFullName()), + sprintf(_('%s hat einen Termin im Kalender gelöscht'), $actor->getFullName()), $mail_text ); diff --git a/locale/de/LC_MAILS/_date_information.php b/locale/de/LC_MAILS/_date_information.php index 5eab14d55df782a0d21bd0dc9b2f2d3fc170bfe2..ac8e981483f9f816f65ff94ae99576247c869035 100644 --- a/locale/de/LC_MAILS/_date_information.php +++ b/locale/de/LC_MAILS/_date_information.php @@ -23,6 +23,6 @@ <? endforeach ?> <? endif ?> -<? if ($receiver_date_assignment) : ?> +<? if (!empty($receiver_date_assignment)) : ?> **Ihre Teilnahme:** <?= $receiver_date_assignment->getParticipationAsString() ?> <? endif ?> diff --git a/locale/de/LC_MAILS/date_deleted.php b/locale/de/LC_MAILS/date_deleted.php index 0ff6ef80a9d7bb33f02b0f5b1aba4c9f00de5f94..0f319d37f886a212c43e55fdc01519b82613d670 100644 --- a/locale/de/LC_MAILS/date_deleted.php +++ b/locale/de/LC_MAILS/date_deleted.php @@ -1,4 +1,4 @@ -<?= $date->editor->getFullName() ?> hat einen Termin im Kalender gelöscht. +<?= $actor->getFullName() ?> hat einen Termin im Kalender gelöscht. <?= $this->render_partial(__DIR__ . '/_date_information', [ 'date' => $date, diff --git a/locale/en/LC_MAILS/_date_information.php b/locale/en/LC_MAILS/_date_information.php index a0cb470287ca79ecbf607131c29e76773d9a7556..0619261adb90d8505d95dc206f60de8fa6dd4d9b 100644 --- a/locale/en/LC_MAILS/_date_information.php +++ b/locale/en/LC_MAILS/_date_information.php @@ -22,3 +22,7 @@ - <?= $participant_string ?> <? endforeach ?> <? endif ?> + +<? if (!empty($receiver_date_assignment)) : ?> +**Your participation:** <?= $receiver_date_assignment->getParticipationAsString() ?> +<? endif ?> diff --git a/locale/en/LC_MAILS/date_deleted.php b/locale/en/LC_MAILS/date_deleted.php index b4bafd66c40828a77c9581b662356168940f43e0..91ef248c32d2b55496894b4d94849d411626d91d 100644 --- a/locale/en/LC_MAILS/date_deleted.php +++ b/locale/en/LC_MAILS/date_deleted.php @@ -1,4 +1,4 @@ -<?= $date->editor->getFullName() ?> has deleted a date in the calendar. +<?= $actor->getFullName() ?> has deleted a date in the calendar. <?= $this->render_partial(__DIR__ . '/_date_information', [ 'date' => $date,