Code

(groupware) some code cleaning
authorhzerres <hzerres@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 20 Oct 2010 09:14:09 +0000 (09:14 +0000)
committerhzerres <hzerres@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 20 Oct 2010 09:14:09 +0000 (09:14 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20098 594d385d-05f5-0310-b6e9-bd551577e9d8

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

index 0f03abdb3484ceda2176a42c15f7a60dd7af164a..bd5c624cd5ba9ac04c3854dd880b3984bb6b053d 100644 (file)
@@ -127,7 +127,6 @@ class Groupware extends plugin
         return($res);
     }
 
-
     /*! \brief    Checks if feature is availavle on the server (a call to getCapabilities achieves this.)
      */
     public function isFeatureEnabled($featureName)
@@ -156,9 +155,9 @@ class Groupware extends plugin
         $featureReq = array(
                 "primaryMail"                          => array(
                     'acctGetPrimaryMailAddress'),
-                "quotaUsage"                => array("_off",
+                "quotaUsage"                => array(
                     'acctGetQuota'),
-                "quotaSize"                 => array("_off",
+                "quotaSize"                 => array(
                     'acctSetQuota','acctGetQuota'),
                 "mailLocations"                                => array(
                     'getMailboxLocations'),
@@ -170,13 +169,14 @@ class Groupware extends plugin
                 "forwardingAddresses"       => array(
                     'acctAddMailForwardAddress','acctDelMailForwardAddress',
                     'acctGetMailForwardAddresses','acctSetMailForwardAddresses'),
-                "vacationMessage"           => array("_off",
+                "vacationMessage"           => array(
                     'acctDelFilter','acctGetFilters','acctSetFilters','acctSetFilters'),
                 "mailBoxWarnLimit"          => array(
                     'acctSetQuota','acctGetQuota'),
                 "mailBoxSendSizelimit"      => array(
                         'acctSetQuota','acctGetQuota'),
-                "mailBoxHardSizelimit"      => array(
+                               //This is the same as qotaSize - should stay turned off
+                "mailBoxHardSizelimit"      => array( "_off",
                         'acctSetQuota','acctGetQuota'),
                 "mailBoxAutomaticRemoval"   => array(
                         'acctSetQuota','acctGetQuota'),
@@ -804,15 +804,15 @@ class Groupware extends plugin
                //Save quota
                if( ($this->isFeatureEnabled("mailBoxWarnLimit") ||
                        $this->isFeatureEnabled("mailBoxSendSizelimit") ||
-                       $this->isFeatureEnabled("mailBoxHardSizelimit") ||
+                       $this->isFeatureEnabled("quotaSize") ||
                        $this->isFeatureEnabled("mailBoxAutomaticRemoval"))
                && ($this->hasFeaturebeenChanged("mailBoxWarnLimit") ||
                        $this->hasFeaturebeenChanged("mailBoxSendSizelimit") ||
-                       $this->hasFeaturebeenChanged("mailBoxHardSizelimit") ||
+                       $this->hasFeaturebeenChanged("quotaSize") ||
                        $this->hasFeaturebeenChanged("mailBoxAutomaticRemoval") )){
                        $quota = array( "warn_limit" => $this->mailBoxWarnLimitValue,
                                        "send_limit" => $this->mailBoxSendSizelimitValue,
-                                       "hard_limit" => $this->mailBoxHardSizelimitValue,
+                                       "hard_limit" => $this->quotaSize,
                                        "hold" => $this->quotaSize);
 
                        $this->groupwareDao->save("quotaSize", $this->uid, $quota);
@@ -825,11 +825,8 @@ class Groupware extends plugin
      */
     function check()
     {
-               //add some checks
+               //checked only if features are enabled.
         $messages = plugin::check();
-
-        //Check the dates        
-        // TODO: check only if features are enabled.
         
         //required vacationEnabled
         if($this->vacationEnabled){
index 6194987fedb2c56d601aaeb0dd47e429b1bb8dea..0ad4a0e4aa3c0d7096acd0d36e68389d5e62bb3a 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 
  
-/*! \brief Data Access Object for groupware
+/*! \brief Data Access Object for groupware
  */
 class GroupwareDao{
 
@@ -68,8 +68,6 @@ class GroupwareDao{
     function __construct(&$pluginRef)
     {
         $this->groupwarePluginRef = &$pluginRef;
-        
-        // TODO: Remove all echos 
 
         $this->init();
     }
@@ -82,8 +80,6 @@ class GroupwareDao{
     public function init()
     {
         $this->availableMethods = $this->groupwarePluginRef->rpcExec('gwGetCapabilities');
-        //$this->availableProperties = $this->groupwarePluginRef->rpcExec('gwGetSupportedProperties');
-        //$this->debug("availableProperties on init:", $this->availableProperties);
     }
 
 
@@ -189,7 +185,7 @@ class GroupwareDao{
                        //Folder Id from the User ...
                        //user/$id/
                        $resultArr["mailFolder"] = $this->get("mailFolder", array("user/".$uid."/"));
-                       //print_a($resultArr["mailFolder"]);
+                       print_a($resultArr["mailFolder"]);
                        /*
                        "RIGHTS_NONE", 0);
                        "RIGHTS_READ",  LOOKUP | READ | STATUS);
@@ -198,58 +194,6 @@ class GroupwareDao{
                        "RIGHTS_WRITE", RIGHTS_APPEND | WRITE | CREATE | DELETE);
             ""
              */
-                        /*
-            $resultArr["mailFolder"] = array(
-                    'user/wiwu/Aufgaben' => array( 
-                        "name" =>"Aufgaben",
-                        "acls"=> array(        
-                            array(
-                                "name" => "wiwu",
-                                "acl"  => GROUPWARE_RIGHTS_ALL, 
-                                "type"=>"user"),
-                            array(
-                                "name" => "2a",
-                                "acl" => GROUPWARE_RIGHTS_ALL, 
-                                "type"=>"user"))), 
-
-                    'user/wiwu/Entw\xc3\xbcrfe' =>array(
-                        "name" => "Entw\xc3\xbcrfe", 
-                        "acls" => array(       
-                            array(
-                                "name" => "wiwu",
-                                "acl" => GROUPWARE_RIGHTS_ALL, 
-                                "type"=>"user"))), 
-                    'user/wiwu/Gel\xc3\xb6schte Objekte' => array( 
-                        "name" => "Gel\xc3\xb6schte Objekte", 
-                        "acls" => array(       
-                            array(
-                                "name" => "wiwu",
-                                "acl" => GROUPWARE_RIGHTS_ALL, 
-                                "type"=>"user"))), 
-                    'user/wiwu/Synchronisierungsprobleme/Lokale Fehler'  => array( 
-                            "name" => "Lokale Fehler", 
-                            "acls" => array(   
-                                array(
-                                    "name" => "wiwu",
-                                    "acl" => GROUPWARE_RIGHTS_ALL, 
-                                    "type"=>"user"))), 
-                    'user/wiwu/Synchronisierungsprobleme/Serverfehler'  => array( 
-                            "name" => "Serverfehler", 
-                            "acls" => array(   
-                                array(
-                                    "name" => "wiwu",
-                                    "acl" => GROUPWARE_RIGHTS_ALL, 
-                                    "type"=>"user"))), 
-                    'shared/publicFolder'  => array( 
-                            "name" => "publicFolder", 
-                            "acls" => array(   
-                                array(
-                                    "name" => "wiwu",
-                                    "acl" => GROUPWARE_RIGHTS_ALL, 
-                                    "type"=>"user"))), 
-                                                                       );
-                                       */
-            
                        
                        //need a status for the array - setting them now for the example data.
             foreach($resultArr["mailFolder"] as $id => $folder){
@@ -269,13 +213,6 @@ class GroupwareDao{
             // Usage is a Mapi function which is not yet 
             
             // example Array for Quota
-                       /*
-                       $quota = array( "warn_limit" => 1008,
-                    "send_limit" => 108,
-                    "hard_limit" => 1108,
-                    "hold" => 508,
-                    "usage" => 1108);
-                       */
             $quota = $this->get("quotaSize", array($uid));
             
             $resultArr["quotaSize"] = $quota["usage"];
@@ -315,7 +252,7 @@ class GroupwareDao{
         return $resultArr;
     }
        
-       //TODO: move this function into the groupwareplugin. #
+       //TODO: move this function into the groupwareplugin.
        //This is a feature with many datasets inside which should be cut in slices and saved separately.
        //Since the knowledge about the feature is only known in the plugin this has got to be moved.