From: hickert Date: Thu, 18 Nov 2010 14:08:45 +0000 (+0000) Subject: Load mailFolder entries on demand. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=0ab8e2f98fe810bfb1a508a4d57be33bcdac70fa;p=gosa.git Load mailFolder entries on demand. -This increases the speed in which a user can be openend. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20271 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/groupware/personal/groupware/class_Groupware.inc b/gosa-plugins/groupware/personal/groupware/class_Groupware.inc index f61a6b4b5..0db7a70f0 100644 --- a/gosa-plugins/groupware/personal/groupware/class_Groupware.inc +++ b/gosa-plugins/groupware/personal/groupware/class_Groupware.inc @@ -61,7 +61,7 @@ class Groupware extends plugin var $mailAddress = ""; var $mailLocation = ""; - var $mailFolder = array(); + var $mailFolder = NULL; var $quotaUsage = 0; var $quotaSize = 0; var $alternateAddresses = array(); @@ -324,7 +324,16 @@ class Groupware extends plugin $this->FolderWidget = NULL; } } + + // Act on requests to edit mailFolder entries. if(isset($_POST['configureFolder'])){ + + // Load mail folder entries on demand, this will increase the account + // instantiation a lot. + if($this->mailFolder === NULL){ + $this->mailFolder = $this->GroupwareDao->getListOfMailFolders(); + } + $folders = $this->mailFolder; if(!isset($folders[$this->folderPrefix])){ $folders[$this->folderPrefix] = array('name' => $this->uid,'status' => 'added','acls' => array()); @@ -856,7 +865,7 @@ class Groupware extends plugin } // Save account folders - if($this->isFeatureEnabled("mailFolder") && $this->hasFeaturebeenChanged("mailFolder")){ + if($this->mailFolder !== NULL && $this->isFeatureEnabled("mailFolder") && $this->hasFeaturebeenChanged("mailFolder")){ $res = $this->saveFoldersAndAcls($this->uid, $this->mailFolder); if($res === NULL){ $message = _("Saving mail folder failed!"); diff --git a/gosa-plugins/groupware/personal/groupware/class_GroupwareDao.inc b/gosa-plugins/groupware/personal/groupware/class_GroupwareDao.inc index 3ce6f8a39..635843d49 100644 --- a/gosa-plugins/groupware/personal/groupware/class_GroupwareDao.inc +++ b/gosa-plugins/groupware/personal/groupware/class_GroupwareDao.inc @@ -198,16 +198,22 @@ class GroupwareDao{ $resultArr["mailLimitSendValue"] = $comp["mailLimits"]["send"]; $resultArr["vacationMessage"] = $comp["vacation"]["message"]; - - //Folder Stuff + + return $resultArr; + } + + + /* \brief Returns a list of mail folders for the current folderPrefix. + * Acl entries will be returned the GOsa-usable way. + * @return Array A list of mail folder entries. + */ + function getListOfMailFolders() + { $prefix = $this->groupwarePluginRef->folderPrefix; $compFolders = $this->get("folderListWithMembers", array($prefix)); - //ausgelagerte Funktion.. - $resultArr["mailFolder"] = $this->translateGwAclsToGosaAcls($compFolders); - - return $resultArr; - + return($this->translateGwAclsToGosaAcls($compFolders)); } + private function getComprehensiverUserSeparate($uid){ if($this->groupwarePluginRef->isFeatureEnabled("primaryMail")){