Permalink
Browse files

Make ticket queue selection sticky

If navigating back to the ticket queue (after closing a ticket, for
instance), return to the queue previously viewed.
  • Loading branch information...
1 parent c9ec136 commit aa2dc850772e23b185b3f8cf483193eeeecc5b9f @greezybacon greezybacon committed May 13, 2015
Showing with 10 additions and 4 deletions.
  1. +3 −0 include/staff/tickets.inc.php
  2. +7 −4 scp/tickets.php
@@ -57,6 +57,9 @@
}
}
+// Stash current queue view
+$_SESSION['::Q'] = $_REQUEST['status'];
+
$qwhere ='';
/*
STRICT DEPARTMENTS BASED PERMISSION!
View
@@ -36,9 +36,12 @@
}
//Lookup user if id is available.
-if ($_REQUEST['uid'])
+if ($_REQUEST['uid']) {
$user = User::lookup($_REQUEST['uid']);
-
+}
+elseif (!isset($_REQUEST['status']) && isset($_SESSION['::Q'])) {
+ $_REQUEST['status'] = $_SESSION['::Q'];
+}
// Configure form for file uploads
$response_form = new Form(array(
'attachments' => new FileUploadField(array('id'=>'attach',
@@ -385,7 +388,7 @@
if($cfg->showAnsweredTickets()) {
$nav->addSubMenu(array('desc'=>$open_name.' ('.number_format($stats['open']+$stats['answered']).')',
'title'=>__('Open Tickets'),
- 'href'=>'tickets.php',
+ 'href'=>'tickets.php?status=open',
'iconclass'=>'Ticket'),
(!$_REQUEST['status'] || $_REQUEST['status']=='open'));
} else {
@@ -394,7 +397,7 @@
$nav->addSubMenu(array('desc'=>$open_name.' ('.number_format($stats['open']).')',
'title'=>__('Open Tickets'),
- 'href'=>'tickets.php',
+ 'href'=>'tickets.php?status=open',
'iconclass'=>'Ticket'),
(!$_REQUEST['status'] || $_REQUEST['status']=='open'));
}

0 comments on commit aa2dc85

Please sign in to comment.