forked from extern/egroupware
Refresh the nm and lock the tree if current active folder is the Trash Folder, when calling "Empty Trash" action, otherwise no need to refresh or lock the tree
This commit is contained in:
parent
ac55076b7b
commit
5941ff6a26
@ -4010,16 +4010,17 @@ class mail_ui
|
||||
}
|
||||
|
||||
/**
|
||||
* empty trash folder - its called via json, so the function must start with ajax (or the class-name must contain ajax)
|
||||
* Empty trash folder
|
||||
*
|
||||
* @param string $icServerID id of the server to empty its trashFolder
|
||||
* @param string $selectedFolder seleted(active) folder by nm filter
|
||||
* @return nothing
|
||||
*/
|
||||
function ajax_emptyTrash($icServerID)
|
||||
function ajax_emptyTrash($icServerID, $selectedFolder)
|
||||
{
|
||||
//error_log(__METHOD__.__LINE__.' '.$icServerID);
|
||||
translation::add_app('mail');
|
||||
|
||||
$response = egw_json_response::get();
|
||||
$rememberServerID = $this->mail_bo->profileID;
|
||||
if ($icServerID && $icServerID != $this->mail_bo->profileID)
|
||||
{
|
||||
@ -4028,20 +4029,23 @@ class mail_ui
|
||||
}
|
||||
$trashFolder = $this->mail_bo->getTrashFolder();
|
||||
if(!empty($trashFolder)) {
|
||||
if ($selectedFolder == $icServerID.self::$delimiter.$trashFolder)
|
||||
{
|
||||
// Lock the tree if the active folder is Trash folder
|
||||
$response->call('app.mail.lock_tree');
|
||||
}
|
||||
$this->mail_bo->compressFolder($trashFolder);
|
||||
}
|
||||
if ($rememberServerID != $this->mail_bo->profileID)
|
||||
{
|
||||
$oldFolderInfo = $this->mail_bo->getFolderStatus($trashFolder,false,false,false);
|
||||
$response = egw_json_response::get();
|
||||
$response->call('egw.message',lang('empty trash'));
|
||||
$response->call('app.mail.mail_reloadNode',array($icServerID.self::$delimiter.$trashFolder=>$oldFolderInfo['shortDisplayName']));
|
||||
//error_log(__METHOD__.__LINE__.' change Profile to ->'.$rememberServerID);
|
||||
$this->changeProfile($rememberServerID);
|
||||
}
|
||||
else
|
||||
else if ($selectedFolder == $icServerID.self::$delimiter.$trashFolder)
|
||||
{
|
||||
$response = egw_json_response::get();
|
||||
$response->call('egw.refresh',lang('empty trash'),'mail');
|
||||
}
|
||||
}
|
||||
|
@ -1472,10 +1472,11 @@ app.classes.mail = AppJS.extend(
|
||||
*/
|
||||
mail_emptyTrash: function(action,_senders) {
|
||||
var server = _senders[0].iface.id.split('::');
|
||||
var activeFilters = this.mail_getActiveFilters();
|
||||
var self = this;
|
||||
|
||||
this.egw.message(this.egw.lang('empty trash'));
|
||||
this.lock_tree();
|
||||
egw.json('mail.mail_ui.ajax_emptyTrash',[server[0]],function(){self.unlock_tree();})
|
||||
egw.json('mail.mail_ui.ajax_emptyTrash',[server[0], activeFilters['selectedFolder']? activeFilters['selectedFolder']:null],function(){self.unlock_tree()})
|
||||
.sendRequest(true);
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user