Mail folder management dialog:

- Fix folder refresh on both index and folderMgmt trees
This commit is contained in:
Hadi Nategh 2015-08-13 10:29:51 +00:00
parent 40e0a2b705
commit fb6d06e322
2 changed files with 13 additions and 12 deletions

View File

@ -4641,13 +4641,14 @@ class mail_ui
{
$success = $this->ajax_deleteFolder($_folderName,true);
$response = egw_json_response::get();
list(,$folderName) = explode(self::$delimiter, $_folderName);
if ($success)
{
$res = $_folderName;
$res = $folderName;
}
else
{
$res = lang("Failed to delete %1",$_folderName);
$res = lang("Failed to delete %1",$folderName);
}
$response->data($res);
}

View File

@ -4963,12 +4963,10 @@ app.classes.mail = AppJS.extend(
* Detele button handler
* triggers longTask dialog and send delete operation url
*
* @param {egw object} _egw egw object
* @param {widget object} _widget button widget
*/
folderMgmt_deleteBtn: function (_egw, _widget)
folderMgmt_deleteBtn: function ()
{
var tree = this.et2.getWidgetById('tree');
var tree = etemplate2.getByApplication('mail')[0].widgetContainer.getWidgetById('tree');
var menuaction= 'mail.mail_ui.ajax_folderMgmt_delete';
if (tree)
@ -4983,14 +4981,16 @@ app.classes.mail = AppJS.extend(
if (_val && _resp.type !== 'error')
{
var stat = [];
var tree = etemplate2.getByApplication('mail')[0].widgetContainer.getWidgetById('tree');
// delete the item in folderMgmt dialog
if (tree) tree.deleteItem(_resp, false);
stat[_resp] = _resp;
var folderName = '';
for(var i=0;i<selFldArr.length;i++)
{
folderName = selFldArr[i].split('::');
stat[selFldArr[i]] = folderName[1];
}
// delete the item from index folderTree
egw.window.app.mail.mail_removeLeaf(stat);
// submit
etemplate2.getByApplication('mail')[0].widgetContainer._inst.submit();
}
}, msg, 'Deleting folders', menuaction, selFldArr, 'mail');
return true;