getFolderObjects; always use static on single request if info is available; so if you require subscribed/unsubscribed results on a single request you MUST set to false

This commit is contained in:
Klaus Leithoff 2014-02-14 13:38:08 +00:00
parent be60a5036e
commit 509c5f5a24
3 changed files with 19 additions and 4 deletions

View File

@ -1949,6 +1949,14 @@ class mail_bo
{
if (self::$debug) error_log(__METHOD__.__LINE__.' ServerID:'.$this->icServer->ImapServerId.", subscribedOnly:$_subscribedOnly, getCounters:$_getCounters, alwaysGetDefaultFolders:$_alwaysGetDefaultFolders, _useCacheIfPossible:$_useCacheIfPossible");
static $folders2return;
// always use static on single request if info is available;
// so if you require subscribed/unsubscribed results on a single request you MUST
// set $_useCacheIfPossible to false !
if ($_useCacheIfPossible && isset($folders2return[$this->icServer->ImapServerId]) && !empty($folders2return[$this->icServer->ImapServerId]))
{
return $folders2return[$this->icServer->ImapServerId];
}
if ($_subscribedOnly && $_getCounters===false)
{
if (is_null($folders2return)) $folders2return = egw_cache::getCache(egw_cache::INSTANCE,'email','folderObjects'.trim($GLOBALS['egw_info']['user']['account_id']),$callback=null,$callback_params=array(),$expiration=60*60*1);

View File

@ -1175,7 +1175,7 @@ class mail_compose
}
}
}
//error_log(__METHOD__.__LINE__.$content['body']);
//error_log(__METHOD__.__LINE__.array2string($content));
if($content['mimeType'] == 'html') {
$ishtml=1;
} else {
@ -1282,6 +1282,7 @@ class mail_compose
// or not work as expected, as a full featured editor that may be wanted in other apps
// is way overloading the "normal" needs for composing mails
$content['rtfEditorFeatures']='simple-withimage';//egw_ckeditor_config::get_ckeditor_config();
//$content['rtfEditorFeatures']='advanced';//egw_ckeditor_config::get_ckeditor_config();
$content['validation_rules']= json_encode(mail_bo::$htmLawed_config);
$etpl->setElementAttribute('mail_htmltext','mode',$content['rtfEditorFeatures']);
$etpl->setElementAttribute('mail_htmltext','validation_rules',$content['validation_rules']);

View File

@ -189,12 +189,18 @@ class mail_ui
$stmpl = new etemplate_new('mail.subscribe');
$profileId = $_GET['acc_id'];
$zstarttime = microtime (true);
//$zstarttime = microtime (true);
$sel_options['foldertree'] = $this->getFolderTree(false, $profileId,false,false);
$zendtime = microtime(true) - $zstarttime;
error_log(__METHOD__.__LINE__. " time used: ".$zendtime);
//$zendtime = microtime(true) - $zstarttime;
//error_log(__METHOD__.__LINE__. " Building tree -> time used: ".$zendtime);
//$zstarttime = microtime (true);
$unsubscribedFolders = $this->mail_bo->fetchUnSubscribedFolders();
//$zendtime = microtime(true) - $zstarttime;
//error_log(__METHOD__.__LINE__. " Fetching Unsubscribed -> time used: ".$zendtime);
//$zstarttime = microtime (true);
$allFolders = $this->mail_bo->getFolderObjects();
//$zendtime = microtime(true) - $zstarttime;
//error_log(__METHOD__.__LINE__. " getFolderObjects -> time used: ".$zendtime);
if (!is_array($content))
{