diff --git a/include/ajax.tickets.php b/include/ajax.tickets.php index 93e90758c2963eebcefa43518b757e5c473d8eef..058bb12a37f9c5f7c8723b695fa40d56ed1c51c2 100644 --- a/include/ajax.tickets.php +++ b/include/ajax.tickets.php @@ -470,11 +470,15 @@ class TicketsAjaxAPI extends AjaxController { } $errors = $info = array(); - if ($user && ($c=$ticket->addCollaborator($user, $errors))) { - $info =array('msg' => sprintf('%s added as a collaborator', - $c->getName())); - - return self::_collaborators($ticket, $info); + if ($user) { + if ($user->getId() == $ticket->getOwnerId()) + $errors['err'] = sprintf('Ticket owner, %s, is a collaborator by default!', + $user->getName()); + elseif (($c=$ticket->addCollaborator($user, $errors))) { + $info = array('msg' => sprintf('%s added as a collaborator', + $c->getName())); + return self::_collaborators($ticket, $info); + } } if($errors && $errors['err']) { @@ -483,7 +487,6 @@ class TicketsAjaxAPI extends AjaxController { $info +=array('error' =>'Unable to add collaborator - try again'); } - return self::_addcollaborator($ticket, $user, $form, $info); } diff --git a/include/class.thread.php b/include/class.thread.php index f797e64652d84e453de3b63069d589c52b37e00d..3ebdc83a6729e9130134c256040d246b589512bb 100644 --- a/include/class.thread.php +++ b/include/class.thread.php @@ -763,6 +763,15 @@ Class ThreadEntry { if(!$vars['ticketId'] || !$vars['type'] || !in_array($vars['type'], array('M','R','N'))) return false; + //Strip quoted reply...on emailed messages + if($vars['origin'] + && !strcasecmp($vars['origin'], 'Email') + && $cfg->stripQuotedReply() + && ($tag=$cfg->getReplySeparator()) + && strpos($vars['body'], $tag)) + if((list($msg) = explode($tag, $vars['body'], 2)) && trim($msg)) + $vars['body'] = $msg; + if (isset($vars['attachments'])) { foreach ($vars['attachments'] as &$a) { // Change <img src="cid:"> inside the message to point to diff --git a/include/class.ticket.php b/include/class.ticket.php index 0f7d7e7520ba23765a25239be995e06bd93299c6..318d205358e4775aeeb5e42b377f689dde6af4cb 100644 --- a/include/class.ticket.php +++ b/include/class.ticket.php @@ -594,7 +594,8 @@ class Ticket { function addCollaborator($user, &$errors) { - if(!$user) return null; + if(!$user || $user->getId()==$this->getOwnerId()) + return null; $vars = array( 'ticketId' => $this->getId(), @@ -1443,14 +1444,7 @@ class Ticket { function postMessage($vars, $origin='', $alerts=true) { global $cfg; - //Strip quoted reply...on emailed replies - if(!strcasecmp($origin, 'Email') - && $cfg->stripQuotedReply() - && ($tag=$cfg->getReplySeparator()) - && strpos($vars['message'], $tag)) - if((list($msg) = explode($tag, $vars['message'], 2)) && trim($msg)) - $vars['message'] = $msg; - + $vars['origin'] = $origin; if(isset($vars['ip'])) $vars['ip_address'] = $vars['ip']; elseif(!$vars['ip_address'] && $_SERVER['REMOTE_ADDR']) diff --git a/include/staff/ticket-view.inc.php b/include/staff/ticket-view.inc.php index 3866de15be2f54303d12e983e5d6dab78dce8042..275bd2c2be091714938351194cdf95b7adc332b6 100644 --- a/include/staff/ticket-view.inc.php +++ b/include/staff/ticket-view.inc.php @@ -430,7 +430,7 @@ $tcount+= $ticket->getNumNotes(); 'table-row-group':'none'; ?>;"> <tr> <td width="120"> - <label><strong>CC:</strong></label> + <label><strong>Recipients:</strong></label> </td> <td> <?php