Code

Updated logview to display the target object too.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 23 Nov 2007 08:38:25 +0000 (08:38 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 23 Nov 2007 08:38:25 +0000 (08:38 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7863 594d385d-05f5-0310-b6e9-bd551577e9d8

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

index 9d4a4aab22864fe7114b9ab5a3e38c968a204bec..3d1f5a5a74e58d2ece1a67c906e20b1c8d189392 100644 (file)
@@ -19,7 +19,7 @@ class gosa_logview extends plugin
   var $sort   = 1;
 
   var $sort_direction = "down";
-  var $fields         = array("action","timestamp","user","result","repeated");
+  var $fields         = array("action","timestamp","object","user","result","repeated");
   var $range          = 25;
   var $view_logged    = FALSE;
 
@@ -255,10 +255,15 @@ class gosa_logview extends plugin
             $col= "background-color: #F5F5F5;";
           }
 
+          $base = ", ".substr($this->config->current['BASE'],0,5)."...";
+          $user = preg_replace("/,".normalizePreg($this->config->current['BASE'])."/",$base,$line['user']);
+          $object = preg_replace("/,".normalizePreg($this->config->current['BASE'])."/",$base,$line['object']);
+
           $res.=" <tr style=\"$col\">\n";
           $res.="   <td title='".$line['objecttype']."'>".$line['action']."</td>";
           $res.="   <td>".date("H:i:s d.m.Y",$line['timestamp'])."</td>";
-          $res.="   <td title='".$line['object']."'>".preg_replace("/,/",", ",$line['user'])."</td>"; 
+          $res.="   <td title='".$line['user']."'>".preg_replace("/,/",", ",$user)."</td>"; 
+          $res.="   <td title='".$line['object']."'>".preg_replace("/,/",", ",$object)."</td>"; 
           $res.="   <td>".$line['result']."</td>";
           if($line['repeated'] == 1){
             $res.="   <td>-</td>";
index dda4503d0a912c1cadb70cb05d7f01a4bc6d728e..9a66848c0ea61cb23545fa5d6e376eb38e827889 100644 (file)
@@ -82,6 +82,7 @@
    <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>
   </tr>