Code

Added filterDialogs , not functional at all.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 31 Aug 2010 13:19:31 +0000 (13:19 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 31 Aug 2010 13:19:31 +0000 (13:19 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19507 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/groupware/personal/groupware/class_filterEditor.inc [new file with mode: 0644]
gosa-plugins/groupware/personal/groupware/class_groupware.inc
gosa-plugins/groupware/personal/groupware/filterEditor.tpl [new file with mode: 0644]

diff --git a/gosa-plugins/groupware/personal/groupware/class_filterEditor.inc b/gosa-plugins/groupware/personal/groupware/class_filterEditor.inc
new file mode 100644 (file)
index 0000000..e892e45
--- /dev/null
@@ -0,0 +1,32 @@
+<?php
+
+class filterEditor extends plugin{
+
+    var $filterListing   = NULL;
+    var $filterRules = array();
+
+    function __construct($config, $rules)
+    {
+        plugin::plugin($config);
+        $this->filterRules = $rules;
+
+        $this->filterListing= new sortableListing();
+        $this->filterListing->setDeleteable(true);
+        $this->filterListing->setEditable(true);
+        $this->filterListing->setColspecs(array('*'));
+        $this->filterListing->setWidth("100%");
+        $this->filterListing->setHeight("200px;");
+    }
+
+    function execute()
+    {
+        $smarty = get_smarty();
+
+        $smarty->assign('list', $this->filterListing->render());
+
+        return($smarty->fetch(get_template_path('filterEditor.tpl',TRUE,dirname(__FILE__))));
+    }
+
+}
+
+?>
index 47ed4a19de91e1b5e4caa7033ba0afab40099346..6f6d7b52eff6cdce1084a719c3a44c2d7dd5f34e 100644 (file)
@@ -30,24 +30,25 @@ class groupware extends plugin
             );
 
     var $enabledFeatures = array(
-            "quotaUsage"                => FALSE,
-            "quotaSize"                 => FALSE,
-            "mailFilter"                => FALSE,
-            "alternateAddresses"        => FALSE,
-            "forwardingAddresses"       => FALSE,
-            "vacationMessage"           => FALSE,
-            "mailBoxWarnLimit"          => FALSE,
-            "mailBoxSendSizelimit"      => FALSE,
-            "alternateAddresses"        => FALSE,
-            "mailBoxHardSizelimit"      => FALSE,
-            "mailBoxAutomaticRemoval"   => FALSE,
-            "localDeliveryOnly"         => FALSE,
-            "dropOwnMails"              => FALSE);
+            "quotaUsage"                => TRUE,
+            "quotaSize"                 => TRUE,
+            "mailFilter"                => TRUE,
+            "alternateAddresses"        => TRUE,
+            "forwardingAddresses"       => TRUE,
+            "vacationMessage"           => TRUE,
+            "mailBoxWarnLimit"          => TRUE,
+            "mailBoxSendSizelimit"      => TRUE,
+            "mailBoxHardSizelimit"      => TRUE,
+            "mailBoxAutomaticRemoval"   => TRUE,
+            "localDeliveryOnly"         => TRUE,
+            "dropOwnMails"              => TRUE);
 
     var $flagAttrinutes = array("vacationEnabled","mailBoxWarnLimitEnabled","mailBoxSendSizelimitEnabled",
             "mailBoxHardSizelimitEnabled","mailBoxAutomaticRemovalEnabled","localDeliveryOnly","dropOwnMails");
 
     var $mailAddressSelectDialog = NULL;
+    var $filterEditor = NULL;
+    var $filterRules = array();
     var $vacationTemplates = array();
 
     var $mailAddress = "";
@@ -96,19 +97,6 @@ class groupware extends plugin
 
     function execute()
     {
-    $this->enabledFeatures = array(
-            "quotaUsage"                => TRUE,
-            "quotaSize"                 => TRUE,
-            "mailFilter"                => TRUE,
-            "alternateAddresses"        => TRUE,
-            "forwardingAddresses"       => TRUE,
-            "vacationMessage"           => TRUE,
-            "mailBoxWarnLimit"          => TRUE,
-            "mailBoxSendSizelimit"      => TRUE,
-            "mailBoxHardSizelimit"      => TRUE,
-            "mailBoxAutomaticRemoval"   => TRUE,
-            "localDeliveryOnly"         => TRUE,
-            "dropOwnMails"              => TRUE);
 
         // Register plugin execution 
         $display = plugin::execute();
@@ -119,6 +107,21 @@ class groupware extends plugin
             new log("view","users/".get_class($this),$this->dn);
         }
 
+        /****************
+          Filter editor
+         ****************/
+
+        if(isset($_POST['filterEditor_cancel'])) $this->filterEditor = NULL;
+        if(isset($_POST['configureFilter'])){
+            $this->filterEditor = new filterEditor($this->config, $this->filterRules);
+        }
+        $this->dialog = FALSE;
+        if($this->filterEditor instanceOf filterEditor){
+            $this->filterEditor->save_object();
+            $this->dialog = TRUE;
+            return($this->filterEditor->execute());
+        }
+
 
         /****************
           Account status
diff --git a/gosa-plugins/groupware/personal/groupware/filterEditor.tpl b/gosa-plugins/groupware/personal/groupware/filterEditor.tpl
new file mode 100644 (file)
index 0000000..338e0f9
--- /dev/null
@@ -0,0 +1,9 @@
+<h3>{t}Available filter rules {/t}</h3>
+
+{$list}
+
+<hr>
+<div class="plugin-actions">
+    <button name='filterEditor_ok'>{msgPool type='okButton'}</button>
+    <button name='filterEditor_cancel'>{msgPool type='cancelButton'}</button>
+</div>