does this mod works?
Here's my version of this:
// 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 "<b>Email Sent</b>";
// 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;
}
I am using this with osticket_1.6rc5 right now. Just installed it last night and added this mod as it was important for my installation. I modified it from the above code to suit my needs a little better. And to answer your question, it's a minimal addition to see if it works in your installation. Just throw the code in and test, if it doesn't do what you want either remove the code or just restore from your backup. Quick and painless with this mod since it's confined to just 1 function in 1 class.
Enjoy my updates!
--DJBooya