(js) Compose mail from attendee's email addresses
parent
b71fb2e525
commit
5ab405efcc
1
NEWS
1
NEWS
|
@ -7,6 +7,7 @@ Enhancements
|
|||
- [web] collapsable mail accounts (#3493)
|
||||
- [web] show progress indicator when loading messages and cards
|
||||
- [web] display messages sizes in list of Mail module
|
||||
- [web] link event's attendees email addresses to mail composer
|
||||
|
||||
Bug fixes
|
||||
- [web] fixed creation of chip on blur (sgTransformOnBlur directive)
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
<md-icon ng-repeat="i in ::editor.component.priority | range">star</md-icon>
|
||||
</div>
|
||||
<md-menu>
|
||||
<md-button label:aria-label="More options" class="sg-icon-button" ng-click="$mdOpenMenu($event)">
|
||||
<md-button label:aria-label="More options" class="md-icon-button" ng-click="$mdOpenMenu($event)">
|
||||
<md-icon>more_vert</md-icon>
|
||||
</md-button>
|
||||
<md-menu-content>
|
||||
|
@ -65,6 +65,11 @@
|
|||
</md-menu-item>
|
||||
</md-menu-content>
|
||||
</md-menu>
|
||||
<md-button class="md-icon-button"
|
||||
ng-show="editor.component.attendees.length > 0"
|
||||
ng-click="editor.newMessageWithAllRecipients($event)">
|
||||
<md-icon label:aria-label="Email Attendees">mail</md-icon>
|
||||
</md-button>
|
||||
<md-button class="md-icon-button" ng-click="editor.close()">
|
||||
<md-icon label:aria-label="Close">close</md-icon>
|
||||
</md-button>
|
||||
|
@ -150,7 +155,11 @@
|
|||
<div class="md-contact-avatar">
|
||||
<sg-avatar-image sg-email="$chip.email" size="32"><!-- avatar --></sg-avatar-image>
|
||||
</div>
|
||||
<div class="md-contact-name">{{$chip.name}}</div>
|
||||
<div class="md-contact-name">
|
||||
<a href="#"
|
||||
label:aria-label="Email Organizer"
|
||||
ng-click="editor.newMessageWithRecipient($event, $chip.name, $chip.email)">{{$chip.name}}</a>
|
||||
</div>
|
||||
</md-chip-template>
|
||||
</md-chips>
|
||||
</div>
|
||||
|
@ -166,7 +175,10 @@
|
|||
<div class="md-contact-avatar">
|
||||
<sg-avatar-image sg-email="$chip.email" size="32"><!-- avatar --></sg-avatar-image>
|
||||
</div>
|
||||
<div class="md-contact-name">{{$chip.name}}</div>
|
||||
<div class="md-contact-name">
|
||||
<a href="#"
|
||||
ng-click="editor.newMessageWithRecipient($event, $chip.name, $chip.email)">{{$chip.name}}</a>
|
||||
</div>
|
||||
<md-icon ng-class="'icon-' + $chip.status"><!-- partstat --></md-icon>
|
||||
</md-chip-template>
|
||||
</md-chips>
|
||||
|
|
|
@ -432,8 +432,8 @@
|
|||
|
||||
/**
|
||||
* @function $reset
|
||||
* @memberof Mailbox.prototype
|
||||
* @desc Reset the original state the mailbox's data.
|
||||
* @memberof Calendar.prototype
|
||||
* @desc Reset the original state the calendar's data.
|
||||
*/
|
||||
Calendar.prototype.$reset = function() {
|
||||
var _this = this;
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
/**
|
||||
* @ngInject
|
||||
*/
|
||||
ComponentController.$inject = ['$rootScope', '$mdDialog', 'Calendar', 'Component', 'AddressBook', 'Alarm', 'stateComponent'];
|
||||
function ComponentController($rootScope, $mdDialog, Calendar, Component, AddressBook, Alarm, stateComponent) {
|
||||
ComponentController.$inject = ['$rootScope', '$mdDialog', 'Calendar', 'Component', 'AddressBook', 'Alarm', 'Account', 'stateComponent'];
|
||||
function ComponentController($rootScope, $mdDialog, Calendar, Component, AddressBook, Alarm, Account, stateComponent) {
|
||||
var vm = this, component;
|
||||
|
||||
vm.calendarService = Calendar;
|
||||
|
@ -15,6 +15,8 @@
|
|||
vm.component = stateComponent;
|
||||
vm.close = close;
|
||||
vm.cardFilter = cardFilter;
|
||||
vm.newMessageWithAllRecipients = newMessageWithAllRecipients;
|
||||
vm.newMessageWithRecipient = newMessageWithRecipient;
|
||||
vm.edit = edit;
|
||||
vm.editAllOccurrences = editAllOccurrences;
|
||||
vm.reply = reply;
|
||||
|
@ -44,6 +46,50 @@
|
|||
return AddressBook.$cards;
|
||||
}
|
||||
|
||||
function newMessageWithAllRecipients($event) {
|
||||
var recipients = _.map(vm.component.attendees, function(attendee) {
|
||||
return attendee.name + " <" + attendee.email + ">";
|
||||
});
|
||||
_newMessage($event, recipients);
|
||||
}
|
||||
|
||||
function newMessageWithRecipient($event, name, email) {
|
||||
_newMessage($event, [name + " <" + email + ">"]);
|
||||
}
|
||||
|
||||
function _newMessage($event, recipients) {
|
||||
Account.$findAll().then(function(accounts) {
|
||||
var account = _.find(accounts, function(o) {
|
||||
if (o.id === 0)
|
||||
return o;
|
||||
});
|
||||
|
||||
// We must initialize the Account with its mailbox
|
||||
// list before proceeding with message's creation
|
||||
account.$getMailboxes().then(function(mailboxes) {
|
||||
account.$newMessage().then(function(message) {
|
||||
angular.extend(message.editable, { to: recipients, subject: vm.component.summary });
|
||||
$mdDialog.show({
|
||||
parent: angular.element(document.body),
|
||||
targetEvent: $event,
|
||||
clickOutsideToClose: false,
|
||||
escapeToClose: false,
|
||||
templateUrl: '../Mail/UIxMailEditor',
|
||||
controller: 'MessageEditorController',
|
||||
controllerAs: 'editor',
|
||||
locals: {
|
||||
stateAccount: account,
|
||||
stateMessage: message
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
$event.preventDefault();
|
||||
$event.stopPropagation();
|
||||
}
|
||||
|
||||
function edit() {
|
||||
var type = (vm.component.component == 'vevent')? 'Appointment':'Task';
|
||||
$mdDialog.hide().then(function() {
|
||||
|
|
Loading…
Reference in New Issue