fix not opened tree with new tree-code, if you have only one account and fix state-handling to also store ActiveProfileID pref for a single account

This commit is contained in:
Ralf Becker 2015-08-21 08:02:23 +00:00
parent 0354cfdf59
commit 9046881177
3 changed files with 49 additions and 54 deletions

View File

@ -282,10 +282,6 @@ class emailadmin_imapbase
{
$oldProfileID = (int)$GLOBALS['egw_info']['user']['preferences']['mail']['ActiveProfileID'];
}
else
{
$oldProfileID = emailadmin_account::get_default_acc_id();
}
if ($_testConnection)
{
try

View File

@ -490,7 +490,7 @@ class mail_tree
* fill the active accounts with its children.
*
* @param string $_parent = null no parent node means root with the first level of folders
* @param string $_profileID = '' icServer id
* @param string $_profileID = '' active profile / acc_id
* @param int|boolean $_openTopLevel = 1 Open top level folders on load if it's set to 1|true,
* false|0 leaves them in closed state
* @param boolean $_subscribedOnly = false get only subscribed folders
@ -499,12 +499,11 @@ class mail_tree
*/
function getInitialIndexTree ($_parent = null, $_profileID = '', $_openTopLevel = 1, $_subscribedOnly= false, $_allInOneGo = false)
{
$tree = $this->getTree($_parent, $_profileID, $_openTopLevel, false, $_subscribedOnly, $_allInOneGo);
$activeAccount = $GLOBALS['egw_info']['user']['preferences']['mail']['ActiveProfileID'];
$branches = $this->getTree($activeAccount, $activeAccount,1,false,$_subscribedOnly,$_allInOneGo);
$tree = $this->getTree($_parent, '', $_openTopLevel, false, $_subscribedOnly, $_allInOneGo);
$branches = $this->getTree($_profileID, $_profileID,1,false,$_subscribedOnly,$_allInOneGo);
foreach ($tree[tree::CHILDREN] as &$account)
{
if ($account[tree::ID] == $activeAccount)
if ($account[tree::ID] == $_profileID)
{
$account = $branches;
}

View File

@ -483,7 +483,7 @@ class mail_ui
$content[self::$nm_index]['vacationrange'] = $sel_options[self::$nm_index]['vacationrange'] = '';
}
//$zstarttime = microtime (true);
$sel_options[self::$nm_index]['foldertree'] = $this->mail_tree->getInitialIndexTree(null, null, null, true,!$this->mail_bo->mailPreferences['showAllFoldersInFolderPane']);
$sel_options[self::$nm_index]['foldertree'] = $this->mail_tree->getInitialIndexTree(null, $this->mail_bo->profileID, null, true,!$this->mail_bo->mailPreferences['showAllFoldersInFolderPane']);
//$zendtime = microtime(true) - $zstarttime;
//error_log(__METHOD__.__LINE__. " time used: ".$zendtime);
$content[self::$nm_index]['selectedFolder'] = $this->mail_bo->profileID.self::$delimiter.(!empty($this->mail_bo->sessionData['mailbox'])?$this->mail_bo->sessionData['mailbox']:'INBOX');