This commit completely removes the BCC functionality.
This means Agents can no longer choose to add a BCC User while creating or responding to a Ticket. This also means that if a User emails in a Ticket where someone is BCC'd, the Ticket will be created without the BCC'd User(s). If an email is sent where the Department email is BCC'd, a Ticket is created for that Department and other Users in the email are added as Collaborators. This also changes the response options for Agents. They now have the options to: - Reply All (User + Collaborators) - Reply to User (only the User) - Do not Email Reply (Previously the options were Reply All, Reply to User, Reply to CC + User, Reply to BCC, Do not Email Reply)
This commit is contained in:
@@ -1127,28 +1127,6 @@ img.avatar {
|
||||
margin-left: 1px;
|
||||
}
|
||||
|
||||
.thread-entry.bccmessage .header {
|
||||
background:#DDFDAC;
|
||||
}
|
||||
.thread-entry.avatar.bccmessage .header:before {
|
||||
top: 7px;
|
||||
left: -8px;
|
||||
right: initial;
|
||||
border-left: none;
|
||||
border-right: 8px solid #CCC;
|
||||
}
|
||||
.thread-entry.avatar.bccmessage .header:before {
|
||||
border-right-color: #CCC;
|
||||
}
|
||||
.thread-entry.avatar.bccmessage .header:after {
|
||||
top: 7px;
|
||||
left: -8px;
|
||||
right: initial;
|
||||
border-left: none;
|
||||
border-right: 7px solid #DDFDAC;
|
||||
margin-left: 1px;
|
||||
}
|
||||
|
||||
.thread-entry .header .title {
|
||||
max-width: 500px;
|
||||
vertical-align: bottom;
|
||||
|
||||
@@ -107,7 +107,7 @@ class ThreadAjaxAPI extends AjaxController {
|
||||
array(), $errors))) {
|
||||
$info = array('msg' => sprintf(__('%s added as a collaborator'),
|
||||
Format::htmlchars($c->getName())));
|
||||
$type == 'addbcc' ? $c->setBcc() : $c->setCc();
|
||||
$c->setCc();
|
||||
$c->save();
|
||||
return self::_collaborators($thread, $info);
|
||||
}
|
||||
|
||||
@@ -150,12 +150,6 @@ implements EmailContact, ITicketUser {
|
||||
$this->save();
|
||||
}
|
||||
|
||||
public function setBcc() {
|
||||
$this->setFlag(Collaborator::FLAG_ACTIVE, true);
|
||||
$this->setFlag(Collaborator::FLAG_CC, false);
|
||||
$this->save();
|
||||
}
|
||||
|
||||
function isCc() {
|
||||
return !!($this->flags & self::FLAG_CC);
|
||||
}
|
||||
|
||||
@@ -60,14 +60,6 @@ class EmailTemplateGroup {
|
||||
'ticket', 'signature', 'recipient', 'staff', 'message',
|
||||
),
|
||||
),
|
||||
'ticket.notice.bcc'=>array(
|
||||
'group'=>'a.ticket.user',
|
||||
'name'=>/* @trans */ 'New Ticket Notice (BCC)',
|
||||
'desc'=>/* @trans */ 'Notice sent to BCCd users, if enabled, on new ticket created by an agent on behalf of a user (e.g phone calls).',
|
||||
'context' => array(
|
||||
'ticket', 'signature', 'recipient', 'staff', 'message',
|
||||
),
|
||||
),
|
||||
'ticket.overlimit'=>array(
|
||||
'group'=>'a.ticket.user',
|
||||
'name'=>/* @trans */ 'Overlimit Notice',
|
||||
@@ -84,14 +76,6 @@ class EmailTemplateGroup {
|
||||
'ticket', 'signature', 'response', 'staff', 'poster', 'recipient',
|
||||
),
|
||||
),
|
||||
'ticket.reply.bcc'=>array(
|
||||
'group'=>'a.ticket.user',
|
||||
'name'=>/* @trans */ 'Response/Reply Template (BCC)',
|
||||
'desc'=>/* @trans */ 'Template used on ticket response/reply',
|
||||
'context' => array(
|
||||
'ticket', 'signature', 'response', 'staff', 'poster', 'recipient',
|
||||
),
|
||||
),
|
||||
'ticket.activity.notice'=>array(
|
||||
'group'=>'a.ticket.user',
|
||||
'name'=>/* @trans */ 'New Activity Notice',
|
||||
@@ -100,14 +84,6 @@ class EmailTemplateGroup {
|
||||
'ticket', 'signature', 'message', 'poster', 'recipient',
|
||||
),
|
||||
),
|
||||
'ticket.activity.notice.bcc'=>array(
|
||||
'group'=>'a.ticket.user',
|
||||
'name'=>/* @trans */ 'New Activity Notice (BCC)',
|
||||
'desc'=>/* @trans */ 'Template used to notify BCCd collaborators on ticket activity',
|
||||
'context' => array(
|
||||
'ticket', 'signature', 'message', 'poster', 'recipient',
|
||||
),
|
||||
),
|
||||
'ticket.alert'=>array(
|
||||
'group'=>'b.ticket.staff',
|
||||
'name'=>/* @trans */ 'New Ticket Alert',
|
||||
@@ -333,10 +309,6 @@ class EmailTemplateGroup {
|
||||
return $this->getMsgTemplate('ticket.notice');
|
||||
}
|
||||
|
||||
function getNewTicketNoticeBCCMsgTemplate() {
|
||||
return $this->getMsgTemplate('ticket.notice.bcc');
|
||||
}
|
||||
|
||||
function getNewMessageAutorepMsgTemplate() {
|
||||
return $this->getMsgTemplate('message.autoresp');
|
||||
}
|
||||
@@ -353,18 +325,10 @@ class EmailTemplateGroup {
|
||||
return $this->getMsgTemplate('ticket.reply');
|
||||
}
|
||||
|
||||
function getReplyBCCMsgTemplate() {
|
||||
return $this->getMsgTemplate('ticket.reply.bcc');
|
||||
}
|
||||
|
||||
function getActivityNoticeMsgTemplate() {
|
||||
return $this->getMsgTemplate('ticket.activity.notice');
|
||||
}
|
||||
|
||||
function getActivityNoticeBCCMsgTemplate() {
|
||||
return $this->getMsgTemplate('ticket.activity.notice.bcc');
|
||||
}
|
||||
|
||||
function getOverlimitMsgTemplate() {
|
||||
return $this->getMsgTemplate('ticket.overlimit');
|
||||
}
|
||||
|
||||
@@ -240,18 +240,6 @@ implements Searchable {
|
||||
));
|
||||
}
|
||||
|
||||
if($vars['recipientType']) {
|
||||
$combo = array_combine($vars['uid'], $vars['recipientType']);
|
||||
foreach ($combo as $id => $type) {
|
||||
$collab = Collaborator::lookup($id);
|
||||
if(get_class($collab) == 'Collaborator') {
|
||||
$type == 'Cc' ? $collab->setFlag(Collaborator::FLAG_CC, true) :
|
||||
$collab->setFlag(Collaborator::FLAG_CC, false);
|
||||
$collab->save();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
unset($this->ht['active_collaborators']);
|
||||
$this->_collaborators = null;
|
||||
|
||||
@@ -366,9 +354,6 @@ implements Searchable {
|
||||
}
|
||||
|
||||
$entries->filter($visibility);
|
||||
|
||||
if ($type['hideBCC'])
|
||||
$entries->exclude(array('flags__hasbit' => ThreadEntry::FLAG_REPLY_BCC));
|
||||
}
|
||||
|
||||
if ($options['sort'] && !strcasecmp($options['sort'], 'DESC'))
|
||||
@@ -457,7 +442,7 @@ implements Searchable {
|
||||
|
||||
$body = $mailinfo['message'];
|
||||
|
||||
// extra handling for determining Cc and Bcc collabs
|
||||
// extra handling for determining Cc collabs
|
||||
if ($mailinfo['email']) {
|
||||
$staffSenderId = Staff::getIdByEmail($mailinfo['email']);
|
||||
|
||||
@@ -474,8 +459,6 @@ implements Searchable {
|
||||
|
||||
if ($collaborator && ($collaborator->isCc()))
|
||||
$vars['thread-type'] = 'M';
|
||||
else
|
||||
$vars['thread-type'] = 'N';
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -765,8 +748,6 @@ implements TemplateVariable {
|
||||
const FLAG_SYSTEM = 0x0080; // Entry is a system note.
|
||||
const FLAG_REPLY_ALL = 0x00100; // Agent response, reply all
|
||||
const FLAG_REPLY_USER = 0x00200; // Agent response, reply to User
|
||||
const FLAG_REPLY_COLLAB = 0x00400; // Agent response, reply to Collaborators
|
||||
const FLAG_REPLY_BCC = 0x00800; // Agent response, reply to BCC
|
||||
|
||||
const PERM_EDIT = 'thread.edit';
|
||||
|
||||
@@ -790,7 +771,6 @@ implements TemplateVariable {
|
||||
'M' => 'message',
|
||||
'R' => 'response',
|
||||
'N' => 'note',
|
||||
'B' => 'bccmessage',
|
||||
);
|
||||
|
||||
function getTypeName() {
|
||||
@@ -1492,14 +1472,6 @@ implements TemplateVariable {
|
||||
case 'reply-user':
|
||||
return $entry->flags |= ThreadEntry::FLAG_REPLY_USER;
|
||||
break;
|
||||
|
||||
case 'reply-collab':
|
||||
return $entry->flags |= ThreadEntry::FLAG_REPLY_COLLAB;
|
||||
break;
|
||||
|
||||
case 'reply-bcc':
|
||||
return $entry->flags |= ThreadEntry::FLAG_REPLY_BCC;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1566,12 +1538,6 @@ implements TemplateVariable {
|
||||
$recipients['cc'] = $cc;
|
||||
}
|
||||
|
||||
//Bcc Collaborators
|
||||
if($vars['bccs'] && Ticket::checkReply('bcc', $vars['emailreply'])) {
|
||||
$bcc = Collaborator::getCollabList($vars['bccs']);
|
||||
$recipients['bcc'] = $bcc;
|
||||
}
|
||||
|
||||
if ($vars['emailreply'] != '0' && $recipients)
|
||||
$entry->recipients = json_encode($recipients);
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ class TEA_ShowEmailRecipients extends ThreadEntryAction {
|
||||
$this->entry->getEmailHeader(), true);
|
||||
|
||||
$recipients = array();
|
||||
foreach (array('To', 'TO', 'Cc', 'CC', 'Bcc', 'BCC') as $k) {
|
||||
foreach (array('To', 'TO', 'Cc', 'CC') as $k) {
|
||||
if (isset($hdr[$k]) && $hdr[$k] &&
|
||||
($addresses=Mail_Parse::parseAddressList($hdr[$k]))) {
|
||||
foreach ($addresses as $addr) {
|
||||
|
||||
@@ -830,34 +830,15 @@ implements RestrictedAccess, Threadable, Searchable {
|
||||
}
|
||||
|
||||
//UserList of recipients (owner + collaborators)
|
||||
function getRecipients($excludeBcc=false) {
|
||||
if ($excludeBcc && isset($this->recipients)) {
|
||||
$list = new UserList();
|
||||
|
||||
if ($collabs = $this->getThread()->getActiveCollaborators()) {
|
||||
$list->add($this->getOwner());
|
||||
foreach ($collabs as $c) {
|
||||
if (get_class($c) == 'Collaborator' && !$c->isCc()) //skip bcc
|
||||
continue;
|
||||
else
|
||||
$list->add($c);
|
||||
}
|
||||
}
|
||||
|
||||
$this->recipients = $list;
|
||||
}
|
||||
//I think we need to rebuild each time since it
|
||||
//would be incomplete if called after an exclude bcc call
|
||||
else {
|
||||
$list = new UserList();
|
||||
$list->add($this->getOwner());
|
||||
if ($collabs = $this->getThread()->getActiveCollaborators()) {
|
||||
foreach ($collabs as $c) {
|
||||
$list->add($c);
|
||||
}
|
||||
function getRecipients() {
|
||||
$list = new UserList();
|
||||
$list->add($this->getOwner());
|
||||
if ($collabs = $this->getThread()->getActiveCollaborators()) {
|
||||
foreach ($collabs as $c) {
|
||||
$list->add($c);
|
||||
}
|
||||
$this->recipients = $list;
|
||||
}
|
||||
}
|
||||
$this->recipients = $list;
|
||||
|
||||
return $this->recipients;
|
||||
}
|
||||
@@ -1387,13 +1368,10 @@ implements RestrictedAccess, Threadable, Searchable {
|
||||
}
|
||||
|
||||
function checkReply($userType, $replyType) {
|
||||
if ($userType == 'cc' && ($replyType == 'reply-all' || $replyType == 'reply-collab'))
|
||||
if ($userType == 'cc' && $replyType == 'reply-all')
|
||||
return true;
|
||||
|
||||
if ($userType == 'bcc' && ($replyType == 'reply-all' || $replyType == 'reply-bcc'))
|
||||
return true;
|
||||
|
||||
if ($userType == 'user' && ($replyType == 'reply-all' || $replyType == 'reply-user' || $replyType == 'reply-collab'))
|
||||
if ($userType == 'user' && ($replyType == 'reply-all' || $replyType == 'reply-user'))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
@@ -1596,7 +1574,6 @@ implements RestrictedAccess, Threadable, Searchable {
|
||||
|| !($dept=$this->getDept())
|
||||
|| !($tpl=$dept->getTemplate())
|
||||
|| !($msg=$tpl->getActivityNoticeMsgTemplate())
|
||||
|| !($bccmsg=$tpl->getActivityNoticeBCCMsgTemplate())
|
||||
|| !($email=$dept->getEmail())
|
||||
) {
|
||||
return;
|
||||
@@ -1612,13 +1589,6 @@ implements RestrictedAccess, Threadable, Searchable {
|
||||
}
|
||||
}
|
||||
|
||||
if($vars['bccs']) {
|
||||
foreach ($vars['bccs'] as $bcc) {
|
||||
$collab = Collaborator::getIdByUserId($bcc, $this->getThread()->getId());
|
||||
$recipients[] = Collaborator::lookup($collab);
|
||||
}
|
||||
}
|
||||
|
||||
$vars = array_merge($vars, array(
|
||||
'message' => (string) $entry,
|
||||
'poster' => $poster ?: _S('A collaborator'),
|
||||
@@ -1626,7 +1596,6 @@ implements RestrictedAccess, Threadable, Searchable {
|
||||
);
|
||||
|
||||
$msg = $this->replaceVars($msg->asArray(), $vars);
|
||||
$bccmsg = $this->replaceVars($bccmsg->asArray(), $vars);
|
||||
|
||||
$attachments = $cfg->emailAttachments()?$entry->getAttachments():array();
|
||||
$options = array('thread' => $entry);
|
||||
@@ -1643,29 +1612,14 @@ implements RestrictedAccess, Threadable, Searchable {
|
||||
|
||||
$collaborators = array();
|
||||
$collabsCc = array();
|
||||
$collabsBcc = array();
|
||||
foreach ($recipients as $recipient) {
|
||||
if(get_class($recipient) == 'Collaborator') {
|
||||
if ($recipient->isCc()) {
|
||||
if ($recipient->isCc())
|
||||
$collabsCc[] = $recipient->getEmail()->address;
|
||||
}
|
||||
else
|
||||
$collabsBcc[] = $recipient;
|
||||
}
|
||||
|
||||
if(get_class($recipient) == 'TicketOwner') {
|
||||
if(get_class($recipient) == 'TicketOwner')
|
||||
$owner = $recipient;
|
||||
}
|
||||
}
|
||||
|
||||
//send bcc messages seperately for privacy
|
||||
if ($collabsBcc) {
|
||||
foreach ($collabsBcc as $recipient) {
|
||||
$notice = $this->replaceVars($bccmsg, array('recipient' => $recipient));
|
||||
if ($posterEmail != $recipient->getEmail()->address)
|
||||
$email->send($recipient, $notice['subj'], $notice['body'], $attachments,
|
||||
$options);
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($collabsCc as $cc) {
|
||||
@@ -2206,7 +2160,7 @@ implements RestrictedAccess, Threadable, Searchable {
|
||||
function replaceVars($input, $vars = array()) {
|
||||
global $ost;
|
||||
|
||||
$recipients = $this->getRecipients(true);
|
||||
$recipients = $this->getRecipients();
|
||||
|
||||
$vars = array_merge($vars, array('ticket' => $this));
|
||||
return $ost->replaceTemplateVariables($input, $vars);
|
||||
@@ -2664,8 +2618,6 @@ implements RestrictedAccess, Threadable, Searchable {
|
||||
$isMsg = true;
|
||||
$c->setCc();
|
||||
}
|
||||
else
|
||||
$c->setBcc();
|
||||
}
|
||||
else {
|
||||
$c = Collaborator::lookup($existingCollab);
|
||||
@@ -2684,21 +2636,6 @@ implements RestrictedAccess, Threadable, Searchable {
|
||||
if ($vars['userId'] == $this->user_id)
|
||||
$isMsg = true;
|
||||
|
||||
//lookup user by userId. if they are bcc in thread, post internal note
|
||||
if($collabs = $this->getRecipients()) {
|
||||
foreach ($collabs as $collab) {
|
||||
if(get_class($collab) == 'Collaborator' && $collab->user_id == $vars['userId'] && !$collab->isCc()) {
|
||||
$user = User::lookup($vars['userId']);
|
||||
$vars['note'] = $vars['message'];
|
||||
|
||||
//post internal note
|
||||
if (!$isMsg) {
|
||||
return $this->postNote($vars,$errors, $user, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!($message = $this->getThread()->addMessage($vars, $errors)))
|
||||
return null;
|
||||
|
||||
@@ -2916,14 +2853,6 @@ implements RestrictedAccess, Threadable, Searchable {
|
||||
$c2->setCc();
|
||||
}
|
||||
}
|
||||
if (isset($vars['bccs'])) {
|
||||
foreach ($vars['bccs'] as $uid) {
|
||||
$user = User::lookup($uid);
|
||||
if (!in_array($uid, $collabIds))
|
||||
if (($c2=$ticket->getThread()->addCollaborator($user,array(), $errors)))
|
||||
$c2->setBcc();
|
||||
}
|
||||
}
|
||||
|
||||
if (!$vars['poster'] && $thisstaff)
|
||||
$vars['poster'] = $thisstaff;
|
||||
@@ -3019,22 +2948,6 @@ implements RestrictedAccess, Threadable, Searchable {
|
||||
$email->send($user, $msg['subj'], $msg['body'], $attachments,
|
||||
$options, $collabsCc);
|
||||
|
||||
//Bcc Collaborators
|
||||
if ($vars['bccs']
|
||||
&& (Ticket::checkReply('bcc', $vars['emailreply']))
|
||||
&& ($bcctpl = $dept->getTemplate())
|
||||
&& ($bccmsg=$bcctpl->getReplyBCCMsgTemplate())) {
|
||||
foreach ($vars['bccs'] as $uid) {
|
||||
if (!($recipient = User::lookup($uid)))
|
||||
continue;
|
||||
|
||||
$extraVars = UsersName::getNameFormats($recipient, 'recipient');
|
||||
$extraVars = array_merge($extraVars, array('recipient' => $user));
|
||||
$msg = $this->replaceVars($bccmsg->asArray(), $variables + $extraVars);
|
||||
|
||||
$email->send($recipient, $msg['subj'], $msg['body'], $attachments, $options);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $response;
|
||||
@@ -4108,7 +4021,6 @@ implements RestrictedAccess, Threadable, Searchable {
|
||||
return false;
|
||||
|
||||
$collabsCc = array();
|
||||
$collabsBcc = array();
|
||||
if (isset($vars['ccs'])) {
|
||||
foreach ($vars['ccs'] as $uid) {
|
||||
$ccuser = User::lookup($uid);
|
||||
@@ -4123,19 +4035,6 @@ implements RestrictedAccess, Threadable, Searchable {
|
||||
$collabsCc['cc'] = $collabsCc;
|
||||
}
|
||||
|
||||
if (isset($vars['bccs'])) {
|
||||
foreach ($vars['bccs'] as $uid) {
|
||||
$bccuser = User::lookup($uid);
|
||||
|
||||
if ($bccuser && !$existing = Collaborator::getIdByUserId($bccuser->getId(), $ticket->getThreadId())) {
|
||||
$collabsBcc[] = $bccuser;
|
||||
|
||||
if (($c2=$ticket->getThread()->addCollaborator($bccuser,array(), $errors)))
|
||||
$c2->setBcc();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$vars['msgId']=$ticket->getLastMsgId();
|
||||
|
||||
// Effective role for the department
|
||||
@@ -4213,26 +4112,6 @@ implements RestrictedAccess, Threadable, Searchable {
|
||||
elseif (Ticket::checkReply('user', $vars['emailreply']))
|
||||
$email->send($ticket->getOwner(), $msg['subj'], $msg['body'], $attachments,
|
||||
$options);
|
||||
|
||||
if ($collabsBcc && Ticket::checkReply('bcc', $vars['emailreply'])) {
|
||||
foreach ($collabsBcc as $recipient) {
|
||||
if (($tpl=$dept->getTemplate())
|
||||
&& ($bccmsg=$tpl->getNewTicketNoticeBCCMsgTemplate())
|
||||
&& ($email=$dept->getEmail())
|
||||
)
|
||||
$extraVars = UsersName::getNameFormats($recipient, 'recipient');
|
||||
$extraVars = array_merge($extraVars, array(
|
||||
'message' => $message,
|
||||
'signature' => $signature,
|
||||
'response' => ($response) ? $response->getBody() : '',
|
||||
'recipient' => $ticket->getOwner()));
|
||||
$bccmsg = $ticket->replaceVars($bccmsg->asArray(), $extraVars);
|
||||
|
||||
$email->send($recipient, $bccmsg['subj'], $bccmsg['body'], $attachments,
|
||||
$options);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return $ticket;
|
||||
}
|
||||
|
||||
@@ -11,16 +11,11 @@ if ($cfg->isAvatarsEnabled() && $user)
|
||||
$avatar = $user->getAvatar();
|
||||
?>
|
||||
<?php
|
||||
$type = $entryTypes[$entry->type];
|
||||
if ($type == 'note') {
|
||||
$type = 'bccmessage';
|
||||
$entry->type = 'B';
|
||||
}
|
||||
?>
|
||||
|
||||
$type = $entryTypes[$entry->type];
|
||||
?>
|
||||
<div class="thread-entry <?php echo $type; ?> <?php if ($avatar) echo 'avatar'; ?>">
|
||||
<?php if ($avatar) { ?>
|
||||
<span class="<?php echo ($entry->type == 'M' || $entry->type == 'B') ? 'pull-left' : 'pull-right'; ?> avatar">
|
||||
<span class="<?php echo ($entry->type == 'M') ? 'pull-left' : 'pull-right'; ?> avatar">
|
||||
<?php echo $avatar; ?>
|
||||
</span>
|
||||
<?php } ?>
|
||||
|
||||
@@ -38,14 +38,6 @@ if ($thisclient && $thisclient->isGuest()
|
||||
</b>
|
||||
<small>#<?php echo $ticket->getNumber(); ?></small>
|
||||
<div class="pull-right">
|
||||
<?php
|
||||
if($collabs = $ticket->getRecipients()) {
|
||||
foreach ($collabs as $collab) {
|
||||
if(get_class($collab) == 'Collaborator' && $collab->user_id == $thisclient->getId() && !$collab->isCc()) {
|
||||
$viewThreads = true;
|
||||
}
|
||||
}
|
||||
} ?>
|
||||
<a class="action-button" href="tickets.php?a=print&id=<?php
|
||||
echo $ticket->getId(); ?>"><i class="icon-print"></i> <?php echo __('Print'); ?></a>
|
||||
|
||||
@@ -147,7 +139,7 @@ echo $v;
|
||||
$email = $thisclient->getUserName();
|
||||
$clientId = TicketUser::lookupByEmail($email)->getId();
|
||||
|
||||
$ticket->getThread()->render(array('M', 'R', 'user_id' => $clientId, 'hideBCC' => !$viewThreads), array(
|
||||
$ticket->getThread()->render(array('M', 'R', 'user_id' => $clientId), array(
|
||||
'mode' => Thread::MODE_CLIENT,
|
||||
'html-id' => 'ticketThread')
|
||||
);
|
||||
|
||||
@@ -81,12 +81,8 @@ reply_types:
|
||||
title: Reply Types
|
||||
content: >
|
||||
<b>Reply All:</b>
|
||||
This reply is sent to the User and the Collaborators (CC and BCC) you choose to include.</br>
|
||||
This reply is sent to the User and the Collaborators you choose to include.</br>
|
||||
<b>Reply to User:</b>
|
||||
This reply is sent to the User only, no Collaborators.</br>
|
||||
<b>Reply to CC + User:</b>
|
||||
This reply is sent to only the User and CC'd Collaborators</br>
|
||||
<b>Reply to BCC:</b>
|
||||
This is sent only to the BCC'd Collaborators.
|
||||
<b>Do Not Email Reply:</b>
|
||||
No email alerts are sent out, however, the Agent response is visible to <b>ALL</b> Users upon viewing the Ticket.
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
#
|
||||
# Email template: ticket.activity.notice.bcc.yaml
|
||||
#
|
||||
# Notice sent to BCCd collaborators on ticket activity e.g reply or message
|
||||
#
|
||||
---
|
||||
notes: |
|
||||
Notice sent to BCCd collaborators on ticket activity e.g reply or message.
|
||||
|
||||
subject: |
|
||||
Re: %{ticket.subject} [#%{ticket.number}]
|
||||
body: |
|
||||
<h3><strong>Dear %{recipient.name.first},</strong></h3>
|
||||
<div>
|
||||
<em>%{poster.name}</em> just logged a message to a ticket in which you participate.
|
||||
</div>
|
||||
<br>
|
||||
%{message}
|
||||
<br>
|
||||
<br>
|
||||
Ticket recipients can be seen below where the User is first and any other
|
||||
names are ticket Collaborators.
|
||||
<br>
|
||||
<br>
|
||||
Recipients:
|
||||
<br>
|
||||
%{ticket.recipients}
|
||||
<br>
|
||||
<br>
|
||||
<hr>
|
||||
<div style="color: rgb(127, 127, 127); font-size: small; text-align: center;">
|
||||
<em>You're getting this email because you have been BCC'd
|
||||
on ticket <a href="%{recipient.ticket_link}" style="color: rgb(84, 141, 212);"
|
||||
>#%{ticket.number}</a> This means that only agents can see your responses to
|
||||
this ticket. To participate, simply reply to this email
|
||||
or <a href="%{recipient.ticket_link}" style="color: rgb(84, 141, 212);"
|
||||
>click here</a> for a complete archive of the ticket thread.</em>
|
||||
</div>
|
||||
@@ -1,52 +0,0 @@
|
||||
#
|
||||
# Email template: ticket.notice.bcc.yaml
|
||||
#
|
||||
# Sent to a BCC'd user when a staff member creates a ticket on another user's behalf.
|
||||
#
|
||||
---
|
||||
notes: |
|
||||
Sent to a BCC'd user when a staff member creates a ticket on another user's behalf.
|
||||
|
||||
subject: |
|
||||
%{ticket.subject} [#%{ticket.number}]
|
||||
body: |
|
||||
<h3><strong>Dear %{recipient.name.first},</strong></h3>
|
||||
Our customer care team has created a ticket, <a
|
||||
href="%{recipient.ticket_link}">#%{ticket.number}</a> on behalf of %{ticket.name}, with
|
||||
the following details and summary:
|
||||
<br>
|
||||
<br>
|
||||
Topic: <strong>%{ticket.topic.name}</strong>
|
||||
<br>
|
||||
Subject: <strong>%{ticket.subject}</strong>
|
||||
<br>
|
||||
<br>
|
||||
%{message}
|
||||
<br>
|
||||
<br>
|
||||
You have been BCC'd on this ticket. This means that only agents can see your
|
||||
responses to this ticket.
|
||||
<br>
|
||||
<br>
|
||||
You can <a href="%{recipient.ticket_link}">view this
|
||||
ticket's progress online</a>.
|
||||
<br>
|
||||
<br>
|
||||
Ticket recipients can be seen below where the User is first and any other
|
||||
names are ticket Collaborators.
|
||||
<br>
|
||||
<br>
|
||||
Recipients:
|
||||
<br>
|
||||
%{ticket.recipients}
|
||||
<br>
|
||||
<br>
|
||||
<div style="color: rgb(127, 127, 127);">
|
||||
Your %{company.name} Team,<br>
|
||||
%{signature}</div>
|
||||
<hr>
|
||||
<div style="color: rgb(127, 127, 127); font-size: small; "><em>If you
|
||||
wish to provide additional comments or information regarding the issue,
|
||||
please reply to this email or <a href="%{recipient.ticket_link}"><span
|
||||
style="color: rgb(84, 141, 212);" >login to your account</span></a> for
|
||||
a complete archive of your support requests.</em></div>
|
||||
@@ -1,39 +0,0 @@
|
||||
#
|
||||
# Email template: ticket.reply.bcc.yaml
|
||||
#
|
||||
# Sent to BCC'd collaborators when a staff member makes a reply to a ticket.
|
||||
# Replies are only generated by staff members.
|
||||
#
|
||||
---
|
||||
notes: |
|
||||
Sent to BCC'd collaborators when a staff member makes a reply to their ticket.
|
||||
Replies are only generated by staff members.
|
||||
|
||||
subject: |
|
||||
Re: %{ticket.subject} [#%{ticket.number}]
|
||||
body: |
|
||||
<h3><strong>Dear %{recipient.name.first},</strong></h3>
|
||||
%{response}
|
||||
<br>
|
||||
<br>
|
||||
Ticket recipients can be seen below where the User is first and any other
|
||||
names are ticket Collaborators.
|
||||
<br>
|
||||
<br>
|
||||
Recipients:
|
||||
<br>
|
||||
%{ticket.recipients}
|
||||
<br>
|
||||
<br>
|
||||
<div style="color: rgb(127, 127, 127);">
|
||||
Your %{company.name} Team,<br>
|
||||
%{signature}
|
||||
</div>
|
||||
<hr>
|
||||
<div style="color: rgb(127, 127, 127); font-size: small; text-align: center;"
|
||||
><em>You are receiving this message because you have been BCC'd on a ticket.
|
||||
This means that only agents can see your responses to this ticket.
|
||||
To participate in this ticket, please reply to this email or
|
||||
<a href="%{recipient.ticket_link}" style="color: rgb(84, 141, 212);" >login
|
||||
to your account</a> for a complete archive of all your support requests
|
||||
and responses.</em></div>
|
||||
@@ -20,7 +20,6 @@ if(($users=$thread->getCollaborators())) {?>
|
||||
foreach($users as $user) {
|
||||
$checked = $user->isActive() ? 'checked="checked"' : '';
|
||||
$cc = $user->isCc() ? 'selected="selected"' : '';
|
||||
$bcc = !$user->isCc() ? 'selected="selected"' : '';
|
||||
|
||||
echo sprintf('<tr>
|
||||
<td>
|
||||
@@ -44,15 +43,6 @@ if(($users=$thread->getCollaborators())) {?>
|
||||
Format::htmlchars($user->getName()),
|
||||
$user->getEmail());
|
||||
|
||||
if ($thread->object_type == 'T') {
|
||||
echo sprintf('<td>
|
||||
<select name="recipientType[]">
|
||||
<option value="Cc" %s>Cc</option>
|
||||
<option value="Bcc" %s>Bcc</option>
|
||||
</select>
|
||||
</td>', $cc, $bcc);
|
||||
}
|
||||
|
||||
echo sprintf('<td width="10">
|
||||
<input type="hidden" name="del[]" id="d%d" value="">
|
||||
<a class="remove" href="#d%d">
|
||||
|
||||
@@ -7,17 +7,13 @@ if ($thisstaff && !strcasecmp($thisstaff->datetime_format, 'relative')) {
|
||||
};
|
||||
}
|
||||
|
||||
$entryTypes = array('M'=>'message', 'R'=>'response', 'N'=>'note','B' => 'bccmessage');
|
||||
$entryTypes = array('M'=>'message', 'R'=>'response', 'N'=>'note');
|
||||
$user = $entry->getUser() ?: $entry->getStaff();
|
||||
$name = $user ? $user->getName() : $entry->poster;
|
||||
$avatar = '';
|
||||
if ($user && $cfg->isAvatarsEnabled())
|
||||
$avatar = $user->getAvatar();
|
||||
|
||||
if ($entry->flags & ThreadEntry::FLAG_COLLABORATOR && $entry->type == 'N') {
|
||||
$entryTypes[$entry->type] = 'bccmessage';
|
||||
$entry->type = 'B';
|
||||
}
|
||||
?>
|
||||
<div class="thread-entry <?php
|
||||
echo $entry->isSystem() ? 'system' : $entryTypes[$entry->type]; ?> <?php if ($avatar) echo 'avatar'; ?>">
|
||||
@@ -63,15 +59,6 @@ if ($entry->flags & ThreadEntry::FLAG_COLLABORATOR && $entry->type == 'N') {
|
||||
<?php }
|
||||
if ($entry->flags & ThreadEntry::FLAG_REPLY_USER) { ?>
|
||||
<span class="label label-bare"><?php echo __('Reply to User'); ?></span>
|
||||
<?php }
|
||||
if ($entry->flags & ThreadEntry::FLAG_REPLY_COLLAB) { ?>
|
||||
<span class="label label-bare"><?php echo __('Reply to Collaborator'); ?></span>
|
||||
<?php }
|
||||
if ($entry->flags & ThreadEntry::FLAG_REPLY_BCC) { ?>
|
||||
<span class="label label-bare"><?php echo __('Reply to BCC'); ?></span>
|
||||
<?php }
|
||||
if ($entry->flags & ThreadEntry::FLAG_COLLABORATOR && $entry->type == 'B') { ?>
|
||||
<span class="label label-bare"><?php echo __('Bcc Collaborator'); ?></span>
|
||||
<?php }
|
||||
if ($entry->flags & ThreadEntry::FLAG_COLLABORATOR && $entry->type == 'M') { ?>
|
||||
<span class="label label-bare"><?php echo __('Cc Collaborator'); ?></span>
|
||||
|
||||
@@ -162,41 +162,18 @@ if ($_POST)
|
||||
<br/><span class="error"><?php echo $errors['ccs']; ?></span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="bccRow">
|
||||
<td width="160"><?php echo __('Bcc'); ?>:</td>
|
||||
<tr class="no_border">
|
||||
<td>
|
||||
<span>
|
||||
<select class="collabSelections" name="bccs[]" id="bcc_users_open" multiple="multiple"
|
||||
data-placeholder="<?php echo __('Select Contacts'); ?>">
|
||||
<?php echo __('Ticket Notice');?>:
|
||||
</td>
|
||||
<td>
|
||||
<select id="emailreply" name="emailreply">
|
||||
<option value="reply-all"><?php echo __('Alert All'); ?></option>
|
||||
<option value="reply-user"><?php echo __('Alert to User'); ?></option>
|
||||
<option value="0">— <?php echo __('Do Not Send Alert'); ?> —</option>
|
||||
</select>
|
||||
</span>
|
||||
|
||||
<a class="inline button" style="overflow:inherit" href="#"
|
||||
onclick="javascript:
|
||||
$.userLookup('ajax.php/users/lookup/form', function (user) {
|
||||
var newUser = new Option(user.name, user.id, true, true);
|
||||
return $("#bcc_users_open").append(newUser).trigger('change');
|
||||
});
|
||||
"><i class="icon-plus"></i> <?php echo __('Add New'); ?></a>
|
||||
|
||||
<br/><span class="error"><?php echo $errors['bccs']; ?></span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="no_border">
|
||||
<td>
|
||||
<?php echo __('Ticket Notice');?>:
|
||||
</td>
|
||||
<td>
|
||||
<select id="emailreply" name="emailreply">
|
||||
<option value="reply-all"><?php echo __('Alert All'); ?></option>
|
||||
<option value="reply-user"><?php echo __('Alert to User'); ?></option>
|
||||
<option value="reply-collab" <?php echo 'selected="selected"'; ?>><?php echo __('Alert to CC + User'); ?></option>
|
||||
<option value="reply-bcc"><?php echo __('Alert to BCC'); ?></option>
|
||||
<option value="reply-bcc"><?php echo __('Alert to BCC'); ?></option>
|
||||
<option value="0">— <?php echo __('Do Not Send Alert'); ?> —</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -752,18 +752,14 @@ if ($errors['err'] && isset($_POST['a'])) {
|
||||
foreach ($collabs as $collab) {
|
||||
if ($collab->getUserId() == $lastUser->getId() && $collab->isCc())
|
||||
$ccUser = true;
|
||||
elseif ($collab->getUserId() == $lastUser->getId() && !$collab->isCc())
|
||||
$bccUser = true;
|
||||
}
|
||||
}
|
||||
if ($ticketUser || $ccUser || $bccUser)
|
||||
if ($ticketUser || $ccUser)
|
||||
$emailReply = true;
|
||||
?>
|
||||
<select id="emailreply" name="emailreply">
|
||||
<option value="reply-all"><?php echo __('Reply All'); ?></option>
|
||||
<option value="reply-user"><?php echo __('Reply to User'); ?></option>
|
||||
<option value="reply-collab" <?php echo ($ccUser || $ticketUser ) ? 'selected="selected"' : ''; ?>><?php echo __('Reply to CC + User'); ?></option>
|
||||
<option value="reply-bcc" <?php echo $bccUser || $errors['bccs'] ? 'selected="selected"' : ''; ?>><?php echo __('Reply to BCC'); ?></option>
|
||||
<option value="0" <?php echo !$emailReply ? 'selected="selected"' : ''; ?>
|
||||
>— <?php echo __('Do Not Email Reply'); ?> —</option>
|
||||
</select>
|
||||
@@ -786,13 +782,9 @@ if ($errors['err'] && isset($_POST['a'])) {
|
||||
</tr>
|
||||
<?php $collaborators = $ticket->getThread()->getCollaborators();
|
||||
$cc_cids = array();
|
||||
$bcc_cids = array();
|
||||
foreach ($collaborators as $c) {
|
||||
if ($c->flags & Collaborator::FLAG_CC && $c->flags & Collaborator::FLAG_ACTIVE)
|
||||
$cc_cids[] = $c->user_id;
|
||||
elseif (!($c->flags & Collaborator::FLAG_CC) && $c->flags & Collaborator::FLAG_ACTIVE) {
|
||||
$bcc_cids[] = $c->user_id;
|
||||
}
|
||||
}
|
||||
?>
|
||||
<tr id="cc-row">
|
||||
@@ -803,7 +795,7 @@ if ($errors['err'] && isset($_POST['a'])) {
|
||||
data-placeholder="<?php echo __('Select Contacts'); ?>">
|
||||
<?php
|
||||
foreach ($cc_cids as $u) {
|
||||
if($u != $ticket->user_id && !in_array($u, $bcc_cids)) {
|
||||
if($u != $ticket->user_id) {
|
||||
?>
|
||||
<option value="<?php echo $u; ?>" <?php
|
||||
if (in_array($u, $cc_cids))
|
||||
@@ -825,36 +817,6 @@ if ($errors['err'] && isset($_POST['a'])) {
|
||||
<br/><span class="error"><?php echo $errors['ccs']; ?></span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="bcc-row">
|
||||
<td width="160" style="padding-left:20px;"><?php echo __('Bcc'); ?></td>
|
||||
<td>
|
||||
<span>
|
||||
<select class="collabSelections" name="bccs[]" id="bcc_users" multiple="multiple"
|
||||
data-placeholder="<?php echo __('Select Contacts'); ?>">
|
||||
<?php
|
||||
foreach ($bcc_cids as $u) {
|
||||
if($u != $ticket->user_id && !in_array($u, $cc_cids)) {
|
||||
?>
|
||||
<option value="<?php echo $u; ?>" <?php
|
||||
if (in_array($u, $bcc_cids))
|
||||
echo 'selected="selected"'; ?>><?php echo User::lookup($u); ?>
|
||||
</option>
|
||||
<?php } } ?>
|
||||
?>
|
||||
</select>
|
||||
</span>
|
||||
|
||||
<a class="inline button" style="overflow:inherit" href="#"
|
||||
onclick="javascript:
|
||||
$.userLookup('ajax.php/users/lookup/form', function (user) {
|
||||
var newUser = new Option(user.name, user.id, true, true);
|
||||
return $("#bcc_users").append(newUser).trigger('change');
|
||||
});
|
||||
"><i class="icon-plus"></i> <?php echo __('Add New'); ?></a>
|
||||
|
||||
<br/><span class="error"><?php echo $errors['bccs']; ?></span>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<?php
|
||||
} ?>
|
||||
@@ -1231,27 +1193,14 @@ $(function() {
|
||||
case "reply-all":
|
||||
$('#user-row').show();
|
||||
$('#cc-row').show();
|
||||
$('#bcc-row').show();
|
||||
break;
|
||||
case "reply-user":
|
||||
$('#user-row').show();
|
||||
$('#cc-row').hide();
|
||||
$('#bcc-row').hide();
|
||||
break;
|
||||
case "reply-collab":
|
||||
$('#user-row').show();
|
||||
$('#cc-row').show();
|
||||
$('#bcc-row').hide();
|
||||
break;
|
||||
case "reply-bcc":
|
||||
$('#user-row').hide();
|
||||
$('#cc-row').hide();
|
||||
$('#bcc-row').show();
|
||||
break;
|
||||
default:
|
||||
$('#user-row').show();
|
||||
$('#cc-row').show();
|
||||
$('#bcc-row').hide();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,8 +8,7 @@
|
||||
* an email was involved (agent or user generated)
|
||||
*
|
||||
* It also adds a flags field to the thread_collaborator table which
|
||||
* tracks whether a collaborator is a CC or BCC collaborator as well as
|
||||
* storing whether or not the collaborator is active. As a result, we can
|
||||
* tracks whether or not the collaborator is active. As a result, we can
|
||||
* remove the isactive field
|
||||
*/
|
||||
|
||||
|
||||
@@ -1588,27 +1588,6 @@ img.avatar {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.thread-entry.bccmessage .header {
|
||||
background:#DDFDAC;
|
||||
}
|
||||
|
||||
.thread-entry.avatar.bccmessage .header:before {
|
||||
top: 7px;
|
||||
left: -8px;
|
||||
right: initial;
|
||||
border-left: none;
|
||||
border-right: 8px solid #CCC;
|
||||
}
|
||||
|
||||
.thread-entry.avatar.bccmessage .header:after {
|
||||
top: 7px;
|
||||
left: -8px;
|
||||
right: initial;
|
||||
border-left: none;
|
||||
border-right: 7px solid #DDFDAC;
|
||||
margin-left: 1px;
|
||||
}
|
||||
|
||||
.thread-entry.message .header {
|
||||
background:#C3D9FF;
|
||||
}
|
||||
|
||||
@@ -152,12 +152,6 @@ if($_POST && !$errors):
|
||||
if(!$vars['response'])
|
||||
$errors['response']=__('Response required');
|
||||
|
||||
//do not post a thread entry if response intended for only bccs and there are no bccs
|
||||
if (is_null($vars['bccs']) && $vars['emailreply'] == 'reply-bcc') {
|
||||
$vars['emailreply'] = 'reply-bcc';
|
||||
$errors['bccs']=sprintf(__('Please add a %s'), 'BCC Recipient');
|
||||
}
|
||||
|
||||
if ($cfg->getLockTime()) {
|
||||
if (!$lock) {
|
||||
$errors['err'] = sprintf('%s %s', __('This action requires a lock.'), __('Please try again!'));
|
||||
@@ -385,19 +379,6 @@ if($_POST && !$errors):
|
||||
$errors['err'] = sprintf('%s %s', __('Unable to add collaborator.'), __('Please try again!'));
|
||||
}
|
||||
break;
|
||||
case 'addbcc':
|
||||
if (!$role->hasPerm(Ticket::PERM_EDIT)) {
|
||||
$errors['err']=__('Permission Denied. You are not allowed to add collaborators');
|
||||
} elseif (!$_POST['user_id'] || !($user=User::lookup($_POST['user_id']))) {
|
||||
$errors['err'] = __('Unknown user selected');
|
||||
} elseif ($c2 = $ticket->addCollaborator($user, array(), $errors)) {
|
||||
$msg = sprintf(__('Collaborator %s added'),
|
||||
Format::htmlchars($user->getName()));
|
||||
}
|
||||
else {
|
||||
$errors['err'] = sprintf('%s %s', __('Unable to add collaborator.'), __('Please try again!'));
|
||||
}
|
||||
break;
|
||||
default:
|
||||
$errors['err']=__('You must select action to perform');
|
||||
endswitch;
|
||||
|
||||
Reference in New Issue
Block a user