email: show plain

This commit is contained in:
yuri
2015-04-22 16:26:30 +03:00
parent 99edab675a
commit 2e85e7fc56
3 changed files with 67 additions and 2 deletions
@@ -44,7 +44,8 @@
"Mark Read": "Mark Read",
"Sending...": "Sending...",
"Save Draft": "Save Draft",
"Mark all as read": "Mark all as read"
"Mark all as read": "Mark all as read",
"Show Plain Text": "Show Plain Text"
},
"messages": {
"noSmtpSetup": "No SMTP setup. {link}.",
+16 -1
View File
@@ -47,7 +47,7 @@ Espo.define('Views.Email.Detail', ['Views.Detail', 'EmailHelper'], function (Dep
acl: 'edit',
aclScope: 'Lead'
});
this.menu.dropdown.push({
this.menu.dropdown.push({
label: 'Create Contact',
action: 'createContact',
acl: 'edit',
@@ -55,6 +55,21 @@ Espo.define('Views.Email.Detail', ['Views.Detail', 'EmailHelper'], function (Dep
}); }
}
}
if (this.model.get('isHtml') && this.model.get('bodyPlain')) {
this.menu.dropdown.push({
label: 'Show Plain Text',
action: 'showBodyPlain'
});
}
},
actionShowBodyPlain: function () {
this.createView('bodyPlain', 'Email.Modals.BodyPlain', {
model: this.model
}, function (view) {
view.render();
}.bind(this));
},
actionCreateLead: function () {
@@ -0,0 +1,49 @@
/************************************************************************
* This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: http://www.espocrm.com
*
* EspoCRM is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* EspoCRM is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with EspoCRM. If not, see http://www.gnu.org/licenses/.
************************************************************************/
Espo.define('Views.Email.Modals.BodyPlain', 'Views.Modal', function (Dep) {
return Dep.extend({
_template: '<div class="field-bodyPlain">{{{bodyPlain}}}</div>',
setup: function () {
Dep.prototype.setup.call(this);
this.buttonList.push({
'name': 'cancel',
'label': 'Close'
});
this.header = this.model.get('name');
this.createView('bodyPlain', 'Fields.Text', {
el: this.options.el + ' .field-bodyPlain',
model: this.model,
defs: {
name: 'bodyPlain',
readOnly: true
}
});
}
});
});