CHANGE in tickets.php on line 107
$ticket->postNote($title,$_POST,"dept");
In include/class.ticket.php on ~ line 700
RIGHT AFTER THIS
function postNote($title,$note,$note_type,$poster='') {
global $thisuser;
$sql= 'INSERT INTO '.TICKET_NOTE_TABLE.' SET created=NOW() '.
',ticket_id='.db_input($this->getId()).
',title='.db_input(Format:($title)).
',note='.db_input(Format:($note)).
',staff_id='.db_input($thisuser?$thisuser->getId()).
',source='.db_input(($poster || !$thisuser)?$poster:$thisuser->getName());
//echo $sql;
ADD
if($note_type=="dept") {
$subj = "Ticket Department Transfer";
$ticket_id = $this->getId();
$body = "Ticket #: ".$ticket_id."\r\nTitle: ".$title."\r\nNote: ".$note;
$from = "From: KRA Support <support@kerberrose.com>";
$services= mysql_query("SELECT ".TICKET_TABLE.".dept_id FROM ".TICKET_TABLE." WHERE ".TICKET_TABLE.".ticket_id LIKE '$ticket_id'");
list($dept_id) = db_fetch_row($services);
$services= mysql_query("SELECT ".STAFF_TABLE.".email FROM ".STAFF_TABLE." WHERE ".STAFF_TABLE.".dept_id LIKE '$dept_id'");
for($j=0;list($to)=db_fetch_row($services);$j++){
$email=$to;
}
for($i=0;$email!="";$i++) {
mail($email,$subj,$body,$from);
}
}