From a7d2f5e515d190f1302fbae0498282ad59771f66 Mon Sep 17 00:00:00 2001 From: hzerres Date: Fri, 22 Oct 2010 15:25:55 +0000 Subject: [PATCH] (groupware) removing oooreply fixed. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20128 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../personal/groupware/class_Groupware.inc | 24 +++++++++---------- .../personal/groupware/class_GroupwareDao.inc | 8 +++++-- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/gosa-plugins/groupware/personal/groupware/class_Groupware.inc b/gosa-plugins/groupware/personal/groupware/class_Groupware.inc index 928b1e56a..75b9aa82f 100644 --- a/gosa-plugins/groupware/personal/groupware/class_Groupware.inc +++ b/gosa-plugins/groupware/personal/groupware/class_Groupware.inc @@ -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", diff --git a/gosa-plugins/groupware/personal/groupware/class_GroupwareDao.inc b/gosa-plugins/groupware/personal/groupware/class_GroupwareDao.inc index 9205f68db..5b6751be4 100644 --- a/gosa-plugins/groupware/personal/groupware/class_GroupwareDao.inc +++ b/gosa-plugins/groupware/personal/groupware/class_GroupwareDao.inc @@ -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; -- 2.30.2