From db1c9cc4ce24bbe1393b1981810202bf166df2b4 Mon Sep 17 00:00:00 2001 From: Xenomporio <> Date: Mon, 15 Aug 2022 18:52:36 +0200 Subject: [PATCH] Ticket system added database compatibility to xentral 20 enterprise ticket system --- www/pages/ticket.php | 39 +++++++++++++++++++++++++++++++++++---- 1 file changed, 35 insertions(+), 4 deletions(-) diff --git a/www/pages/ticket.php b/www/pages/ticket.php index ce2b757d..f46cb463 100644 --- a/www/pages/ticket.php +++ b/www/pages/ticket.php @@ -73,7 +73,7 @@ class Ticket { $sql = "SELECT SQL_CALC_FOUND_ROWS t.id, ".$dropnbox.", - t.schluessel, + CONCAT('',t.schluessel,''), t.zeit, a.name, CONCAT('',".$priobetreff.",'
',replace(substring(t.notiz,1,500),'\n','
'),'
'), CONCAT('
'), @@ -220,12 +220,15 @@ class Ticket { $sql = "SELECT n.id, n.betreff, + n.bearbeiter, n.verfasser, n.mail, + t.quelle, n.zeit, n.zeitausgang, n.versendet, n.text, + n.textausgang, n.verfasser_replyto, n.mail_replyto, n.mail_cc, @@ -278,7 +281,25 @@ class Ticket { // Add Messages now foreach ($messages as $message) { - if ($message['versendet'] == '1') { + + // Clear this first + $this->app->Tpl->Set('NACHRICHT_ANHANG',""); + + // Xentral 20 compatibility + if ($message['textausgang'] != '') { + // Sent message + $this->app->Tpl->Set("NACHRICHT_BETREFF",htmlentities($message['betreff'].' (gesendet)')); + $this->app->Tpl->Set("NACHRICHT_ZEIT",$message['zeitausgang']); + $this->app->Tpl->Set("NACHRICHT_FLOAT","right"); + $this->app->Tpl->Set("NACHRICHT_TEXT",$message['textausgang']); + $this->app->Tpl->Set("NACHRICHT_SENDER",htmlentities($message['bearbeiter'])); + $this->app->Tpl->Set("NACHRICHT_RECIPIENTS",htmlentities($message['verfasser']." <".$message['mail'].">")); + $this->app->Tpl->Parse('MESSAGES', "ticket_nachricht.tpl"); + } + + if ($message['versendet'] == '1' && empty($message['textausgang'])) { // textausgang is always empty, except for old Xentral 20 tickets + + // Sent message if (is_null($message['zeitausgang'])) { if (!$showdrafts) { @@ -295,8 +316,18 @@ class Ticket { $this->app->Tpl->Set("NACHRICHT_ZEIT",$message['zeitausgang']); $this->app->Tpl->Set("NACHRICHT_NAME",htmlentities($message['verfasser'])); } else { + + // Received message + $this->app->Tpl->Set("NACHRICHT_SENDER",htmlentities($message['verfasser']." <".$message['mail'].">")); - $this->app->Tpl->Set("NACHRICHT_RECIPIENTS",htmlentities($message['mail_recipients'])); + + if ($message['mail_recipients'] != '') { + $this->app->Tpl->Set("NACHRICHT_RECIPIENTS",htmlentities($message['mail_recipients'])); + } + else { + // Xentral 20 compatibility + $this->app->Tpl->Set("NACHRICHT_RECIPIENTS",htmlentities($message['quelle'])); + } $this->app->Tpl->Set("NACHRICHT_CC_RECIPIENTS",htmlentities($message['mail_cc_recipients'])); $this->app->Tpl->Set("NACHRICHT_BETREFF",htmlentities($message['betreff'])); $this->app->Tpl->Set("NACHRICHT_FLOAT","left"); @@ -305,10 +336,10 @@ class Ticket { $this->app->Tpl->Set("NACHRICHT_TEXT",$message['text']); - $this->app->Tpl->Set('NACHRICHT_ANHANG',""); $this->add_attachments_html($id,$message['id'],'NACHRICHT_ANHANG',false); $this->app->Tpl->Parse('MESSAGES', "ticket_nachricht.tpl"); + } }