Code

Updated log view.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 23 Nov 2007 08:52:45 +0000 (08:52 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 23 Nov 2007 08:52:45 +0000 (08:52 +0000)
Enabled sorting for result and repeats

git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7864 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/addons/logview/class_gosa_logview.inc
plugins/addons/logview/gosa_log_contents.tpl

index 3d1f5a5a74e58d2ece1a67c906e20b1c8d189392..e538cb0be42d4e7bd2b92f2a06bad52bcba298bc 100644 (file)
@@ -19,7 +19,7 @@ class gosa_logview extends plugin
   var $sort   = 1;
 
   var $sort_direction = "down";
-  var $fields         = array("action","timestamp","object","user","result","repeated");
+  var $fields         = array("action","timestamp","user","objecttype","object","result","repeated");
   var $range          = 25;
   var $view_logged    = FALSE;
 
@@ -84,6 +84,8 @@ class gosa_logview extends plugin
     $smarty->assign("mode2", "");
     $smarty->assign("mode3", "");
     $smarty->assign("mode4", "");
+    $smarty->assign("mode5", "");
+    $smarty->assign("mode6", "");
 
     /* Assign select option content */
     foreach( array("server", "action", "time", "regex") as $type){
@@ -160,7 +162,7 @@ class gosa_logview extends plugin
     
     if(!preg_match("/r/",$acls)){
       $res = "<tr>
-        <td colspan=4>
+        <td colspan=".count($this->fields).">
         "._("You have insufficient permissions to view syslog entries.")."
         </td>
         </tr>";
@@ -263,6 +265,7 @@ class gosa_logview extends plugin
           $res.="   <td title='".$line['objecttype']."'>".$line['action']."</td>";
           $res.="   <td>".date("H:i:s d.m.Y",$line['timestamp'])."</td>";
           $res.="   <td title='".$line['user']."'>".preg_replace("/,/",", ",$user)."</td>"; 
+          $res.="   <td title='".$line['objecttype']."'>".$line['objecttype']."</td>"; 
           $res.="   <td title='".$line['object']."'>".preg_replace("/,/",", ",$object)."</td>"; 
           $res.="   <td>".$line['result']."</td>";
           if($line['repeated'] == 1){
@@ -337,7 +340,7 @@ class gosa_logview extends plugin
       }
 
       $this->sort= (int)$_GET['sort'];
-      if ($this->sort < 0 || $this->sort > 4){
+      if ($this->sort < 0 || $this->sort > count($this->fields)){
         $this->sort= 0;
       }
     }
index 9a66848c0ea61cb23545fa5d6e376eb38e827889..dcc9dd1e701fb8f668e0144a683578ac614c8816 100644 (file)
    <td><a href=main.php{$plug}&amp;sort=0&amp;direction={$direction}>{t}Action{/t} {$mode0}</a></td>
    <td><a href=main.php{$plug}&amp;sort=1&amp;direction={$direction}>{t}Date{/t} {$mode1}</a></td>
    <td><a href=main.php{$plug}&amp;sort=2&amp;direction={$direction}>{t}User{/t} {$mode2}</a></td>
-   <td><a href=main.php{$plug}&amp;sort=2&amp;direction={$direction}>{t}Object{/t} {$mode2}</a></td>
-   <td><a href=main.php{$plug}&amp;sort=3&amp;direction={$direction}>{t}Message{/t} {$mode3}</a></td>
-   <td><a href=main.php{$plug}&amp;sort=4&amp;direction={$direction}>{t}Repeated{/t} {$mode4}</a></td>
+   <td><a href=main.php{$plug}&amp;sort=3&amp;direction={$direction}>{t}Object type{/t} {$mode3}</a></td>
+   <td><a href=main.php{$plug}&amp;sort=4&amp;direction={$direction}>{t}Object{/t} {$mode4}</a></td>
+   <td><a href=main.php{$plug}&amp;sort=5&amp;direction={$direction}>{t}Message{/t} {$mode5}</a></td>
+   <td><a href=main.php{$plug}&amp;sort=6&amp;direction={$direction}>{t}Repeated{/t} {$mode6}</a></td>
   </tr>
   {$search_result}
  </table>