* Mail: fix updating/deleting mail accounts does not refresh the mail tree no more

This commit is contained in:
Hadi Nategh 2021-09-01 16:23:38 +02:00
parent e500190728
commit 1fd43b0bdd
3 changed files with 6 additions and 3 deletions

View File

@ -1122,7 +1122,7 @@ class admin_mail
} }
if ($content['acc_id']) Mail::unsetCachedObjects($content['acc_id']); if ($content['acc_id']) Mail::unsetCachedObjects($content['acc_id']);
if (stripos($msg,'fatal error:')!==false) $msg_type = 'error'; if (stripos($msg,'fatal error:')!==false) $msg_type = 'error';
Framework::refresh_opener($msg, 'emailadmin', $content['acc_id'], $new_account ? 'add' : 'update', null, null, null, $msg_type); Framework::refresh_opener($msg, 'mail-account', $content['acc_id'], $new_account ? 'add' : 'update', null, null, null, $msg_type);
if ($button == 'save') Framework::window_close(); if ($button == 'save') Framework::window_close();
break; break;
@ -1135,7 +1135,7 @@ class admin_mail
elseif (Mail\Account::delete($content['acc_id']) > 0) elseif (Mail\Account::delete($content['acc_id']) > 0)
{ {
if ($content['acc_id']) Mail::unsetCachedObjects($content['acc_id']); if ($content['acc_id']) Mail::unsetCachedObjects($content['acc_id']);
Framework::refresh_opener(lang('Account deleted.'), 'emailadmin', $content['acc_id'], 'delete'); Framework::refresh_opener(lang('Account deleted.'), 'mail-account', $content['acc_id'], 'delete');
Framework::window_close(); Framework::window_close();
} }
else else

View File

@ -107,6 +107,9 @@ class mail_hooks
), ),
'entry' => 'Mail', 'entry' => 'Mail',
'entries' => 'Mails', 'entries' => 'Mails',
'additional' => [
'mail-account' => []
]
); );
} }

View File

@ -595,7 +595,7 @@ app.classes.mail = AppJS.extend(
if (_type === 'delete' && !this.egw.dataHasUID('mail::'+_id)) return false; if (_type === 'delete' && !this.egw.dataHasUID('mail::'+_id)) return false;
break; break;
case 'emailadmin': // update tree with given mail account _id and _type case 'mail-account': // update tree with given mail account _id and _type
var tree = this.et2 ? this.et2.getWidgetById(this.nm_index+'[foldertree]') : null; var tree = this.et2 ? this.et2.getWidgetById(this.nm_index+'[foldertree]') : null;
if (!tree) break; if (!tree) break;
var node = tree.getNode(_id); var node = tree.getNode(_id);