aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMoritz Strohm <strohm@data-quest.de>2025-07-23 10:15:42 +0000
committerMoritz Strohm <strohm@data-quest.de>2025-07-23 12:32:04 +0200
commitfb144c5189a5f0d65cade8d1194a2151cb6c8fda (patch)
treeb67efb57c2ec1c02172202554c5a5ed8721fe8b0
parent5ffcc8b1d3e56de7a09531a446d4284629ecb7eb (diff)
send delete notification for reservations and lock bookings, too, fixes #4749
Closes #4749 Merge request studip/studip!4376 (cherry picked from commit 8676ca591aae20e87053e22fd40be680c8a3cc36) 65a84077 send delete notification for reservations and lock bookings, too Co-authored-by: Moritz Strohm <strohm@data-quest.de>
-rw-r--r--lib/models/resources/ResourceBooking.class.php6
-rw-r--r--locale/de/LC_MAILS/delete_booking_notification.php28
-rw-r--r--locale/en/LC_MAILS/delete_booking_notification.php26
3 files changed, 52 insertions, 8 deletions
diff --git a/lib/models/resources/ResourceBooking.class.php b/lib/models/resources/ResourceBooking.class.php
index f93f38c..16b0af4 100644
--- a/lib/models/resources/ResourceBooking.class.php
+++ b/lib/models/resources/ResourceBooking.class.php
@@ -1896,11 +1896,6 @@ class ResourceBooking extends SimpleORMap implements PrivacyObject, Studip\Calen
*/
public function sendDeleteNotification()
{
- if ($this->booking_type != '0') {
- //We only handle real bookings in this method.
- return;
- }
-
if ($this->end < time()) {
//Bookings that lie in the past can be deleted without
//sending notifications.
@@ -1931,6 +1926,7 @@ class ResourceBooking extends SimpleORMap implements PrivacyObject, Studip\Calen
$lang_path . '/LC_MAILS/delete_booking_notification.php'
);
$template->set_attribute('resource', $booking_resource->getDerivedClassInstance());
+ $template->set_attribute('booking_type', $this->booking_type);
$template->set_attribute('begin', $this->begin);
$template->set_attribute('end', $this->end);
$template->set_attribute('deleting_user', User::findCurrent());
diff --git a/locale/de/LC_MAILS/delete_booking_notification.php b/locale/de/LC_MAILS/delete_booking_notification.php
index c5ef18d..eaec1ba1 100644
--- a/locale/de/LC_MAILS/delete_booking_notification.php
+++ b/locale/de/LC_MAILS/delete_booking_notification.php
@@ -1,13 +1,37 @@
+<? if (in_array($booking_type, [0, 3])) : ?>
<? if ($resource instanceof Room): ?>
Ihre Buchung des Raumes <?= $resource->name ?> am <?= date('d.m.Y', $begin) ?>
von <?= date('H:i', $begin) ?> bis <?= date('H:i', $end) ?> Uhr wurde gelöscht.
-<? else: ?>
+<? else : ?>
Ihre Buchung der Ressource <?= $resource->name ?> am <?= date('d.m.Y', $begin) ?>
von <?= date('H:i', $begin) ?> bis <?= date('H:i', $end) ?> Uhr wurde gelöscht.
<? endif ?>
+<? elseif ($booking_type == 1) : ?>
+<? if ($resource instanceof Room): ?>
+Ihre Reservierung des Raumes <?= $resource->name ?> am <?= date('d.m.Y', $begin) ?>
+von <?= date('H:i', $begin) ?> bis <?= date('H:i', $end) ?> Uhr wurde gelöscht.
+<? else : ?>
+Ihre Reservierung der Ressource <?= $resource->name ?> am <?= date('d.m.Y', $begin) ?>
+von <?= date('H:i', $begin) ?> bis <?= date('H:i', $end) ?> Uhr wurde gelöscht.
+<? endif ?>
+<? elseif ($booking_type == 2) : ?>
+<? if ($resource instanceof Room): ?>
+Ihre Sperrbuchung des Raumes <?= $resource->name ?> am <?= date('d.m.Y', $begin) ?>
+von <?= date('H:i', $begin) ?> bis <?= date('H:i', $end) ?> Uhr wurde gelöscht.
+<? else : ?>
+Ihre Sperrbuchung der Ressource <?= $resource->name ?> am <?= date('d.m.Y', $begin) ?>
+von <?= date('H:i', $begin) ?> bis <?= date('H:i', $end) ?> Uhr wurde gelöscht.
+<? endif ?>
+<? endif ?>
<? if ($booking_course instanceof Course): ?>
-Es handelte sich um eine Buchung für die Veranstaltung <?= $booking_course->getFullname() ?>.
+<? if(in_array($booking_type, [0, 3])) : ?>
+Es handelte sich um eine Buchung für die Veranstaltung <?= $booking_course->getFullName() ?>.
+<? elseif ($booking_type == 1) : ?>
+Es handelte sich um eine Reservierung für die Veranstaltung <?= $booking_course->getFullName() ?>.
+<? elseif ($booking_type == 2) : ?>
+Es handelte sich um eine Sperrbuchung für die Veranstaltung <?= $booking_course->getFullName() ?>.
+<? endif ?>
<? endif ?>
<? if ($deleting_user instanceof User) : ?>
diff --git a/locale/en/LC_MAILS/delete_booking_notification.php b/locale/en/LC_MAILS/delete_booking_notification.php
index 3e57aea..0a34811 100644
--- a/locale/en/LC_MAILS/delete_booking_notification.php
+++ b/locale/en/LC_MAILS/delete_booking_notification.php
@@ -1,3 +1,4 @@
+<? if (in_array($booking_type, [0, 3])) : ?>
<? if ($resource instanceof Room): ?>
Your booking of the room <?= $resource->name ?> on <?= date('d.m.Y', $begin) ?>
from <?= date('H:i', $begin) ?> to <?= date('H:i', $end) ?> has been deleted.
@@ -5,9 +6,32 @@ Your booking of the room <?= $resource->name ?> on <?= date('d.m.Y', $begin) ?>
Your booking of the resource <?= $resource->name ?> on <?= date('d.m.Y', $begin) ?>
from <?= date('H:i', $begin) ?> to <?= date('H:i', $end) ?> has been deleted.
<? endif ?>
+<? elseif ($booking_type == 1) : ?>
+<? if ($resource instanceof Room): ?>
+Your reservation of the room <?= $resource->name ?> on <?= date('d.m.Y', $begin) ?>
+from <?= date('H:i', $begin) ?> to <?= date('H:i', $end) ?> has been deleted.
+<? else: ?>
+Your reservation of the resource <?= $resource->name ?> on <?= date('d.m.Y', $begin) ?>
+from <?= date('H:i', $begin) ?> to <?= date('H:i', $end) ?> has been deleted.
+<? endif ?>
+<? elseif ($booking_type == 2) : ?>
+<? if ($resource instanceof Room): ?>
+Your lock booking of the room <?= $resource->name ?> on <?= date('d.m.Y', $begin) ?>
+from <?= date('H:i', $begin) ?> to <?= date('H:i', $end) ?> has been deleted.
+<? else: ?>
+Your lock booking of the resource <?= $resource->name ?> on <?= date('d.m.Y', $begin) ?>
+from <?= date('H:i', $begin) ?> to <?= date('H:i', $end) ?> has been deleted.
+<? endif ?>
+<? endif ?>
<? if ($booking_course instanceof Course): ?>
-The booking deleted belonged to course <?= $booking_course->getFullname() ?>.
+<? if (in_array($booking_type, [0, 3])) : ?>
+The deleted booking belonged to course <?= $booking_course->getFullName() ?>.
+<? elseif ($booking_type == 1) : ?>
+The deleted reservation belonged to course <?= $booking_course->getFullName() ?>.
+<? elseif ($booking_type == 2) : ?>
+The deleted lock booking belonged to course <?= $booking_course->getFullName() ?>.
+<? endif ?>
<? endif ?>
<? if ($deleting_user instanceof User) : ?>