mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-04-18 19:48:53 +00:00
Merge pull request #232 from rfrei/patch-1
Allow write to multiple contacts using 'to', 'cc' or 'bcc'. Fixes #3548.
This commit is contained in:
@@ -41,6 +41,9 @@
|
||||
"Move To" = "Move To";
|
||||
"Copy To" = "Copy To";
|
||||
"Add to" = "Add to";
|
||||
"To" = "To";
|
||||
"Carbon Copy (Cc)" = "Carbon Copy (Cc)";
|
||||
"Blind Carbon Copy (Bcc)" = "Blind Carbon Copy (Bcc)";
|
||||
|
||||
/* Subheader of empty addressbook */
|
||||
"No contact" = "No contact";
|
||||
@@ -258,4 +261,4 @@
|
||||
"key_create_card" = "c";
|
||||
|
||||
/* Hotkey to create a new list */
|
||||
"key_create_list" = "l";
|
||||
"key_create_list" = "l";
|
||||
|
||||
@@ -364,10 +364,29 @@
|
||||
</md-button>
|
||||
<md-menu-content width="3">
|
||||
<md-menu-item>
|
||||
<md-button ng-click="addressbook.newMessageWithSelectedCards($event)">
|
||||
<var:string label:value="Write"/>
|
||||
</md-button>
|
||||
</md-menu-item>
|
||||
<md-menu>
|
||||
<md-button label:aria-label="Write" ng-click="$mdMenu.open($event)">
|
||||
<var:string label:value="Write"/>
|
||||
</md-button>
|
||||
<md-menu-content class="md-dense" width="3">
|
||||
<md-menu-item>
|
||||
<md-button ng-click="addressbook.newMessageWithSelectedCards($event, 'to')">
|
||||
<var:string label:value="To"/>
|
||||
</md-button>
|
||||
</md-menu-item>
|
||||
<md-menu-item>
|
||||
<md-button ng-click="addressbook.newMessageWithSelectedCards($event, 'cc')">
|
||||
<var:string label:value="Carbon Copy (Cc)"/>
|
||||
</md-button>
|
||||
</md-menu-item>
|
||||
<md-menu-item>
|
||||
<md-button ng-click="addressbook.newMessageWithSelectedCards($event, 'bcc')">
|
||||
<var:string label:value="Blind Carbon Copy (Bcc)"/>
|
||||
</md-button>
|
||||
</md-menu-item>
|
||||
</md-menu-content>
|
||||
</md-menu>
|
||||
</md-menu-item>
|
||||
<md-menu-item ng-hide="addressbook.selectedFolder.isRemote">
|
||||
<md-button ng-click="addressbook.selectedFolder.exportCards(true)">
|
||||
<var:string label:value="Export"/>
|
||||
|
||||
@@ -319,7 +319,7 @@
|
||||
vm.selectedFolder.$filter('');
|
||||
}
|
||||
|
||||
function newMessage($event, recipients) {
|
||||
function newMessage($event, recipients, recipientsField) {
|
||||
Account.$findAll().then(function(accounts) {
|
||||
var account = _.find(accounts, function(o) {
|
||||
if (o.id === 0)
|
||||
@@ -330,7 +330,7 @@
|
||||
// list before proceeding with message's creation
|
||||
account.$getMailboxes().then(function(mailboxes) {
|
||||
account.$newMessage().then(function(message) {
|
||||
angular.extend(message.editable, { to: recipients });
|
||||
message.editable[recipientsField] = recipients;
|
||||
$mdDialog.show({
|
||||
parent: angular.element(document.body),
|
||||
targetEvent: $event,
|
||||
@@ -351,12 +351,12 @@
|
||||
|
||||
function newMessageWithRecipient($event, recipient, fn) {
|
||||
var recipients = [fn + ' <' + recipient + '>'];
|
||||
vm.newMessage($event, recipients);
|
||||
vm.newMessage($event, recipients, 'to');
|
||||
$event.stopPropagation();
|
||||
$event.preventDefault();
|
||||
}
|
||||
|
||||
function newMessageWithSelectedCards($event) {
|
||||
function newMessageWithSelectedCards($event, recipientsField) {
|
||||
var selectedCards = _.filter(vm.selectedFolder.$cards, function(card) { return card.selected; });
|
||||
var promises = [], recipients = [];
|
||||
|
||||
@@ -386,7 +386,7 @@
|
||||
$q.all(promises).then(function() {
|
||||
recipients = _.uniq(recipients);
|
||||
if (recipients.length)
|
||||
vm.newMessage($event, recipients);
|
||||
vm.newMessage($event, recipients, recipientsField);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user