Add sieve link to mail tree action menu

This commit is contained in:
Hadi Nategh 2013-12-17 15:21:36 +00:00
parent e10865c133
commit eef0abc590
2 changed files with 19 additions and 4 deletions

View File

@ -345,6 +345,11 @@ class mail_ui
'caption' => 'Delete Folder',
'onExecute' => 'javaScript:app.mail.mail_DeleteFolder'
),
'sieve' => array(
'caption' => 'Mail filter',
'icon' => 'configure',
'onExecute' => 'javaScript:app.mail.edit_sieve',
),
'edit_account' => array(
'caption' => 'Edit account',
'icon' => 'configure',
@ -361,6 +366,9 @@ class mail_ui
if (!$this->mail_bo->icServer->queryCapability('ACL')) unset($tree_actions['edit_acl']);
$etpl->setElementAttribute(self::$nm_index.'[foldertree]','actions', $tree_actions);
if (!$this->mail_bo->icServer->acc_sieve_enabled) unset($tree_actions['sieve']);
$etpl->setElementAttribute(self::$nm_index.'[foldertree]','actions', $tree_actions);
if (empty($content[self::$nm_index]['filter2']) || empty($content[self::$nm_index]['search'])) $content[self::$nm_index]['filter2']='quick';
$readonlys = $preserv = $sel_options;
$endtime = microtime(true) - $starttime;

View File

@ -550,7 +550,7 @@ app.classes.mail = AppJS.extend(
var widget = this.et2.getWidgetById(field.widget);
if(widget == null) continue;
widget.set_disabled(true);
// Remove any existing
var children = widget.getChildren();
for(var i = children.length-1; i >= 0; i--)
@ -1094,7 +1094,7 @@ app.classes.mail = AppJS.extend(
}
myMsg = (displayname?displayname:folder)+' '+this.egw.lang('selected');
if (profileChange == false) egw_message(myMsg);
//mail_refreshMessageGrid();// its done in refreshFolderStatus already
this.mail_refreshFolderStatus(folder,'forced');
this.mail_refreshQuotaDisplay(server[0]);
@ -2221,7 +2221,7 @@ app.classes.mail = AppJS.extend(
var rowId = widget.id.replace(/[^0-9.]+/g, '');
var aclCommonWidget = this.et2.getWidgetById(rowId + '[acl]');
var rights = '';
for (var i=0;i<this.aclRights.length;i++)
{
rightsWidget = this.et2.getWidgetById(rowId+'[acl_' + this.aclRights[i]+ ']');
@ -2244,7 +2244,14 @@ app.classes.mail = AppJS.extend(
aclCommonWidget.set_value(rights);
}
},
/**
*
* @todo get the account id and open the relevant sieve, ATM alway open sieve rules which is set in preferences
*/
edit_sieve: function()
{
this.egw.open_link('mail.mail_sieve.index');
},
/**
* Edit a folder acl for account(s)
*