Code

(groupware) removing oooreply fixed.
authorhzerres <hzerres@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 22 Oct 2010 15:25:55 +0000 (15:25 +0000)
committerhzerres <hzerres@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 22 Oct 2010 15:25:55 +0000 (15:25 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20128 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/groupware/personal/groupware/class_Groupware.inc
gosa-plugins/groupware/personal/groupware/class_GroupwareDao.inc

index 928b1e56a579e6526aa22f31c7e1d0856faf67ea..75b9aa82fdee830c97818057340da3daf3a3d6f9 100644 (file)
@@ -241,6 +241,7 @@ class Groupware extends plugin
      */
     function execute()
     {
+               print_a($_POST);
         // Register plugin execution 
         $display = plugin::execute();
 
@@ -543,7 +544,7 @@ class Groupware extends plugin
 
             // Get ui modifications and store them in the class.
             $testAttrs = array("mailAddress","mailLocation","quotaUsage","quotaSize",
-                    "alternateAddresses","forwardingAddresses","vacationEnabled","vacationMessage");
+                    "alternateAddresses","forwardingAddresses","vacationMessage");
             foreach($testAttrs as $attr){
                 if(isset($_POST[$attr]) && $this->acl_is_writeable($attr)){
                     $this->$attr = get_post($attr);
@@ -564,6 +565,9 @@ class Groupware extends plugin
                 }
             }
                        
+                       if($this->acl_is_writeable('vacationMessage')){
+                               $this->vacationEnabled = isset($_POST['vacationEnabled']);
+                       }
             // Get posted flag changes 
             $flagAttrs = array("localDeliveryOnly","dropOwnMails");
             foreach($flagAttrs as $attr){
@@ -836,9 +840,6 @@ class Groupware extends plugin
                //checks for feature "mailFilter"                 
                if($this->isFeatureEnabled("mailFilter") && $this->hasFeaturebeenChanged("mailFilter")){}
                
-               //checks for feature "vacationMessage"             
-               if($this->isFeatureEnabled("vacationMessage") && $this->hasFeaturebeenChanged("vacationMessage")){}
-               
                //checks for feature "mailBoxAutomaticRemoval"   
                if($this->isFeatureEnabled("mailBoxAutomaticRemoval") && $this->hasFeaturebeenChanged("mailBoxAutomaticRemoval")){}
                
@@ -855,8 +856,13 @@ class Groupware extends plugin
                }
                if($this->isFeatureEnabled("vacationMessage")&& $this->hasFeaturebeenChanged("vacationMessage")){
                        if($this->vacationEnabled){
+                               //setting an message means that the OOOReply is switched off.
                                $this->groupwareDao->save("vacationMessage", $this->uid, $this->vacationMessage);
                        }
+                       else{
+                               //setting no message means that the OOOReply is switched off.
+                               $this->groupwareDao->save("vacationMessage", $this->uid);
+                       }
                }
                //checks for feature "quotaUsage"                
                //not to be saved
@@ -909,11 +915,7 @@ class Groupware extends plugin
                }                       
 
                //checks for feature "vacationMessage"   
-               if ($this->isFeatureEnabled("vacationMessage")){                
-                       if($this->vacationEnabled){
-                               
-                       }        
-               }
+               if ($this->isFeatureEnabled("vacationMessage")){}
                //checks for feature "mailLimit" - integer 
                if ($this->isFeatureEnabled("mailLimit")){
                        if (!is_numeric($this->mailLimitReceiveValue)){
@@ -986,8 +988,6 @@ class Groupware extends plugin
                         "alternateAddresses"            => _("Alternate mail addresses"),
                         "forwardingAddresses"           => _("Forwarding mail addresses"),
                         "vacationEnabled"               => _("Vaction switch"),
-                        "vacationStart"                 => _("Vacation start time"),
-                        "vacationStop"                  => _("Vacation stop time"),
                         "vacationMessage"               => _("Vacation message"),
                         "mailBoxWarnLimit"              => _("Warn sizelimit"),
                         "mailBoxSendSizelimit"          => _("Send sizelimit"),
@@ -1018,8 +1018,6 @@ class Groupware extends plugin
                 "alternateAddresses" => "alternateAddresses",
                 "forwardingAddresses" => "forwardingAddresses",
                 "vacationEnabled" => "vacationEnabled",
-                "vacationStart" => "vacationStart",
-                "vacationStop" => "vacationStop",
                 "vacationMessage" => "vacationMessage",
                 "mailBoxWarnLimitEnabled" => "mailBoxWarnLimitEnabled",
                 "mailBoxWarnLimitValue" => "mailBoxWarnLimitValue",
index 9205f68db15e3c684b5c91121f0a2773884187fd..5b6751be4bd056f83e89e38756514696a8eb2061 100644 (file)
@@ -260,8 +260,12 @@ class GroupwareDao{
         //addding dummy
 
         if($this->groupwarePluginRef->isFeatureEnabled("vacationMessage")){
-
-            $vacMessage = $this->get("vacationMessage", array($uid));
+                       $vacArray = $this->get("vacationMessage", array($uid));
+                       
+            $resultArr["vacationMessage"] = $vacArray["message"];
+                       if(!empty($resultArr["vacationMessage"])){
+                               $resultArr["vacationEnabled"] = true;
+                       }
             //$resultArr["vacationMessage"] = "dummy Vacation message - (getOutOfOfficeReply currently throws errors )";
         }   
         return $resultArr;