So the thread that showed how to add a CC on a ticket specifically says that it won't work on 1.6RC5. I actually was able to figure out something that worked well enough. Basically, it adds another email address to the 'To:' field.
Add the fields to the database
mysql> alter table ost_ticket add column ccEmail varchar(120) after name;
mysql> alter table ost_ticket add column ccName varchar(32) after ccEmail;
in /include/class.ticket.php
class Ticket{
var $id;
var $extid;
var $email;
// Change to add cc to ticket
// J. Pastin 10-15-09
var $ccEmail;
var $ccName;
// End Changes
var $status;
var $created;
var $updated;
var $lastrespdate;
and
if(($res=db_query($sql)) && db_num_rows($res)):
$row=db_fetch_array($res);
$this->id =$row;
$this->extid =$row;
$this->email =$row;
$this->fullname =$row;
// Change to add cc to ticket
// J. Pastin 10-15-09
$this->ccEmail =$row;
$this->ccName =$row;
// End Changes
$this->status =$row;
and
function getName(){
return $this->fullname;
}
// Change to add cc to ticket
// J. Pastin 10-15-09
function getCcEmail() {
return $this->ccEmail;
}
function getCcName() {
return $this->ccName;
}
// End Changes
function getSubject() {
return $this->subject;
}
and
//Reply separator tag.
if($cfg->stripQuotedReply() && ($tag=$cfg->getReplySeparator()))
$body ="\n$tag\n\n".$body;
if(!$dept || !($email=$dept->getAutoRespEmail()))
$email=$cfg->getDefaultEmail();
if($email) {
// Change to enable cc on ticket
// J. Pastin 10-21-09
if($this->getCcEmail()!='') {
$address=$this->getEmail().",".$this->getCcEmail();
$email->send($address,$subj,$body);
} else {
$email->send($this->getEmail(),$subj,$body);
}
//$email->send($this->getEmail(),$subj,$body);
// End Changes
}
and
if($cfg->stripQuotedReply() && ($tag=$cfg->getReplySeparator()))
$body ="\n$tag\n\n".$body;
if(!$dept || !($email=$dept->getEmail()))
$email =$cfg->getDefaultEmail();
if($email && $email->getId()) {
// Change to enable cc on email
// J. Pastin 10-21-09
if ($this->getCcEmail()!='') {
$address=$this->getEmail().",".$this->getCcEmail();
$email->send($address,$subj,$body,$file);
} else {
$email->send($this->getEmail(),$subj,$body,$file);
}
//$email->send($this->getEmail(),$subj,$body,$file);
// End Changes
}
and
function create($var,&$errors,$origin,$autorespond=true,$alertstaff=true) {
global $cfg,$thisclient,$_FILES;
$id=0;
$fields=array();
$fields = array('type'=>'string', 'required'=>1, 'error'=>'Name required');
$fields = array('type'=>'email', 'required'=>1, 'error'=>'Valid email required');
// Change to add cc to ticket
// J. Pastin 10-15-09
$fields = array('type'=>'email', 'required'=>0, 'error'=>'Invalid cc Email Address');
$fields = array('type'=>'string', 'required'=>0, 'error'=>'Invalid cc Name');
// End Changes
$fields = array('type'=>'string', 'required'=>1, 'error'=>'Subject required');
$fields = array('type'=>'text', 'required'=>1, 'error'=>'Message required');
and
if(!$dept || !($email=$dept->getAutoRespEmail()))
$email=$cfg->getDefaultEmail();
if($email)
//Change to enable cc on ticket
// J. Pastin 10-21-09
if($var!='') {
$address=$var.",".$var;
$email->send($address,$subj,$body);
} else {
$email->send($var,$subj,$body);
}
//$email->send($var,$subj,$body);
// End Changes
and
$sql= 'INSERT INTO '.TICKET_TABLE.' SET created=NOW() '.
',ticketID='.db_input($extId).
',dept_id='.db_input($deptId).
',priority_id='.db_input($priorityId).
',email='.db_input($var).
',name='.db_input(Format:($var)).
// Change to add cc to ticket
// J. Pastin 10-15-09
',ccEmail='.db_input($var).
',ccName='.db_input(Format:($var)).
// End Changes
',subject='.db_input(Format:($var)).
',topic='.db_input(Format:($topicDesc)).
and
if($email){
//Reply separator tag.
if($cfg->stripQuotedReply() && ($tag=$cfg->getReplySeparator()))
$body ="\n$tag\n\n".$body;
// Change to enable cc on ticket
// J. Pastin 10-21-09
if($ticket->getCcEmail()!='') {
$address=$ticket->getEmail().",".$ticket->getCcEmail();
$email->send($address,$subj,$body);
} else {
$email->send($ticket->getEmail(),$subj,$body);
}
in include/client/open.inc.php
<font class="error">* <?=$errors?></font>
</td>
</tr>
<tr>
<th width="20%">Secondary Name:</th>
<td>
<?if ($thisclient && ($name=$thisclient->getName())) {
?>
<input type="hidden" name="ccName" value="<?=$ccName?>"><?=$ccName?>
<?}else {?>
<input type="text" id="ccName" name="ccName" size="25" value="<?=$info?>">
<?}?>
<font class="error">nbsp;<?=$errors?></font>
</td>
</tr>
Change made to add cc to ticket
J. Pastin 10-15-09
<tr>
<td nowrap >Secondary Email Address:</td>
<td>
<?if ($thisclient && ($email=$thisclient->getEmail())) {
?>
<input type="hidden" name="ccEmail" size="25" value="<?=$ccEmail?>"><?=$ccEmail?>
<?}else {?>
<input type="text" id="ccEmail" name="ccEmail" size="25" value="<?=$info?>">
<?}?>
<font class="error"> <?=$errors?></font>
</td>
</tr>
End Changes
<tr>
<td>Telephone:</td>
<td><input type="text" name="phone" size="25" value="<?=$info?>">
Ext <input type="text" name="phone_ext" size="6" value="<?=$info?>">
<font class="error"> <?=$errors?></font></td>
</tr>
in include/client/viewticket.inc.php
<tr>
<th width="100">Name:</th>
<td><?=Format:($ticket->getName())?></td>
</tr>
<tr>
<th width="100">Email:</th>
<td><?=$ticket->getEmail()?></td>
</tr>
Change made to add cc to ticket
J. Pastin 10-15-09
<tr>
<th width="100">Secondary Name:</th>
<td><?=Format:($ticket->getCcName())?></td>
</tr>
<tr>
<th width="100">Secondary Email:</th>
<td><?=$ticket->getCcEmail()?></td>
</tr>
End Changes
<tr>
<th>Phone:</th>
<td><?=Format:($ticket->getPhoneNumber())?></td>
</tr>
in include/staff/viewticket.inc.php
<tr>
<th>Email:</th>
<td><?php
echo $ticket->getEmail();
if(($related=$ticket->getRelatedTicketsCount())) {
echo sprintf(' <a href="tickets.php?a=search&query=%s" title="Related Tickets">(<b>%d</b>)</a>',
$ticket->getEmail(),$related);
}
?>
</td>
</tr>
Change to add cc to ticket
J. Pastin 10-15-09
<tr>
<th>Secondary Name:</th>
<td><?=Format:($ticket->getCcName())?></td>
</tr>
<tr>
<th>Secondary Email:</th>
<td><?php
echo $ticket->getCcEmail();
?>
</td>
</tr>
End Changes
<tr>
<th>Phone:</th>
<td><?=Format:($ticket->getPhoneNumber())?></td>
</tr>
in include/staff/newticket.inc.php
<tr>
<td align="left" nowrap width="20%"><b>Email Address:</b></td>
<td>
<input type="text" id="email" name="email" size="25" value="<?=$info?>">
<font class="error"><b>*</b> <?=$errors?>
</font>
<? if($cfg->autoRespONNewTicket()) {?>
<input type="checkbox" name="alertuser" <?=(!$errors || $info)? 'checked': ''?>>Send alert to user.
<?}?>
</td>
</tr>
Change to add cc to tickets
J. Pastin 10-15-09
<tr>
<td align="left" >Secondary Name:</td>
<td>
<input type="text" id="ccName" name="ccName" size="25" value="<?=$info?>">
<font class="error"> <?=$errors?></font>
</td>
</tr>
<tr>
<td align="left" nowrap width="20%">Secondary Email Address:</td>
<td>
<input type="text" id="ccEmail" name="ccEmail" size="25" value="<?=$info?>">
<font class="error"> <?=$errors?></font>
</td>
</tr>
End Changes
<tr>
<td align="left">Telephone:</td>
<td><input type="text" name="phone" size="25" value="<?=$info?>">
Ext <input type="text" name="phone_ext" size="6" value="<?=$info?>">
<font class="error"> <?=$errors?></font></td>
</tr>