Code

Updated statistic plugin
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 16 Aug 2010 13:40:13 +0000 (13:40 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 16 Aug 2010 13:40:13 +0000 (13:40 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19397 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/plugins/generic/statistics/class_statistics.inc
gosa-core/plugins/generic/statistics/statistics.tpl

index c22f8937b319db05a936b807d471083742e741e3..6289cba6956958bc61ae5b7f998c5cc4b4426d1f 100644 (file)
@@ -130,26 +130,25 @@ class statistics extends plugin
                     $this->graphID_2 = preg_replace("/[^0-9]/","",microtime(TRUE));
 
                     // Build up DataSet. 
-                    $tmp = array();
                     $DataSet2 = new pData;  
-                    $dates = array();
-                    $max = 0;
-
+                    $intervalEntries = array();
+                    $max =0;
                     foreach($res['actionsPerInterval'] as $id => $data){
-
+                        
                         $category = $data['category'];
                         $date =  $data['date'];
+                        $iDate =  strtotime($date);
+                        $count =  $data['count'];
 
                         if(!isset($mostUsedCategories[$category])) continue;
-
+                        $intervalEntries[$category][$date] = $count;
                         if($data['count'] > $max) $max = $data['count'];
-                        $tmp[$category][$date] = $data['count'];
-                        $dates[$date] = $date;
+                        $dates[$iDate]=$iDate;
                     }
                     
-                    foreach($tmp as $category => $data){
-                        ksort($tmp[$category]);
-                        $DataSet2->AddPoint($tmp[$category], $category);
+                    foreach($intervalEntries as $category => $data){
+                        ksort($intervalEntries[$category]);
+                        $DataSet2->AddPoint($intervalEntries[$category], $category);
                         $DataSet2->SetSerieName(_($category), $category);
                     }
 
index 317a831c1a3fafbf4804db2e512cc1685d56aea3..47fd7a832526a40d85d090484247e917707ef532 100644 (file)
 
     <hr>
     <table width="100%">
-        <tr>
-            <td>{t}Interval{/t}</td>
-            <td>
-                <select name='graph1Interval'>
-                    {html_options values=$intervalValues output=$intervalValues selected=$graph1Interval}
-                </select>
-            </td>
-        </tr>
         <tr>
             <td>{t}Start{/t}</td>
             <td>