From 40e6737bbdd48ba6affbc0f72d24171cd65d5aae Mon Sep 17 00:00:00 2001
From: Peter Rotich <peter@osticket.com>
Date: Sat, 31 Mar 2012 23:01:15 -0400
Subject: [PATCH] Clear active menu on search with no status set

---
 scp/tickets.php | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/scp/tickets.php b/scp/tickets.php
index 9fb1e9cf7..d41e52777 100644
--- a/scp/tickets.php
+++ b/scp/tickets.php
@@ -456,7 +456,7 @@ if($ticket) {
     $inc = 'ticket-view.inc.php';
     if($_REQUEST['a']=='edit' && $thisstaff->canEditTickets()) 
         $inc = 'ticket-edit.inc.php';
-}else {
+} else {
     $inc = 'tickets.inc.php';
     if($_REQUEST['a']=='open' && $thisstaff->canCreateTickets())
         $inc = 'ticket-open.inc.php';
@@ -470,8 +470,14 @@ if($ticket) {
         elseif (!Export::saveTickets($query, "tickets-$ts.csv", 'csv'))
             $errors['err'] = 'Internal error: Unable to dump query results';
     }
-    elseif(!$_POST && $_REQUEST['a']!='search'  && ($min=$thisstaff->getRefreshRate()))
-        define('AUTO_REFRESH',1); //set refresh rate if the user has it configured
+
+    //Clear active submenu on search with no status
+    if($_REQUEST['a']=='search' && !$_REQUEST['status'])
+        $nav->setActiveSubMenu(-1);
+
+    //set refresh rate if the user has it configured
+    if(!$_POST && $_REQUEST['a']!='search'  && ($min=$thisstaff->getRefreshRate()))
+        define('AUTO_REFRESH', $min*60); 
 }
 
 require_once(STAFFINC_DIR.'header.inc.php');
-- 
GitLab