diff --git a/include/class.client.php b/include/class.client.php index 9f29b0e10ee6118b9ba19ff860e447ec85c0bcd0..6705b65c67ea1732e8f35cc3f5ac1f10dc0478f8 100644 --- a/include/class.client.php +++ b/include/class.client.php @@ -137,8 +137,7 @@ abstract class TicketUser { } function isOwner() { - return ($this->user - && $this->user->getId() == $this->getTicket()->getOwnerId()); + return $this instanceof TicketOwner; } function flagGuest() { diff --git a/include/class.thread.php b/include/class.thread.php index 2fa25f53039e9f3033ef06d38ef1dae8a9bcb7ea..d47e3113a420d3a21895a10ed680da53825ffd71 100644 --- a/include/class.thread.php +++ b/include/class.thread.php @@ -428,11 +428,11 @@ Class ThreadEntry { if (!($ticket = $this->getTicket())) return null; - if ($ticket->getOwnerId() == $ticket->getUserId()) + if ($ticket->getOwnerId() == $this->getUserId()) $this->user = new TicketOwner( User::lookup($this->getUserId()), $ticket); else - $this->user = Collborator::lookup(array( + $this->user = Collaborator::lookup(array( 'userId'=>$this->getUserId(), 'ticketId'=>$this->getTicketId())); } diff --git a/include/class.ticket.php b/include/class.ticket.php index 82b5527b06d35d66cd452d1cf76fda6f7546867c..6ba653bf4e971355df3f06a9e0a044cf5537e998 100644 --- a/include/class.ticket.php +++ b/include/class.ticket.php @@ -1045,7 +1045,7 @@ class Ticket { $options = array('inreplyto' => $entry->getEmailMessageId(), 'thread' => $entry); foreach ($recipients as $recipient) { - if ($uid == $recipient->getId()) continue; + if ($uid == $recipient->getUserId()) continue; $options['references'] = $entry->getEmailReferencesForUser($recipient); $notice = $this->replaceVars($msg, array('recipient' => $recipient)); $email->send($recipient->getEmail(), $notice['subj'], $notice['body'], $attachments,