Add sieve rules to mail application

This commit is contained in:
Hadi Nategh 2013-07-25 15:35:44 +00:00
parent 36eae09fe0
commit 3c23bd0dfb
4 changed files with 1302 additions and 98 deletions

View File

@ -689,6 +689,7 @@ class mail_hooks
'admin' => False,
'default'=> 'text',
),
'add_popup' => '600x425',
);
if (!$GLOBALS['egw_info']['apps']['stylite']) unset($settingsArray['attachVCardAtCompose']);
return $settingsArray;
@ -734,7 +735,7 @@ class mail_hooks
$mailPreferences =& $mail_bo->mailPreferences;
$file['Preferences'] = egw::link('/index.php','menuaction=preferences.preferences_settings.index&appname=' . $appname);
/*
if($mailPreferences->userDefinedAccounts) {
$linkData = array
(
@ -751,12 +752,12 @@ class mail_hooks
if($icServer->enableSieve) {
if(empty($mailPreferences->preferences['prefpreventeditfilterrules']) || $mailPreferences->preferences['prefpreventeditfilterrules'] == 0)
$file['filter rules'] = egw::link('/index.php', 'menuaction=mail.uisieve.listRules');
$file['filter rules'] = egw::link('/index.php', 'menuaction=mail.mail_sieve.index');
if(empty($mailPreferences->preferences['prefpreventabsentnotice']) || $mailPreferences->preferences['prefpreventabsentnotice'] == 0)
$file['vacation notice'] = egw::link('/index.php','menuaction=mail.uisieve.editVacation');
$file['vacation notice'] = egw::link('/index.php','menuaction=mail.mail_sieve.editVacation');
}
}
*/
//Do not modify below this line
display_section($appname,$title,$file);
}
@ -878,7 +879,7 @@ class mail_hooks
*/
display_sidebox($appname,$menu_title,$file);
unset($file);
/*
$menu_title = lang('Sieve');
if (is_object($preferences)) $icServer = $preferences->getIncomingServer($profileID);
if(($icServer instanceof defaultimap)) {
@ -886,14 +887,14 @@ class mail_hooks
{
$linkData = array
(
'menuaction' => 'mail.uisieve.listRules',
'menuaction' => 'mail.mail_sieve.index',
);
if(empty($preferences->preferences['prefpreventeditfilterrules']) || $preferences->preferences['prefpreventeditfilterrules'] == 0)
$file['filter rules'] = egw::link('/index.php',$linkData);
$linkData = array
(
'menuaction' => 'mail.uisieve.editVacation',
'menuaction' => 'mail.mail_sieve.editVacation',
);
if(empty($preferences->preferences['prefpreventabsentnotice']) || $preferences->preferences['prefpreventabsentnotice'] == 0)
{
@ -902,13 +903,13 @@ class mail_hooks
if((empty($preferences->preferences['prefpreventnotificationformailviaemail']) ||
$preferences->preferences['prefpreventnotificationformailviaemail'] == 0))
{
$file['email notification'] = egw::link('/index.php','menuaction=mail.uisieve.editEmailNotification'); //Added email notifications
$file['email notification'] = egw::link('/index.php','menuaction=mail.mail_sieve.editEmailNotification'); //Added email notifications
}
if (count($file)) display_sidebox($appname,$menu_title,$file);
unset($file);
}
}
*/
}
if ($GLOBALS['egw_info']['user']['apps']['admin'])

View File

@ -1130,5 +1130,80 @@ app.mail = AppJS.extend(
var request = new egw_json_request('mail.mail_ui.ajax_deleteFolder',[_senders[0].iface.id]);
request.sendRequest(true);
}
},
/**
* action - handling actions on sieve rules
*
* @param _type - action name
* @param _selected - selected row from the sieve rule list
* @param _msg - messages
*/
action: function(_type, _selected)
{
var actionData ;
var that = this;
var typeId = _type.id;
var ruleID = ((_selected[0].id.split("_").pop()) - 1); // subtract the row id from 1 because the first row id is reserved by grid header
if (_type)
{
switch (_type.id)
{
case 'delete':
var callbackDeleteDialog = function (button_id)
{
if (button_id == et2_dialog.YES_BUTTON )
{
actionData = _type.parent.data.widget.getArrayMgr('content');
that._do_action(typeId, actionData['data'],ruleID);
}
}
var confirmDeleteDialog = et2_dialog.show_dialog(callbackDeleteDialog, egw.lang("Do you really want to DELETE this Rule"),egw.lang("Delete"), {},et2_dialog.BUTTONS_YES_NO_CANCEL, et2_dialog.WARNING_MESSAGE);
break;
case 'add' :
$linkData = "mail.mail_sieve.edit";
egw.open_link($linkData,'',"600x480");
break;
case 'edit' :
$linkData = "mail.mail_sieve.edit&ruleID="+ruleID;
egw.open_link($linkData,'',"600x480");
break;
case 'enable':
actionData = _type.parent.data.widget.getArrayMgr('content');
this._do_action(typeId,actionData['data'],ruleID);
//window.egw_refresh('refreshed',this.appname);
break;
case 'disable':
actionData = _type.parent.data.widget.getArrayMgr('content');
this._do_action(typeId,actionData['data'],ruleID);
break;
}
}
},
_do_action: function(_typeID, _data,_selectedID)
{
if (_typeID && _data)
{
var request = new egw_json_request('mail.mail_sieve.ajax_action', [_typeID,_selectedID]);
console.log(request);
request.sendRequest(true,this._callback_do_action,this);
}
},
sieve_refresh: function (_rows,_msg)
{
var grid = this.et2.getWidgetById('rg');
window.egw_refresh(_msg,this.appname);
if (grid)
{
grid.set_value(_rows);
}
},
});

