Yes, the response actually gets sent before the ticket is closed.
move this code, starting on line 87 of tickets.php under scp directory
//Set status if any.
$wasOpen=$ticket->isOpen();
if(isset($_POST) && $_POST) {
if($ticket->setStatus($_POST) && $ticket->reload()) {
$note=sprintf('%s %s the ticket on reply',$thisuser->getName(),$ticket->isOpen()?'reopened':'closed');
$ticket->logActivity('Ticket status changed to '.($ticket->isOpen()?'Open':'Closed'),$note);
}
}
above the call to postResponse. I.e, paste it starting at line 83.
this is what the original file looks like:
//If no error...do the do.
if(!$errors && ($respId=$ticket->postResponse($_POST,$_POST,$_POST,$_FILES))){
$msg='Response Posted Successfully';
//Set status if any.
$wasOpen=$ticket->isOpen();
if(isset($_POST) && $_POST) {
if($ticket->setStatus($_POST) && $ticket->reload()) {
$note=sprintf('%s %s the ticket on reply',$thisuser->getName(),$ticket->isOpen()?'reopened':'closed');
$ticket->logActivity('Ticket status changed to '.($ticket->isOpen()?'Open':'Closed'),$note);
}
}
and you want this:
//Set status if any.
$wasOpen=$ticket->isOpen();
if(isset($_POST) && $_POST) {
if($ticket->setStatus($_POST) && $ticket->reload()) {
$note=sprintf('%s %s the ticket on reply',$thisuser->getName(),$ticket->isOpen()?'reopened':'closed');
$ticket->logActivity('Ticket status changed to '.($ticket->isOpen()?'Open':'Closed'),$note);
}
}
//If no error...do the do.
if(!$errors && ($respId=$ticket->postResponse($_POST,$_POST,$_POST,$_FILES))){
$msg='Response Posted Successfully';