Skip to content
Snippets Groups Projects
Commit 12bcb16b authored by Peter Rotich's avatar Peter Rotich
Browse files

Merge pull request #842 from greezybacon/issue/816


Fix images in new ticket notice to end user

Reviewed-By: default avatarPeter Rotich <peter@osticket.com>
parents fa7a0255 25b93083
Branches
Tags
No related merge requests found
......@@ -528,11 +528,15 @@ class Ticket {
}
function getLastMessage() {
if (!isset($this->last_message)) {
if($this->getLastMsgId())
$this->last_message = Message::lookup(
$this->getLastMsgId(), $this->getId());
if($this->getLastMsgId())
return Message::lookup($this->getLastMsgId(), $this->getId());
return Message::lastByTicketId($this->getId());
if (!$this->last_message)
$this->last_message = Message::lastByTicketId($this->getId());
}
return $this->last_message;
}
function getThread() {
......@@ -694,6 +698,10 @@ class Ticket {
function setLastMsgId($msgid) {
return $this->lastMsgId=$msgid;
}
function setLastMessage($message) {
$this->last_message = $message;
$this->setLastMsgId($message->getId());
}
//DeptId can NOT be 0. No orphans please!
function setDeptId($deptId) {
......@@ -1542,7 +1550,7 @@ class Ticket {
if(!($message = $this->getThread()->addMessage($vars, $errors)))
return null;
$this->setLastMsgId($message->getId());
$this->setLastMessage($message);
//Add email recipients as collaborators...
if ($vars['recipients']
......@@ -2516,7 +2524,7 @@ class Ticket {
&& ($msg=$tpl->getNewTicketNoticeMsgTemplate())
&& ($email=$dept->getEmail())) {
$message = $vars['message'];
$message = (string) $ticket->getLastMessage();
if($response) {
$message .= ($cfg->isHtmlThreadEnabled()) ? "<br><br>" : "\n\n";
$message .= $response->getBody();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment