View Full Version : Suggestion: Redirect When Closing a Ticket
Wilson Mattos
08-22-2009, 04:40 PM
It would be really nice to automatically redirect the a staff member to the Open Tickets view after that staff member posts a message in the ticket. If not for every post, at least when the ticket is closed during a post.
Wil
scottro
08-24-2009, 05:35 PM
Wilson,
Just add the following any time you want to get back to the ticket list. I've added it to about a half a dozen places:
$page='tickets.inc.php'; //ticket is gone...go back to the listing.
For instance, in scp/tickets.php
case 'close':
if(!$thisuser->isadmin() && !$thisuser->canCloseTickets()){
$errors['err']='Perm. Denied. You are not allowed to close tickets.';
}else{
if($ticket->close()){
$page='tickets.inc.php'; //ticket is gone...go back to the listing. $msg='Ticket status set to CLOSED';
}else{
$errors['err']='Problems closing the ticket. Try again';
}
}
or under the case for 'reply':
//If no error...do the do.
if(!$errors && ($respId=$ticket->postResponse($_POST['msg_id'],$_POST['response'],$_POST['signature'],$_FILES['attachment']))){
$msg='Response Posted Successfully';
$page='tickets.inc.php'; //ticket is gone...go back to the listing.
//Set status if any.
if(isset($_POST['ticket_status']) && $_POST['ticket_status'])
$ticket->setStatus($_POST['ticket_status']);
//Finally upload attachment if any
if($_FILES['attachment'] && $_FILES['attachment']['size']){
$ticket->uploadAttachment($_FILES['attachment'],$respId,'R');
}
}else{
$errors['err']=$errors['err']?$errors['err']:'Unable to post the response.';
}
break;
This should get you what you want.
Wilson Mattos
09-07-2009, 09:11 AM
@scottro thanks for the info! Much appreciated. I think this should be part of the "distribution."
Although I do not mind making customizations, each time I upgrade, it means I have to go back and redo it all. :-(
Anyway, thanks again for the info. VERY helpful!
Wil