I know there is a thread already for this but for some reason i cant comment on it. I would like to have a notification sent to the client who opened the ticket when a ticket is closed. Maybe as a clickable option in the alerts and notification area of the admin panel. I tried this mod from the other thread and it sent a closed ticket notification but when i close it the webpage went all the way to the left side of the screen and i got 2 closed notifications. Any help is greatly appreciated as i am very new to this.. thanks
// ALL CHANGES IN class.ticket.php
function close(){
$sql= 'UPDATE '.TICKET_TABLE.' SET status='.db_input('closed').',staff_id=0,isoverdue =0,duedate=NULL,updated=NOW(),closed=NOW() '.
' WHERE ticket_id='.db_input($this->getId());
// NEW MOD CODE STARTS HERE
// get dept object
$dept = new Dept($this->getDeptId());
// get email object for current
$email = new Email($this->getEmail());
// see if the department ticket is configured for is setup for auto response on
// new tickets. I have some departments I don't want notification on close
// A new attribute could be used, but I piggy backed on an existing as it
// suited my needs fine for now.
if ($dept->autoRespONNewTicket()) {
// small debug message that prints at the top of ticket screen so I know
// an email was sent
print "Email Sent";
// subject for email -- totally configurable. code in previous post was
// showing the internal ID, not the external ID a user would need
$subj= "Helpdesk Request #" .$this->getExtId(). " has been closed.";
// I added a link in the body to the ticket for the user if they wanted
// to view it just after I closed it.
$body= "This is a notification that Request#" .$this->getExtId(). " has been closed. You can see request information here: http://" . $_SERVER . "/view.php?e=" . $this->getEmail() . "&t=" . $this->getExtId() . ".";
// this sends out the email ensuring the "From" address is whatever
// is configured for the department
$dept->getEmail()->send($this->getEmail(),$subj,$body);
}
// NEW MOD CODE ENDS HERE
return (db_query($sql) && db_affected_rows())?true;
}