Code

Updated sorting
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 29 May 2007 09:11:00 +0000 (09:11 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 29 May 2007 09:11:00 +0000 (09:11 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6502 594d385d-05f5-0310-b6e9-bd551577e9d8

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

index 742149ff769cac27d886ed0b8a54b009384a4966..ca2cfcf80b5d5bf6d6de8be11deb543dde14c9b8 100644 (file)
@@ -273,6 +273,8 @@ class gosa_logview extends plugin
     $smarty->assign("actions",$actions);
     $smarty->assign("date_select", $date_select);
 
+    $smarty->assign("direction", $this->sort_direction);
+
     /* Show main page */
     return ($smarty->fetch (get_template_path('gosa_log_contents.tpl', TRUE)));
   }
@@ -280,6 +282,7 @@ class gosa_logview extends plugin
 
   function save_object()
   {
+    $_SESSION['kekse'][] = get_class($this)."->save_object";
     /* Get submitted range */  
     if(isset($_POST['EntriesPerPage'])){
       if(is_numeric($_POST['EntriesPerPage'])){
@@ -315,14 +318,13 @@ class gosa_logview extends plugin
 
     /* Adapt sorting */
     if (isset($_GET['sort'])){
-      if ($this->sort == (int)$_GET['sort']){
-        if ($this->sort_direction == "down"){
-          $this->sort_direction= "up";
-        } else {
-          $this->sort_direction= "down";
-        }
+
+      if($_GET['direction'] == "up"){
+        $this->sort_direction = "down";
+      }else{
+        $this->sort_direction = "up";
       }
-      
+
       $this->sort= (int)$_GET['sort'];
       if ($this->sort < 0 || $this->sort > 3){
         $this->sort= 0;
@@ -334,6 +336,8 @@ class gosa_logview extends plugin
     foreach(array("action","server","time","regex") as $attr){
       $_SESSION['logview']['gosa_log'][$attr] = $this->$attr;
     }
+
+
   }
 
 
index c01f6b434f2ad615d038bf8391b17a03df1a68c5..824963789a781ff53e5a66d91fd7be0bd2185861 100644 (file)
 {if $search_result ne ""}
  <table summary="" style="width:100%; vertical-align:top; text-align:left; border:1px solid #B0B0B0;" cellpadding=2 cellspacing=1 rules="cols">
   <tr style="background-color: #E8E8E8; height:26px; font-weight:bold">
-   <td><a href=main.php{$plug}&amp;sort=0>{t}Action{/t} {$mode0}</a></td>
-   <td><a href=main.php{$plug}&amp;sort=1>{t}Object{/t} {$mode1}</a></td>
-   <td><a href=main.php{$plug}&amp;sort=2>{t}Date{/t} {$mode2}</a></td>
-   <td><a href=main.php{$plug}&amp;sort=3>{t}Message{/t} {$mode3}</a></td>
+   <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}Object{/t} {$mode1}</a></td>
+   <td><a href=main.php{$plug}&amp;sort=2&amp;direction={$direction}>{t}Date{/t} {$mode2}</a></td>
+   <td><a href=main.php{$plug}&amp;sort=3&amp;direction={$direction}>{t}Message{/t} {$mode3}</a></td>
   </tr>
   {$search_result}
  </table>