diff --git a/include/staff/tickets.inc.php b/include/staff/tickets.inc.php index 2742d39a71993b1d8d122acb6ca2d3551384d12a..5adab6cec0eb49ac93584102a36b4b8c646bd90b 100644 --- a/include/staff/tickets.inc.php +++ b/include/staff/tickets.inc.php @@ -587,7 +587,7 @@ $(function() { +'?count='+count +'&_uid='+new Date().getTime(); $.dialog(url, [201], function (xhr) { - $.pjax.reload('#pjax-container'); + $.pjax({url: 'tickets.php', container: '#pjax-container'}); }); } return false; diff --git a/scp/tickets.php b/scp/tickets.php index e4c1fc10345bcd549ed8ca1e2fbbcbfa862f17aa..b8fc7ae449b7a25c9f72e46c2e0231f491872364 100644 --- a/scp/tickets.php +++ b/scp/tickets.php @@ -25,6 +25,7 @@ require_once(INCLUDE_DIR.'class.export.php'); // For paper sizes $page=''; $ticket = $user = null; //clean start. +$redirect = false; //LOCKDOWN...See if the id provided is actually valid and if the user has access. if($_REQUEST['id']) { if(!($ticket=Ticket::lookup($_REQUEST['id']))) @@ -131,6 +132,7 @@ if($_POST && !$errors): // Go back to the ticket listing page on reply $ticket = null; + $redirect = 'tickets.php'; } elseif(!$errors['err']) { $errors['err']=__('Unable to post the reply. Correct the errors below and try again!'); @@ -173,6 +175,7 @@ if($_POST && !$errors): Draft::deleteForNamespace('ticket.note.'.$ticket->getId(), $thisstaff->getId()); + $redirect = 'tickets.php'; } else { if(!$errors['err']) @@ -187,6 +190,7 @@ if($_POST && !$errors): $errors['err']=__('Permission Denied. You are not allowed to edit tickets'); elseif($ticket->update($_POST,$errors)) { $msg=__('Ticket updated successfully'); + $redirect = 'tickets.php?id='.$ticket->getId(); $_REQUEST['a'] = null; //Clear edit action - going back to view. //Check to make sure the staff STILL has access post-update (e.g dept change). if(!$ticket->checkStaffPerm($thisstaff)) @@ -335,6 +339,12 @@ if($_POST && !$errors): $thisstaff ->resetStats(); //We'll need to reflect any changes just made! endif; +if ($redirect) { + if ($msg) + Messages::success($msg); + Http::redirect($redirect); +} + /*... Quick stats ...*/ $stats= $thisstaff->getTicketsStats();