diff --git a/include/class.ticket.php b/include/class.ticket.php index fe114a29dd6aab28c776cee8c889824023ef7290..827f6d944709e894968e16ae1696a6f7fd76fc37 100644 --- a/include/class.ticket.php +++ b/include/class.ticket.php @@ -1521,8 +1521,10 @@ class Ticket { $this->setLastMsgId($message->getId()); - //Add email recipients as collaborators - if ($vars['recipients']) { + //Add email recipients as collaborators... + if ($vars['recipients'] + //Only add if we have a matched local address + && $vars['emailId']) { //New collaborators added by other collaborators are disable -- // requires staff approval. $info = array( @@ -2280,6 +2282,9 @@ class Ticket { .' ,ip_address='.db_input($ipaddress) .' ,source='.db_input($source); + if (isset($vars['emailId']) && $vars['emailId']) + $sql.=', email_id='.db_input($vars['emailId']); + //Make sure the origin is staff - avoid firebug hack! if($vars['duedate'] && !strcasecmp($origin,'staff')) $sql.=' ,duedate='.db_input(date('Y-m-d G:i',Misc::dbtime($vars['duedate'].' '.$vars['time'])));