mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-02-05 04:50:13 +01:00
enable/disable Sieve and ACL actions on tree account-specific, also added a couple more icons to tree icons
This commit is contained in:
parent
ccdb54a366
commit
7a305bdf95
@ -617,25 +617,30 @@ class mail_ui
|
|||||||
'sieve' => array(
|
'sieve' => array(
|
||||||
'caption' => 'Mail filter',
|
'caption' => 'Mail filter',
|
||||||
'onExecute' => 'javaScript:app.mail.edit_sieve',
|
'onExecute' => 'javaScript:app.mail.edit_sieve',
|
||||||
'group' => $group++,
|
'group' => ++$group, // new group for filter
|
||||||
|
'enabled' => 'javaScript:app.mail.sieve_enabled',
|
||||||
|
'icon' => 'etemplate/fav_filter', // funnel
|
||||||
),
|
),
|
||||||
'vacation' => array(
|
'vacation' => array(
|
||||||
'caption' => 'Vacation notice',
|
'caption' => 'Vacation notice',
|
||||||
'icon' => 'configure',
|
'icon' => 'mail/navbar', // mail as in admin
|
||||||
'onExecute' => 'javaScript:app.mail.edit_vacation',
|
'onExecute' => 'javaScript:app.mail.edit_vacation',
|
||||||
'group' => $group++,
|
'group' => $group,
|
||||||
|
'enabled' => 'javaScript:app.mail.sieve_enabled',
|
||||||
),
|
),
|
||||||
'edit_account' => array(
|
'edit_account' => array(
|
||||||
'caption' => 'Edit account ...',
|
'caption' => 'Edit account ...',
|
||||||
'icon' => 'configure',
|
'icon' => 'configure',
|
||||||
'onExecute' => 'javaScript:app.mail.edit_account',
|
'onExecute' => 'javaScript:app.mail.edit_account',
|
||||||
//'enableId' => '^\\d+$', // only show action on account itself
|
//'enableId' => '^\\d+$', // only show action on account itself
|
||||||
|
'group' => ++$group, // new groups for account & acl
|
||||||
),
|
),
|
||||||
'edit_acl' => array(
|
'edit_acl' => array(
|
||||||
'caption' => 'Edit folder ACL ...',
|
'caption' => 'Edit folder ACL ...',
|
||||||
'icon' => 'blocks',
|
'icon' => 'lock',
|
||||||
'enabled' => 'javaScript:app.mail.mail_CheckFolderNoSelect',
|
'enabled' => 'javaScript:app.mail.acl_enabled',
|
||||||
'onExecute' => 'javaScript:app.mail.edit_acl',
|
'onExecute' => 'javaScript:app.mail.edit_acl',
|
||||||
|
'group' => $group,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
// the preference prefaskformove controls actually if there is a popup on target or not
|
// the preference prefaskformove controls actually if there is a popup on target or not
|
||||||
@ -663,36 +668,39 @@ class mail_ui
|
|||||||
unset($tree_actions['subscribe']);
|
unset($tree_actions['subscribe']);
|
||||||
unset($tree_actions['unsubscribe']);
|
unset($tree_actions['unsubscribe']);
|
||||||
}
|
}
|
||||||
$deleteOptions = $GLOBALS['egw_info']['user']['preferences']['mail']['deleteOptions'];
|
++$group; // put delete in own group
|
||||||
if($deleteOptions == 'move_to_trash')
|
switch($GLOBALS['egw_info']['user']['preferences']['mail']['deleteOptions'])
|
||||||
{
|
{
|
||||||
$tree_actions['empty_trash'] = array(
|
case 'move_to_trash':
|
||||||
'caption' => 'empty trash',
|
$tree_actions['empty_trash'] = array(
|
||||||
'icon' => 'dhtmlxtree/MailFolderTrash',
|
'caption' => 'empty trash',
|
||||||
'onExecute' => 'javaScript:app.mail.mail_emptyTrash',
|
'icon' => 'dhtmlxtree/MailFolderTrash',
|
||||||
//'enableId' => '^\\d+$', // only show action on account itself
|
'onExecute' => 'javaScript:app.mail.mail_emptyTrash',
|
||||||
);
|
//'enableId' => '^\\d+$', // only show action on account itself
|
||||||
}
|
'group' => $group,
|
||||||
if($preferences['deleteOptions'] == 'mark_as_deleted')
|
);
|
||||||
{
|
break;
|
||||||
$tree_actions['compress_folder'] = array(
|
case 'mark_as_deleted':
|
||||||
'caption' => 'compress folder',
|
$tree_actions['compress_folder'] = array(
|
||||||
'icon' => 'dhtmlxtree/MailFolderTrash',
|
'caption' => 'compress folder',
|
||||||
'onExecute' => 'javaScript:app.mail.mail_compressFolder',
|
'icon' => 'dhtmlxtree/MailFolderTrash',
|
||||||
//'enableId' => '^\\d+$', // only show action on account itself
|
'onExecute' => 'javaScript:app.mail.mail_compressFolder',
|
||||||
);
|
//'enableId' => '^\\d+$', // only show action on account itself
|
||||||
|
'group' => $group,
|
||||||
|
);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// enforce global (group-specific) ACL
|
// enforce global (group-specific) ACL
|
||||||
if (!$this->mail_bo->icServer->queryCapability('ACL') || !mail_hooks::access('aclmanagement'))
|
if (!mail_hooks::access('aclmanagement'))
|
||||||
{
|
{
|
||||||
unset($tree_actions['edit_acl']);
|
unset($tree_actions['edit_acl']);
|
||||||
}
|
}
|
||||||
if (!$this->mail_bo->icServer->acc_sieve_enabled || !mail_hooks::access('editfilterrules'))
|
if (!mail_hooks::access('editfilterrules'))
|
||||||
{
|
{
|
||||||
unset($tree_actions['sieve']);
|
unset($tree_actions['sieve']);
|
||||||
}
|
}
|
||||||
if (!$this->mail_bo->icServer->acc_sieve_enabled || !mail_hooks::access('absentnotice'))
|
if (!mail_hooks::access('absentnotice'))
|
||||||
{
|
{
|
||||||
unset($tree_actions['vacation']);
|
unset($tree_actions['vacation']);
|
||||||
}
|
}
|
||||||
@ -885,7 +893,9 @@ class mail_ui
|
|||||||
'im2' => 'thunderbird.png',
|
'im2' => 'thunderbird.png',
|
||||||
'path'=> array($acc_id),
|
'path'=> array($acc_id),
|
||||||
'child'=> (int)($acc_id != $_profileID || $folderObjects), // dynamic loading on unfold
|
'child'=> (int)($acc_id != $_profileID || $folderObjects), // dynamic loading on unfold
|
||||||
'parent' => ''
|
'parent' => '',
|
||||||
|
// mark on account if Sieve is enabled
|
||||||
|
'data' => array('sieve' => $accountObj->acc_sieve_enabled),
|
||||||
);
|
);
|
||||||
$this->setOutStructure($oA, $out, self::$delimiter);
|
$this->setOutStructure($oA, $out, self::$delimiter);
|
||||||
|
|
||||||
@ -946,6 +956,8 @@ class mail_ui
|
|||||||
if ($path=='INBOX')
|
if ($path=='INBOX')
|
||||||
{
|
{
|
||||||
$oA['im0'] = $oA['im1']= $oA['im2'] = "kfm_home.png";
|
$oA['im0'] = $oA['im1']= $oA['im2'] = "kfm_home.png";
|
||||||
|
// mark on inbox if ACL is supported
|
||||||
|
$oA['data'] = array('acl' => $this->mail_bo->icServer->queryCapability('ACL'));
|
||||||
}
|
}
|
||||||
elseif (in_array($obj->shortFolderName,mail_bo::$autoFolders))
|
elseif (in_array($obj->shortFolderName,mail_bo::$autoFolders))
|
||||||
{
|
{
|
||||||
|
@ -1003,6 +1003,43 @@ app.classes.mail = AppJS.extend(
|
|||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if Sieve is enabled on that account
|
||||||
|
*
|
||||||
|
* Sieve enabled is stored as data { acl: true/false } on account node.
|
||||||
|
*
|
||||||
|
* @param {object} _action
|
||||||
|
* @param {object} _senders the representation of the tree leaf to be manipulated
|
||||||
|
* @param {object} _currentNode
|
||||||
|
*/
|
||||||
|
sieve_enabled: function(_action,_senders,_currentNode)
|
||||||
|
{
|
||||||
|
var ftree = this.et2.getWidgetById(this.nm_index+'[foldertree]');
|
||||||
|
var acc_id = _senders[0].id.split('::')[0];
|
||||||
|
var node = ftree ? ftree.getNode(acc_id) : null;
|
||||||
|
|
||||||
|
return node && node.data && node.data.sieve;
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if ACL is enabled on that account
|
||||||
|
*
|
||||||
|
* ACL enabled is stored as data { acl: true/false } on INBOX node.
|
||||||
|
* We also need to check if folder is marked as no-select!
|
||||||
|
*
|
||||||
|
* @param {object} _action
|
||||||
|
* @param {object} _senders the representation of the tree leaf to be manipulated
|
||||||
|
* @param {object} _currentNode
|
||||||
|
*/
|
||||||
|
acl_enabled: function(_action,_senders,_currentNode)
|
||||||
|
{
|
||||||
|
var ftree = this.et2.getWidgetById(this.nm_index+'[foldertree]');
|
||||||
|
var inbox = _senders[0].id.split('::')[0]+'::INBOX';
|
||||||
|
var node = ftree ? ftree.getNode(inbox) : null;
|
||||||
|
|
||||||
|
return node && node.data.acl && this.mail_CheckFolderNoSelect(_action,_senders,_currentNode);
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* mail_setFolderStatus, function to set the status for the visible folders
|
* mail_setFolderStatus, function to set the status for the visible folders
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user