1125
mail/js/app.js.mine Normal file

File diff suppressed because it is too large Load Diff

View File

@ -5,6 +5,7 @@
(separate multiple addresses by comma) mail en Separate multiple addresses by comma
(unknown sender) mail en Unknown sender
(with checkbox enforced) mail en with checkbox enforced
... mail en ...
1) keep drafted message (press ok) mail en 1) keep drafted message (press OK)
2) discard the message completely (press cancel) mail en 2) discard the message completely (press Cancel)
aborted mail en Aborted
@ -43,6 +44,7 @@ attach mail en Attach
attach users vcard at compose to every new mail mail en Attach user's VCard at compose to every new mail
attach vcard mail en Attach vCard
attachments mail en Attachments
attachments, ... mail en attachments, ...
authentication required mail en Authentication required
auto refresh folder list mail en Auto refresh folder list
available personal email-accounts/profiles mail en available personal EMail-Accounts/Profiles
@ -267,8 +269,10 @@ how often to check with the server for new mail mail en How often to check with
how should the available information on identities be displayed mail en How should the available information on identities be displayed
how to forward messages mail en How to forward messages
html mail en HTML
icons mail en Icons
icons and text mail en Icons and text
icons only mail en Icons only
id mail en ID
identifying name mail en Identifying name
identity mail en Identity
if mail en IF
@ -476,6 +480,7 @@ return to options page mail en Return to options page
right mail en Right
row order style mail en Row order style
rule mail en Rule
rule lists mail en Rule Lists
save mail en Save
save all mail en Save all
save as mail en Save as
@ -536,6 +541,7 @@ skipping previous mail en Skipping previous
small view mail en Small view
smtp settings admin en SMTP settings
sort order mail en Sort order
st. mail en St.
start new messages with mime type plain/text or html? mail en Start new messages with mime type plain/text or HTML?
start reply messages with mime type plain/text or html or try to use the displayed format (default)? mail en Start reply messages with mime type plain/text or html or try to use the displayed format?
stationery mail en Stationery
@ -572,7 +578,6 @@ to mail en To
to do mail en to do
to mail sent to mail en To mail sent to
to use a tls connection, you must be running a version of php 5.1.0 or higher. mail en To use a TLS connection, you must be running a version of PHP 5.1.0 or higher.
turn off horizontal line between signature and composed message (this is not according to RFC).\nIf you use templates, this option is only applied to the text part of the message. mail en Turn off horizontal line between signature and composed message (this is not according to RFC).\nIf you use templates, this option is only applied to the text part of the message.
translation preferences mail en Translation preferences
translation server mail en Translation server
trash mail en Trash
@ -581,6 +586,7 @@ trash folder mail en Trash folder
trust servers seen / unseen info mail en Trust server's SEEN / UNSEEN info
trust the server when retrieving the folder status. if you select no, we will search for the unseen messages and count them ourselves mail en Trust the server when retrieving the folder status. if you select no, we will search for the UNSEEN messages and count them ourselves
trying to recover from session data mail en Trying to recover from session data
turn off horizontal line between signature and composed message (this is not according to rfc).\nif you use templates, this option is only applied to the text part of the message. mail en Turn off horizontal line between signature and composed message (this is not according to RFC).\nIf you use templates, this option is only applied to the text part of the message.
type mail en Type
undelete mail en Undelete
unexpected response from server to authenticate command. mail en Unexpected response from server to AUTHENTICATE command.
@ -631,9 +637,6 @@ what to do when you delete a message mail en What to do when you delete a messag
what to do when you send a message mail en What to do when you send a message
what to do with html email mail en What to do with HTML email
when deleting messages mail en When deleting messages
when displaying messages in a popup, re-use the same popup for all or open a new popup for each
message mail en When displaying messages in a popup, re-use the same popup for all or open a new popup for each
message
when saving messages as item of a different app mail en When saving messages as item of a different app
when sending messages mail en When sending messages
which folders (additional to the sent folder) should be displayed using the sent folder view schema mail en Which folders in addition to the Sent folder should be displayed using the Sent Folder View Schema