Code

Updated filter handling
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 7 Sep 2010 10:59:21 +0000 (10:59 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 7 Sep 2010 10:59:21 +0000 (10:59 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19545 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/groupware/personal/groupware/class_filterManager.inc
gosa-plugins/groupware/personal/groupware/class_groupware.inc

index afa3245e453d6465fd64b36ded6c52fedb65621d..b5101ac1c3897c5275ee5d09cf9ce51f9fb5c0a2 100644 (file)
@@ -3,7 +3,6 @@
 class filterManager extends plugin{
 
     var $filterListing   = NULL;
-    var $filterRules = array();
     var $filterEditor = NULL;
 
     function __construct($config,$parent,$rules)
@@ -12,7 +11,7 @@ class filterManager extends plugin{
         
         $this->parent = &$parent;
 
-        $this->filterRules = $rules;
+        $this->filter = $rules;
         $this->filterListing= new sortableListing();
         $this->filterListing->setDeleteable(true);
         $this->filterListing->setEditable(true);
@@ -20,9 +19,6 @@ class filterManager extends plugin{
         $this->filterListing->setWidth("100%");
         $this->filterListing->setHeight("150px;");
         $this->filterListing->setAcl($this->parent->getacl('mailFilter'));
-
-
-        $this->filter = array(); 
     }
 
     function execute()
@@ -134,6 +130,12 @@ class filterManager extends plugin{
             }
         }
     }
+
+
+    function save()
+    {
+        return($this->filter);
+    }
 }
 
 ?>
index 3a1d53808b2cf4d88b03c9c70ba11ae1bf36cc02..e816b0403a3edc30bd0fb42d103ac6518f3d1ec3 100644 (file)
@@ -115,6 +115,16 @@ class groupware extends plugin
          ****************/
 
         if(isset($_POST['filterManager_cancel'])) $this->filterManager = NULL;
+        if(isset($_POST['filterManager_ok'])){
+            $this->filterManager->save_object();
+            $msgs = $this->filterManager->check();
+            if(count($msgs)){
+                msg_dialog::displayChecks($msgs);
+            }else{
+                $this->filterRules = $this->filterManager->save();
+                $this->filterManager = NULL;
+            }
+        }
         if(isset($_POST['configureFilter'])){
             $this->filterManager = new filterManager($this->config, $this,$this->filterRules);
             $this->filterManager->acl_base = $this->acl_base;
@@ -512,8 +522,8 @@ class groupware extends plugin
      */
     function check()
     {
-        $mssages = plugin::check();
-        return($message);
+        $messages = plugin::check();
+        return($messages);
     }