aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMoritz Strohm <strohm@data-quest.de>2025-07-23 10:14:52 +0000
committerMoritz Strohm <strohm@data-quest.de>2025-07-23 10:14:52 +0000
commit8676ca591aae20e87053e22fd40be680c8a3cc36 (patch)
tree70557f4e7a6007ae8f62c2654044612eeefb7b8e
parent02dd88ae5e411b6b9e9b62d4ab8695697b7f8b74 (diff)
send delete notification for reservations and lock bookings, too, fixes #4749
Closes #4749 Merge request studip/studip!4376
-rw-r--r--lib/models/resources/ResourceBooking.php6
-rw-r--r--locale/de/LC_MAILS/delete_booking_notification.php26
-rw-r--r--locale/en/LC_MAILS/delete_booking_notification.php26
3 files changed, 51 insertions, 7 deletions
diff --git a/lib/models/resources/ResourceBooking.php b/lib/models/resources/ResourceBooking.php
index ba8e9b4..5e527d0 100644
--- a/lib/models/resources/ResourceBooking.php
+++ b/lib/models/resources/ResourceBooking.php
@@ -1970,11 +1970,6 @@ class ResourceBooking extends SimpleORMap implements PrivacyObject, Studip\Calen
*/
public function sendDeleteNotification()
{
- if ($this->booking_type != self::TYPE_NORMAL) {
- //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.
@@ -2005,6 +2000,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 4ba483f..540bbac 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, [ResourceBooking::TYPE_NORMAL, ResourceBooking::TYPE_PLANNED])) : ?>
<? 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 == ResourceBooking::TYPE_RESERVATION) : ?>
+<? 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 == ResourceBooking::TYPE_LOCK) : ?>
+<? 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): ?>
+<? if(in_array($booking_type, [ResourceBooking::TYPE_NORMAL, ResourceBooking::TYPE_PLANNED])) : ?>
Es handelte sich um eine Buchung für die Veranstaltung <?= $booking_course->getFullName() ?>.
+<? elseif ($booking_type == ResourceBooking::TYPE_RESERVATION) : ?>
+Es handelte sich um eine Reservierung für die Veranstaltung <?= $booking_course->getFullName() ?>.
+<? elseif ($booking_type == ResourceBooking::TYPE_LOCK) : ?>
+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 4146dd9..55bbc7e 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, [ResourceBooking::TYPE_NORMAL, ResourceBooking::TYPE_PLANNED])) : ?>
<? 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 == ResourceBooking::TYPE_RESERVATION) : ?>
+<? 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 == ResourceBooking::TYPE_LOCK) : ?>
+<? 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, [ResourceBooking::TYPE_NORMAL, ResourceBooking::TYPE_PLANNED])) : ?>
+The deleted booking belonged to course <?= $booking_course->getFullName() ?>.
+<? elseif ($booking_type == ResourceBooking::TYPE_RESERVATION) : ?>
+The deleted reservation belonged to course <?= $booking_course->getFullName() ?>.
+<? elseif ($booking_type == ResourceBooking::TYPE_LOCK) : ?>
+The deleted lock booking belonged to course <?= $booking_course->getFullName() ?>.
+<? endif ?>
<? endif ?>
<? if ($deleting_user instanceof User) : ?>