Code

Updated deployment addon
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 28 Apr 2008 12:52:21 +0000 (12:52 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 28 Apr 2008 12:52:21 +0000 (12:52 +0000)
-Remember filter settings.

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

gosa-plugins/goto/addons/goto/class_gotomasses.inc

index fc2c14c5a05ad18ac7daebe52bd366dfbd72920f..cd1c0222387870eae7fe09a799e4cd7d7aa84c78 100644 (file)
@@ -40,7 +40,7 @@ class gotomasses extends plugin
   var $event_tags     = array();
 
   var $sort_by  = "Schedule";
-  var $sort_dir = "down";
+  var $sort_dir = "up";
   var $entries  = array();
   var $range    = 25;
   var $start    = 0;
@@ -57,6 +57,20 @@ class gotomasses extends plugin
     foreach($this->events['SCHEDULED'] as $evt){
       $this->event_tags[] = $evt['s_Queued_Action'];
     }
+
+    /* Load filter settings */
+    if(!session::is_set("gotomasses_filter")){
+      $gotomasses_filter = 
+        array(
+            "range" => $this->range,
+            "sort_by" => $this->sort_by,
+            "sort_dir" => $this->sort_dir);
+      session::set("gotomasses_filter",$gotomasses_filter);
+    }
+    $gotomasses_filter = session::get("gotomasses_filter");
+    foreach(array("range","sort_by","sort_dir") as $attr) {
+      $this->$attr = $gotomasses_filter[$attr];
+    }
   }
 
 
@@ -759,7 +773,14 @@ class gotomasses extends plugin
     if(isset($_POST['range']) && is_numeric($_POST['range'])){
       $this->range = $_POST['range'];
     }
-    
+  
+    /* Save filter settings */ 
+    $gotomasses_filter = session::get("gotomasses_filter");
+    foreach(array("range","sort_by","sort_dir") as $attr){
+      $gotomasses_filter[$attr] = $this->$attr;
+    }
+    session::set("gotomasses_filter",$gotomasses_filter);
     /* Page changed. */
     if(isset($_GET['start'])){
       $start = $_GET['start'];