From 93da199f124a3a73b4a947e2298db829f39a48db Mon Sep 17 00:00:00 2001 From: Xenomporio <> Date: Wed, 3 Aug 2022 10:30:05 +0200 Subject: [PATCH] Bugfix ticket system display and handling of recipients --- classes/Modules/Ticket/Task/TicketImportHelper.php | 2 +- www/pages/ticket.php | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/classes/Modules/Ticket/Task/TicketImportHelper.php b/classes/Modules/Ticket/Task/TicketImportHelper.php index 71af4b87..53677a09 100644 --- a/classes/Modules/Ticket/Task/TicketImportHelper.php +++ b/classes/Modules/Ticket/Task/TicketImportHelper.php @@ -554,7 +554,7 @@ class TicketImportHelper // Add all the recipients to the header table - if (count($message->getRecipients()) > 1) { + if (count($message->getRecipients()) > 0) { foreach ($message->getRecipients() as $recipient) { $recipient_address = $this->db->real_escape_string($recipient->getEmail()); diff --git a/www/pages/ticket.php b/www/pages/ticket.php index dc9a5430..f0e4defb 100644 --- a/www/pages/ticket.php +++ b/www/pages/ticket.php @@ -562,7 +562,13 @@ class Ticket { } $sql = "SELECT GROUP_CONCAT(DISTINCT `value` ORDER BY `value` SEPARATOR ', ') FROM ticket_header th WHERE th.ticket_nachricht = ".$recv_messages[0]['id']." AND `value` <> '".$senderAddress."' AND type='to'"; - $to .= ", ".$this->app->DB->Select($sql); + + $to_additional = $this->app->DB->Select($sql); + + if (!empty($to_additional)) { + $to .= ", ".$to_additional; + } + $sql = "SELECT GROUP_CONCAT(DISTINCT `value` ORDER BY `value` SEPARATOR ', ') FROM ticket_header th WHERE th.ticket_nachricht = ".$recv_messages[0]['id']." AND `value` <> '".$senderAddress."' AND type='cc'"; $cc = $this->app->DB->Select($sql); } @@ -620,8 +626,10 @@ class Ticket { // Attachments $files = $this->app->erp->GetDateiSubjektObjektDateiname('Anhang','Ticket',$drafted_messages[0]['id'],""); - if ($cc != '') { + if ($drafted_messages[0]['mail_cc'] != '') { $cc = explode(',',$drafted_messages[0]['mail_cc']); + } else { + $cc = null; } if (