handle folder-tree refresh on subscribe/unsubscribe ; with focus on shared folders

This commit is contained in:
Klaus Leithoff 2014-05-20 14:28:23 +00:00
parent c34ddd14c4
commit 86eb361233

View File

@ -276,6 +276,7 @@ class mail_ui
} }
return $result; return $result;
} }
/** /**
* Subscription popup window * Subscription popup window
* *
@ -345,6 +346,7 @@ class mail_ui
} }
} }
$parentFolder='INBOX'; $parentFolder='INBOX';
/*
$folderInfo = $this->mail_bo->getFolderStatus($parentFolder,false); $folderInfo = $this->mail_bo->getFolderStatus($parentFolder,false);
if ($folderInfo['unseen']) if ($folderInfo['unseen'])
{ {
@ -354,8 +356,10 @@ class mail_ui
{ {
$folderInfo['shortDisplayName'] = $folderInfo['shortDisplayName']; $folderInfo['shortDisplayName'] = $folderInfo['shortDisplayName'];
} }
*/
$refreshData = array( $refreshData = array(
$content['profileId'].self::$delimiter.$parentFolder=>$folderInfo['shortDisplayName']); $content['profileId']/*.self::$delimiter.$parentFolder*/=>lang($parentFolder)//$folderInfo['shortDisplayName'])
);
// Send full info back in the response // Send full info back in the response
$response = egw_json_response::get(); $response = egw_json_response::get();
@ -3752,6 +3756,8 @@ $this->partID = $partID;
// that we get what we request // that we get what we request
if ($_subscribedOnly != $oldPrefForSubscribedOnly) $this->mail_bo->resetFolderObjectCache($profileID); if ($_subscribedOnly != $oldPrefForSubscribedOnly) $this->mail_bo->resetFolderObjectCache($profileID);
if ($profileID != $this->mail_bo->profileID) return; // only current connection if ($profileID != $this->mail_bo->profileID) return; // only current connection
if (!empty($folderName))
{
$parentFolder=(!empty($folderName)?$folderName:'INBOX'); $parentFolder=(!empty($folderName)?$folderName:'INBOX');
$folderInfo = $this->mail_bo->getFolderStatus($parentFolder,false); $folderInfo = $this->mail_bo->getFolderStatus($parentFolder,false);
if ($folderInfo['unseen']) if ($folderInfo['unseen'])
@ -3765,7 +3771,13 @@ $this->partID = $partID;
$refreshData = array( $refreshData = array(
$profileID.self::$delimiter.$parentFolder=>$folderInfo['shortDisplayName']); $profileID.self::$delimiter.$parentFolder=>$folderInfo['shortDisplayName']);
}
else
{
$refreshData = array(
$profileID=>lang('INBOX')//string with no meaning lateron
);
}
// Send full info back in the response // Send full info back in the response
$response = egw_json_response::get(); $response = egw_json_response::get();
foreach($refreshData as $folder => &$name) foreach($refreshData as $folder => &$name)