diff --git a/mail/inc/class.mail_ui.inc.php b/mail/inc/class.mail_ui.inc.php index 3c7e5ac7df..c5e735dcd7 100644 --- a/mail/inc/class.mail_ui.inc.php +++ b/mail/inc/class.mail_ui.inc.php @@ -689,6 +689,12 @@ class mail_ui 'group' => $group, 'hideOnMobile' => true ), + 'predefined-addresses' => array( + 'caption' => 'Set predefined addresses for compose...', + 'onExecute' => 'javaScript:app.mail.set_predefined_addresses', + 'icon' => 'edit', + 'group' => $group, + ), 'sieve' => array( 'caption' => 'Mail filter', 'onExecute' => 'javaScript:app.mail.edit_sieve', diff --git a/mail/js/app.js b/mail/js/app.js index 2f363f12a9..9269e47dd0 100644 --- a/mail/js/app.js +++ b/mail/js/app.js @@ -240,6 +240,11 @@ app.classes.mail = AppJS.extend( var plainText = this.et2.getWidgetById('mail_plaintext'); var textAreaWidget = this.et2.getWidgetById('mail_htmltext'); this.mail_isMainWindow = false; + var pca = egw.preference(this.et2.getWidgetById('mailaccount').getValue().split(":")[0]+'_predefined_compose_addresses', 'mail'); + for (var p in pca) + { + this.et2.getWidgetById(p).set_value(pca[p]); + } this.compose_fieldExpander_init(); this.check_sharing_filemode(); @@ -6231,5 +6236,41 @@ app.classes.mail = AppJS.extend( } } } + }, + + /** + * Set predefined addresses for compose dialog + * + * @param {type} action + * @param {type} _senders + * @returns {undefined} + */ + set_predefined_addresses: function(action,_senders) + { + var buttons = [ + {text: this.egw.lang("Save"), id: "save", "class": "ui-priority-primary", "default": true}, + {text: this.egw.lang("Cancel"), id:"cancel"} + ]; + var pref_id = _senders[0].id.split('::')[0]+'_predefined_compose_addresses'; + var prefs = egw.preference(pref_id, 'mail'); + + et2_createWidget("dialog", + { + callback: function(_button_id, _value) { + switch (_button_id) + { + case "save": + egw.set_preference('mail', pref_id, _value); + return; + case "cancel": + } + }, + title: this.egw.lang("Predefined addresses for compose"), + buttons: buttons, + value:{content:prefs}, + minWidth: 410, + template: egw.webserverUrl+'/mail/templates/default/predefinedAddressesDialog.xet?', + resizable: false, + }, et2_dialog._create_parent('mail')); } }); diff --git a/mail/templates/default/predefinedAddressesDialog.xet b/mail/templates/default/predefinedAddressesDialog.xet new file mode 100644 index 0000000000..40d2cf0775 --- /dev/null +++ b/mail/templates/default/predefinedAddressesDialog.xet @@ -0,0 +1,28 @@ + + + + + +