From 086864d456cb0e1bab8d3394ca9aa3b8b9eddaed Mon Sep 17 00:00:00 2001
From: Jan-Hendrik Willms <tleilax+studip@gmail.com>
Date: Tue, 9 Apr 2024 14:44:19 +0000
Subject: [PATCH] fixes #3978

Closes #3978

Merge request studip/studip!2828
---
 lib/classes/ModulesNotification.class.php | 19 ++++++++++---------
 templates/mail/notification_html.php      |  2 +-
 templates/mail/notification_text.php      |  2 +-
 3 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/lib/classes/ModulesNotification.class.php b/lib/classes/ModulesNotification.class.php
index 3ee66421ea0..f41407140b1 100644
--- a/lib/classes/ModulesNotification.class.php
+++ b/lib/classes/ModulesNotification.class.php
@@ -126,7 +126,8 @@ class ModulesNotification
             $navigation = MyRealmModel::getAdditionalNavigations($seminar_id, $s_data, null, $user_id, $visit_data[$seminar_id]);
             $n_data = [];
             foreach ($this->registered_notification_modules as $id => $m_data) {
-                if (in_array($id, $s_data['notification'])
+                if (
+                    in_array($id, $s_data['notification'])
                     && isset($navigation[$id])
                     && $navigation[$id]->getImage()
                     && $navigation[$id]->getImage()->getRole() === Icon::ROLE_ATTENTION
@@ -168,14 +169,14 @@ class ModulesNotification
         $base_url = URLHelper::setBaseURL('');
         URLHelper::setBaseURl($base_url);
         if ($nav instanceof Navigation && $nav->isVisible(true)) {
-                $url = 'seminar_main.php?again=yes&auswahl=' . $seminar_id . '&redirect_to=' . strtr($nav->getURL(), '?', '&');
-                $icon = $nav->getImage();
-                $text = $nav->getTitle();
-                if (!$text) {
-                    $text = $this->registered_notification_modules[$id]['name'];
-                }
-                $text .= ' - ' .  $nav->getLinkAttributes()['title'];
-                return compact('text', 'url', 'icon', 'seminar_id');
+            $url = 'seminar_main.php?again=yes&auswahl=' . $seminar_id . '&redirect_to=' . strtr($nav->getURL(), '?', '&');
+            $icon = $nav->getImage();
+            $text = $nav->getTitle();
+            if (!$text) {
+                $text = $this->registered_notification_modules[$id]['name'];
             }
+            $text .= ' - ' .  $nav->getLinkAttributes()['title'];
+            return compact('text', 'url', 'icon', 'seminar_id');
+        }
     }
 }
diff --git a/templates/mail/notification_html.php b/templates/mail/notification_html.php
index 48f4cef8daf..d046cb298ae 100644
--- a/templates/mail/notification_html.php
+++ b/templates/mail/notification_html.php
@@ -94,7 +94,7 @@
               <? foreach ($news as $sem_titel => $data) : ?>
                 <tr class="table_header_bold">
                   <td style="font-weight: bold;">
-                    <a href="<?= URLHelper::getLink('seminar_main.php', ['again' => 'yes', 'sso' => $sso, 'auswahl' => $data[0]['range_id']]) ?>">
+                    <a href="<?= URLHelper::getLink('seminar_main.php', ['again' => 'yes', 'sso' => $sso, 'auswahl' => $data[0]['seminar_id']]) ?>">
                       <?= htmlReady($sem_titel) ?>
                       <?= (($semester = Course::find($data[0]['range_id'])->semester_text) ? ' ('.$semester.')' : '') ?>
                     </a>
diff --git a/templates/mail/notification_text.php b/templates/mail/notification_text.php
index bac0d5ede2e..47b8a4aaf85 100644
--- a/templates/mail/notification_text.php
+++ b/templates/mail/notification_text.php
@@ -14,7 +14,7 @@
 <? foreach ($news as $sem_titel => $data) : ?>
 <?= sprintf(_("In der Veranstaltung \"%s\" gibt es folgende Neuigkeiten:"), $sem_titel) ?>
 
-<?= URLHelper::getURL('seminar_main.php', ['again' => 'yes', 'sso' => $sso, 'auswahl' => $data[0]['range_id']]) ?>
+<?= URLHelper::getURL('seminar_main.php', ['again' => 'yes', 'sso' => $sso, 'auswahl' => $data[0]['seminar_id']]) ?>
 
 
 <? foreach ($data as $module) : ?>
-- 
GitLab