From 8676ca591aae20e87053e22fd40be680c8a3cc36 Mon Sep 17 00:00:00 2001 From: Moritz Strohm Date: Wed, 23 Jul 2025 10:14:52 +0000 Subject: send delete notification for reservations and lock bookings, too, fixes #4749 Closes #4749 Merge request studip/studip!4376 --- lib/models/resources/ResourceBooking.php | 6 +---- locale/de/LC_MAILS/delete_booking_notification.php | 26 +++++++++++++++++++++- locale/en/LC_MAILS/delete_booking_notification.php | 26 +++++++++++++++++++++- 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 @@ + Ihre Buchung des Raumes name ?> am von bis Uhr wurde gelöscht. - + Ihre Buchung der Ressource name ?> am von bis Uhr wurde gelöscht. + + +Ihre Reservierung des Raumes name ?> am +von bis Uhr wurde gelöscht. + +Ihre Reservierung der Ressource name ?> am +von bis Uhr wurde gelöscht. + + + +Ihre Sperrbuchung des Raumes name ?> am +von bis Uhr wurde gelöscht. + +Ihre Sperrbuchung der Ressource name ?> am +von bis Uhr wurde gelöscht. + + + Es handelte sich um eine Buchung für die Veranstaltung getFullName() ?>. + +Es handelte sich um eine Reservierung für die Veranstaltung getFullName() ?>. + +Es handelte sich um eine Sperrbuchung für die Veranstaltung getFullName() ?>. + 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 @@ + Your booking of the room name ?> on from to has been deleted. @@ -5,9 +6,32 @@ Your booking of the room name ?> on Your booking of the resource name ?> on from to has been deleted. + + +Your reservation of the room name ?> on +from to has been deleted. + +Your reservation of the resource name ?> on +from to has been deleted. + + + +Your lock booking of the room name ?> on +from to has been deleted. + +Your lock booking of the resource name ?> on +from to has been deleted. + + -The booking deleted belonged to course getFullName() ?>. + +The deleted booking belonged to course getFullName() ?>. + +The deleted reservation belonged to course getFullName() ?>. + +The deleted lock booking belonged to course getFullName() ?>. + -- cgit v1.0