Code

(groupware) enalble the vacation message - removed the dates.
authorhzerres <hzerres@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 22 Oct 2010 14:24:53 +0000 (14:24 +0000)
committerhzerres <hzerres@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 22 Oct 2010 14:24:53 +0000 (14:24 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20126 594d385d-05f5-0310-b6e9-bd551577e9d8

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

index cb42e0069f34dd2cfe179c3c154239f27e6f4b7a..928b1e56a579e6526aa22f31c7e1d0856faf67ea 100644 (file)
@@ -40,8 +40,8 @@ class Groupware extends plugin
 
     var $attributes = array(
             "mailAddress", "mailLocation", "quotaUsage", "quotaSize", "alternateAddresses",
-            "forwardingAddresses", "vacationEnabled", "vacationStart", "vacationStop",
-            "vacationMessage", "mailBoxWarnLimitEnabled", "mailBoxWarnLimitValue",
+            "forwardingAddresses", "vacationEnabled", "vacationMessage", 
+            "mailBoxWarnLimitEnabled", "mailBoxWarnLimitValue",
             "mailBoxSendSizelimitEnabled", "mailBoxSendSizelimitValue", "mailBoxHardSizelimitEnabled",
             "mailBoxHardSizelimitValue", "mailBoxAutomaticRemovalEnabled", "mailBoxAutomaticRemovalValue",
             "localDeliveryOnly", "dropOwnMails", "mailFolder", "mailLimitReceiveValue", "mailLimitSendValue",
@@ -70,8 +70,6 @@ class Groupware extends plugin
     var $alternateAddresses = array();
     var $forwardingAddresses = array();
     var $vacationEnabled = FALSE;
-    var $vacationStart = 0;
-    var $vacationStop = 0;
     var $vacationMessage = "";
     var $mailBoxWarnLimitEnabled = FALSE;
     var $mailBoxWarnLimitValue = 100;
@@ -177,7 +175,7 @@ class Groupware extends plugin
                     'acctAddMailForwardAddress','acctDelMailForwardAddress',
                     'acctGetMailForwardAddresses','acctSetMailForwardAddresses'),
                 "vacationMessage"           => array(
-                    'acctDelFilter','acctGetFilters','acctSetFilters','acctSetFilters'),
+                    'acctSetOutOfOfficeReply', 'acctGetOutOfOfficeReply'),
                 "mailBoxWarnLimit"          => array(
                     'acctSetQuota','acctGetQuota'),
                 "mailBoxSendSizelimit"      => array(
@@ -545,8 +543,7 @@ class Groupware extends plugin
 
             // Get ui modifications and store them in the class.
             $testAttrs = array("mailAddress","mailLocation","quotaUsage","quotaSize",
-                    "alternateAddresses","forwardingAddresses","vacationEnabled","vacationStart",
-                    "vacationStop","vacationMessage");
+                    "alternateAddresses","forwardingAddresses","vacationEnabled","vacationMessage");
             foreach($testAttrs as $attr){
                 if(isset($_POST[$attr]) && $this->acl_is_writeable($attr)){
                     $this->$attr = get_post($attr);
@@ -580,7 +577,7 @@ class Groupware extends plugin
      * Used to fill vacation dropdown box.
      * @return Array   All useable vacation templates.
      */ 
-    function get_vacation_templates()
+    function get_vacation_templates_usedSomewhere()
     {
         $vct = array();
         if ($this->config->get_cfg_value("core","vacationTemplateDirectory") != ""){
@@ -701,7 +698,7 @@ class Groupware extends plugin
      * @param  string  Vacation string
      * @return string  Completed vacation string
      */
-    private function prepare_vacation_template($contents)
+    private function prepare_vacation_template_usedSomewhere($contents)
     {
         /* Replace attributes */
         $attrs = array();
@@ -856,7 +853,11 @@ class Groupware extends plugin
                if($this->isFeatureEnabled("mailLimit") && $this->hasFeaturebeenChanged("mailLimit")){
                        $this->groupwareDao->save("mailLimit", $this->uid, array("receive"=>$this->mailLimitReceiveValue, "send"=>$this->mailLimitSendValue,));
                }
-               
+               if($this->isFeatureEnabled("vacationMessage")&& $this->hasFeaturebeenChanged("vacationMessage")){
+                       if($this->vacationEnabled){
+                               $this->groupwareDao->save("vacationMessage", $this->uid, $this->vacationMessage);
+                       }
+               }
                //checks for feature "quotaUsage"                
                //not to be saved
     }
@@ -910,17 +911,7 @@ class Groupware extends plugin
                //checks for feature "vacationMessage"   
                if ($this->isFeatureEnabled("vacationMessage")){                
                        if($this->vacationEnabled){
-                               if(!tests::is_date($this->vacationStart)){
-                                       $messages[] = msgPool::invalid(_("Vacation start date"),$this->vacationStart , "", "01.03.2010");
-                               }
-                               if(!tests::is_date($this->vacationStop)){
-                                       $messages[] = msgPool::invalid(_("Vacation stop date"),$this->vacationStop , "", "01.03.2010");
-                               }
-                               $diff = tests::compareDate($this->vacationStart, $this->vacationStop);
-
-                               if($diff>=0){
-                                       $messages[] = msgPool::invalid(_("Vacation dates"));
-                               }
+                               
                        }        
                }
                //checks for feature "mailLimit" - integer 
index dd8773374c0b293d2c2fa1a333b68403020f362c..9205f68db15e3c684b5c91121f0a2773884187fd 100644 (file)
@@ -236,7 +236,6 @@ class GroupwareDao{
                 $resultArr["mailBoxHardSizelimitEnabled"] = FALSE;
                 $resultArr["mailBoxHardSizelimitValue"] = 0;
             }
-                       
         }
                //get the current MailLimits ... if this feature is enabled.
                if($this->groupwarePluginRef->isFeatureEnabled("mailLimit")){
index 7893edd83aab4376b4d9bcb9cad0d01105f2e6a6..150763d0f8e9828c948e499b00643c10c04d3dfa 100644 (file)
                                 id="vacationEnabled" 
                                 title="{t}Select to automatically response with the vacation message defined below{/t}" 
                                 class="center" 
-                                onclick="changeState('vacationStart'); changeState('vacationStop'); changeState('vacationMessage');">
+                                onclick="changeState('vacationMessage');">
                             {/render}
                         </td>
                         <td colspan="4">
                             {t}Activate vacation message{/t}
                         </td>
                     </tr>
-                    <tr>
-                        <td>&nbsp;</td>
-                        <td style='width:30px;'>{t}from{/t}</td>
-                        <td>
-                            {render acl=$vacationStartACL}
-                                <input type="text" id="vacationStart" name="vacationStart" class="date" 
-                                    style='width:100px' value="{$vacationStart}"
-                                    {if !$vacationEnabled} disabled {/if}
-                                    >
-                            {/render}
-                            {if $vacationStartACL|regex_replace:"/[cdmr]/":"" == "w"}
-                                <script type="text/javascript">
-                                    {literal}
-                                        var datepicker  = new DatePicker({ 
-                                            relative : 'vacationStart', 
-                                            language : '{/literal}{$lang}{literal}', 
-                                            keepFieldEmpty : true, 
-                                            enableCloseEffect : false, 
-                                            enableShowEffect : false });
-                                    {/literal}
-                                </script>
-                            {/if}
-                        </td>
-                        <td style='width:30px;'>{t}till{/t}</td>
-                        <td>
-                            {render acl=$vacationStartACL}
-                                <input type="text" id="vacationStop" name="vacationStop" class="date" 
-                                    style='width:100px' value="{$vacationStop}"i
-                                    {if !$vacationEnabled} disabled {/if}
-                                    >
-                            {/render}
-                            {if $vacationStopACL|regex_replace:"/[cdmr]/":"" == "w"}
-                                <script type="text/javascript">
-                                    {literal}
-                                        var datepicker2  = new DatePicker({ 
-                                            relative : 'vacationStop', 
-                                            language : '{/literal}{$lang}{literal}', 
-                                            keepFieldEmpty : true, 
-                                            enableCloseEffect : false,  
-                                            enableShowEffect : false });
-                                    {/literal}
-                                </script>
-                            {/if}
-                        </td>
-                    </tr>
                     <tr>
                         <td colspan=5>
                             {render acl=$vacationMessageACL}