Skip to content
This repository has been archived by the owner on Dec 27, 2023. It is now read-only.

Commit

Permalink
Merge branch 'pu/ccheng/2022.11/fix_attendee_grid_ctxmenu' into '2022…
Browse files Browse the repository at this point in the history
….11'

fix(Calendar/js): init message recipient from attender record

See merge request tine20/tine20!3452
  • Loading branch information
sstamer committed Feb 15, 2023
2 parents 10097a8 + 56feb07 commit 3304652
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions tine20/Calendar/js/AttendeeGridPanel.js
Expand Up @@ -567,7 +567,7 @@ Tine.Calendar.AttendeeGridPanel = Ext.extend(Ext.grid.EditorGridPanel, {
locationRecordField.setValue(attender?.data?.user_id);
}
}, '-'];

//TODO: use grid panel hook ?
var felamimailApp = Tine.Tinebase.appMgr.get('Felamimail');
if (felamimailApp && attender.get('user_type') == 'user') {
Tine.log.debug('Adding email compose hook for attender');
Expand All @@ -576,14 +576,12 @@ Tine.Calendar.AttendeeGridPanel = Ext.extend(Ext.grid.EditorGridPanel, {
iconCls: felamimailApp.getIconCls(),
disabled: false,
scope: this,
handler: function() {
var _ = window.lodash;
var email = Tine.Felamimail.getEmailStringFromContact(new Tine.Addressbook.Model.Contact(attender.get('user_id')));
var record = new Tine.Felamimail.Model.Message({
subject: _.get(this.record, 'data.poll.name', _.get(this.record, 'data.summary', '') , ''),
handler: async() => {
const record = new Tine.Felamimail.Model.Message({
subject: _.get(this.record, 'data.poll.name', _.get(this.record, 'data.summary', ''), ''),
body: this.record.hasPoll() ? String.format(this.app.i18n._('Poll URL: {0}'), this.record.getPollUrl()) : '',
massMailingFlag: this.record.hasPoll(),
to: [email]
to: [attender.data.user_id.email]
}, 0);
var popupWindow = Tine.Felamimail.MessageEditDialog.openWindow({
record: record
Expand Down

0 comments on commit 3304652

Please sign in to comment.