From 4dbd053c5e76d32b175a7e3d765730455c81028a Mon Sep 17 00:00:00 2001
From: Peter Rotich <peter@osticket.com>
Date: Thu, 10 May 2012 15:58:17 -0400
Subject: [PATCH] Move refresh meta tag to dynamic extra headers

---
 include/staff/header.inc.php | 10 +++++-----
 scp/tickets.php              |  4 +++-
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/include/staff/header.inc.php b/include/staff/header.inc.php
index b0a7c4efe..1aba15ca8 100644
--- a/include/staff/header.inc.php
+++ b/include/staff/header.inc.php
@@ -2,11 +2,6 @@
 <html>
 <head>
     <meta http-equiv="content-type" content="text/html; charset=UTF-8">
-    <?php
-    if(defined('AUTO_REFRESH') && is_numeric(AUTO_REFRESH_RATE) && AUTO_REFRESH_RATE>0){ //Refresh rate
-    echo '<meta http-equiv="refresh" content="'.AUTO_REFRESH_RATE.'" />';
-    }
-    ?>
     <title>osTicket Staff Control Panel</title>
     <!--[if IE]>
     <style type="text/css">
@@ -21,6 +16,11 @@
     <script type="text/javascript" src="./js/scp.js"></script>
     <link rel="stylesheet" href="./css/scp.css" media="screen">
     <link rel="stylesheet" href="./css/typeahead.css" media="screen">
+    <?php
+    if($ost && ($headers=$ost->getExtraHeaders())) {
+        echo "\n\t".implode("\n\t", $headers)."\n";
+    }
+    ?>
 </head>
 <body>
 <div id="container">
diff --git a/scp/tickets.php b/scp/tickets.php
index 567c3f697..bd5bebac2 100644
--- a/scp/tickets.php
+++ b/scp/tickets.php
@@ -483,9 +483,11 @@ if($ticket) {
     if($_REQUEST['a']=='search' && !$_REQUEST['status'])
         $nav->setActiveSubMenu(-1);
 
+    //$ost->addExtraHeader('<meta http-equiv="refresh" content="'.$min*60.'" />');
+
     //set refresh rate if the user has it configured
     if(!$_POST && $_REQUEST['a']!='search'  && ($min=$thisstaff->getRefreshRate()))
-        define('AUTO_REFRESH', $min*60); 
+        $ost->addExtraHeader('<meta http-equiv="refresh" content="'.($min*60).'" />');
 }
 
 require_once(STAFFINC_DIR.'header.inc.php');
-- 
GitLab