diff --git a/application/Espo/Resources/i18n/en_US/Email.json b/application/Espo/Resources/i18n/en_US/Email.json index 9dff1ac1a3..2e349a92d0 100644 --- a/application/Espo/Resources/i18n/en_US/Email.json +++ b/application/Espo/Resources/i18n/en_US/Email.json @@ -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}.", diff --git a/frontend/client/src/views/email/detail.js b/frontend/client/src/views/email/detail.js index c0289a7863..d20d9f02de 100644 --- a/frontend/client/src/views/email/detail.js +++ b/frontend/client/src/views/email/detail.js @@ -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 () { diff --git a/frontend/client/src/views/email/modals/body-plain.js b/frontend/client/src/views/email/modals/body-plain.js new file mode 100644 index 0000000000..9b73f3ad97 --- /dev/null +++ b/frontend/client/src/views/email/modals/body-plain.js @@ -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: '