From 11def529a38aae17f32cce1cd314503a79bd8ea6 Mon Sep 17 00:00:00 2001 From: Xenomporio <> Date: Wed, 27 Jul 2022 21:26:59 +0200 Subject: [PATCH] Only one RE: when answering tickets --- www/pages/ticket.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/www/pages/ticket.php b/www/pages/ticket.php index ae93ff9d..3cfa4f14 100644 --- a/www/pages/ticket.php +++ b/www/pages/ticket.php @@ -198,7 +198,13 @@ class Ticket { $recv_messages = $this->app->DB->SelectArr("SELECT n.betreff, n.verfasser, n.mail, n.zeit, n.versendet, n.text FROM ticket_nachricht n INNER JOIN ticket t ON t.schluessel = n.ticket WHERE t.id = ".$id." AND n.versendet != 1 ORDER BY n.zeit DESC"); $this->app->Tpl->Set('EMAIL_AN', $recv_messages[0]['mail']); - $this->app->Tpl->Set('EMAIL_BETREFF', "RE: ".$messages[0]['betreff']); + + if (!str_starts_with(strtoupper($recv_messages[0]['betreff']),"RE:")) { + $this->app->Tpl->Set('EMAIL_BETREFF', "RE: ".$recv_messages[0]['betreff']); + } else { + $this->app->Tpl->Set('EMAIL_BETREFF', $recv_messages[0]['betreff']); + } + $this->app->Tpl->Set('EMAIL_SENDER', $this->app->erp->GetSelectEmailMitName($dokument['von'])); $anschreiben = $this->app->DB->Select("SELECT anschreiben FROM adresse WHERE id='".$result[0]['adresse']."' LIMIT 1");