From 874e8a04c006279b2117cdab32cdff7c85a7f509 Mon Sep 17 00:00:00 2001 From: Clemens Creutzburg Date: Mon, 30 Mar 2026 20:35:13 +0200 Subject: [PATCH] Zeiterfassung Mail anpassung --- .../inc/time_error_notifications.inc.php | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/zeiterfassung/inc/time_error_notifications.inc.php b/zeiterfassung/inc/time_error_notifications.inc.php index dcc0f23..8f7256c 100644 --- a/zeiterfassung/inc/time_error_notifications.inc.php +++ b/zeiterfassung/inc/time_error_notifications.inc.php @@ -349,11 +349,24 @@ if (!function_exists('timeErrorNotificationsFormatDateList')) { } } +if (!function_exists('timeErrorNotificationsBuildEmployeeMail')) { + function timeErrorNotificationsGetTrackingUrl(): string + { + if (!empty($_SERVER['HTTP_HOST'])) { + $protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') ? 'https://' : 'http://'; + return $protocol . $_SERVER['HTTP_HOST'] . '/zeiterfassung/'; + } + + return 'https://www.praxis-creutzburg.de/zeiterfassung/'; + } +} + if (!function_exists('timeErrorNotificationsBuildEmployeeMail')) { function timeErrorNotificationsBuildEmployeeMail(array $employee, string $stage): array { $name = trim($employee['vorname'] . ' ' . $employee['nachname']); $dateList = timeErrorNotificationsFormatDateList($employee['error_dates']); + $trackingUrl = timeErrorNotificationsGetTrackingUrl(); $subject = ($stage === 'employee_day_3') ? 'Erneute Erinnerung zu offenen Zeitfehlern' : 'Erinnerung zu offenen Zeitfehlern'; @@ -361,7 +374,8 @@ if (!function_exists('timeErrorNotificationsBuildEmployeeMail')) { $body = '

Hallo ' . htmlspecialchars($name, ENT_QUOTES, 'UTF-8') . ',

' . '

in deiner Zeiterfassung gibt es weiterhin offene Buchungsfehler.

' . '

Betroffene Tage: ' . htmlspecialchars($dateList, ENT_QUOTES, 'UTF-8') . '

' - . '

Bitte korrigiere die Eintraege in der Zeiterfassung. Solange die Fehler offen bleiben, wird der Vorgang weiter verfolgt.

'; + . '

Bitte korrigiere die Eintraege in der Zeiterfassung. Solange die Fehler offen bleiben, wird der Vorgang weiter verfolgt.

' + . '

Zur Zeiterfassung

'; return [ 'subject' => $subject, @@ -375,12 +389,14 @@ if (!function_exists('timeErrorNotificationsBuildAdminMail')) { { $employeeName = trim($employee['vorname'] . ' ' . $employee['nachname']); $dateList = timeErrorNotificationsFormatDateList($employee['error_dates']); + $trackingUrl = timeErrorNotificationsGetTrackingUrl(); $subject = 'Eskalation: Offene Zeitfehler von ' . $employeeName; $body = '

Bei einem Mitarbeiter bestehen weiterhin offene Zeitfehler.

' . '

Mitarbeiter: ' . htmlspecialchars($employeeName, ENT_QUOTES, 'UTF-8') . '
' . 'E-Mail: ' . htmlspecialchars($employee['email'], ENT_QUOTES, 'UTF-8') . '
' . 'Betroffene Tage: ' . htmlspecialchars($dateList, ENT_QUOTES, 'UTF-8') . '

' - . '

Bitte pruefen Sie die Zeiterfassung und stimmen Sie die Korrektur mit dem Mitarbeiter ab.

'; + . '

Bitte pruefen Sie die Zeiterfassung und stimmen Sie die Korrektur mit dem Mitarbeiter ab.

' + . '

Zur Zeiterfassung

'; return [ 'subject' => $subject,