Skip to content
Snippets Groups Projects
Commit 93700ea3 authored by Jared Hancock's avatar Jared Hancock
Browse files

Fix incorrect collaborator and owner email links

Also, fix duplicate emails where a user as a collaborator would be sent a
confirmation for their own respective email.
parent 7044ac71
Branches
Tags
No related merge requests found
...@@ -137,8 +137,7 @@ abstract class TicketUser { ...@@ -137,8 +137,7 @@ abstract class TicketUser {
} }
function isOwner() { function isOwner() {
return ($this->user return $this instanceof TicketOwner;
&& $this->user->getId() == $this->getTicket()->getOwnerId());
} }
function flagGuest() { function flagGuest() {
......
...@@ -428,11 +428,11 @@ Class ThreadEntry { ...@@ -428,11 +428,11 @@ Class ThreadEntry {
if (!($ticket = $this->getTicket())) if (!($ticket = $this->getTicket()))
return null; return null;
if ($ticket->getOwnerId() == $ticket->getUserId()) if ($ticket->getOwnerId() == $this->getUserId())
$this->user = new TicketOwner( $this->user = new TicketOwner(
User::lookup($this->getUserId()), $ticket); User::lookup($this->getUserId()), $ticket);
else else
$this->user = Collborator::lookup(array( $this->user = Collaborator::lookup(array(
'userId'=>$this->getUserId(), 'ticketId'=>$this->getTicketId())); 'userId'=>$this->getUserId(), 'ticketId'=>$this->getTicketId()));
} }
......
...@@ -1045,7 +1045,7 @@ class Ticket { ...@@ -1045,7 +1045,7 @@ class Ticket {
$options = array('inreplyto' => $entry->getEmailMessageId(), $options = array('inreplyto' => $entry->getEmailMessageId(),
'thread' => $entry); 'thread' => $entry);
foreach ($recipients as $recipient) { foreach ($recipients as $recipient) {
if ($uid == $recipient->getId()) continue; if ($uid == $recipient->getUserId()) continue;
$options['references'] = $entry->getEmailReferencesForUser($recipient); $options['references'] = $entry->getEmailReferencesForUser($recipient);
$notice = $this->replaceVars($msg, array('recipient' => $recipient)); $notice = $this->replaceVars($msg, array('recipient' => $recipient));
$email->send($recipient->getEmail(), $notice['subj'], $notice['body'], $attachments, $email->send($recipient->getEmail(), $notice['subj'], $notice['body'], $attachments,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment