diff --git a/include/class.mailparse.php b/include/class.mailparse.php index dfc4c6b3f2932f2a97ca0b7234215b2ba70cbfca..42d4abe242eb9e6b4e202a83d589076e3b858995 100644 --- a/include/class.mailparse.php +++ b/include/class.mailparse.php @@ -140,11 +140,15 @@ class Mail_Parse { function getToAddressList(){ // Delivered-to incase it was a BBC mail. - if (!($header = $this->struct->headers['to'])) - if (!($header = $this->struct->headers['delivered-to'])) - return null; - - return Mail_Parse::parseAddressList($header); + $tolist = array(); + if ($header = $this->struct->headers['to']) + $tolist = array_merge($tolist, + Mail_Parse::parseAddressList($header)); + if ($header = $this->struct->headers['delivered-to']) + $tolist = array_merge($tolist, + Mail_Parse::parseAddressList($header)); + + return $tolist ? $tolist : null; } function getCcAddressList(){ diff --git a/include/class.thread.php b/include/class.thread.php index a68db4ddf94d6e51c573bccd90fa89f2c257a1d6..f797e64652d84e453de3b63069d589c52b37e00d 100644 --- a/include/class.thread.php +++ b/include/class.thread.php @@ -574,6 +574,7 @@ Class ThreadEntry { 'source' => 'Email', 'ip' => '', 'reply_to' => $this, + 'recipients' => $mailinfo['recipients'], ); if (isset($mailinfo['attachments'])) @@ -588,6 +589,7 @@ Class ThreadEntry { $vars['message'] = $body; return $ticket->postMessage($vars, 'Email'); } + // XXX: Consider collaborator role elseif ($staff_id = Staff::getIdByEmail($mailinfo['email'])) { $vars['staffId'] = $staff_id; $poster = Staff::lookup($staff_id); diff --git a/include/class.ticket.php b/include/class.ticket.php index b51269ccfb8594cbf57e085782bbc900da3a3abd..0f7d7e7520ba23765a25239be995e06bd93299c6 100644 --- a/include/class.ticket.php +++ b/include/class.ticket.php @@ -65,8 +65,10 @@ class Ticket { return false; $sql='SELECT ticket.*, lock_id, dept_name ' - .' ,IF(sla.id IS NULL, NULL, DATE_ADD(ticket.created, INTERVAL sla.grace_period HOUR)) as sla_duedate ' - .' ,count(attach.attach_id) as attachments, count(collab.id) as collaborators ' + .' ,IF(sla.id IS NULL, NULL, ' + .'DATE_ADD(ticket.created, INTERVAL sla.grace_period HOUR)) as sla_duedate ' + .' ,count(distinct attach.attach_id) as attachments' + .' ,count(distinct collab.id) as collaborators ' .' FROM '.TICKET_TABLE.' ticket ' .' LEFT JOIN '.DEPT_TABLE.' dept ON (ticket.dept_id=dept.dept_id) ' .' LEFT JOIN '.SLA_TABLE.' sla ON (ticket.sla_id=sla.id AND sla.isactive=1) '