diff --git a/frontend/client/modules/crm/res/templates/campaign/record/panels/statistics.tpl b/frontend/client/modules/crm/res/templates/campaign/record/panels/statistics.tpl
new file mode 100644
index 0000000000..30d74d2584
--- /dev/null
+++ b/frontend/client/modules/crm/res/templates/campaign/record/panels/statistics.tpl
@@ -0,0 +1 @@
+test
\ No newline at end of file
diff --git a/frontend/client/modules/crm/src/views/campaign-log-record/fields/data.js b/frontend/client/modules/crm/src/views/campaign-log-record/fields/data.js
new file mode 100644
index 0000000000..84dc82b665
--- /dev/null
+++ b/frontend/client/modules/crm/src/views/campaign-log-record/fields/data.js
@@ -0,0 +1,54 @@
+/************************************************************************
+ * 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('Crm:Views.CampaignLogRecord.Fields.Data', 'Views.Fields.Base', function (Dep) {
+
+ return Dep.extend({
+
+ listTemplate: 'crm:campaign-log-record.fields.data.detail',
+
+ getValueForDisplay: function () {
+ var action = this.model.get('action');
+
+ switch (action) {
+ case 'Sent':
+ return this.model.get('stringData');
+ case 'Clicked':
+ return '' + this.model.get('stringData') + '';
+ case 'Opted Out':
+ return '' + this.model.get('stringData') + '';
+ case 'Bounced':
+ var emailAddress = this.model.get('stringData');
+ var type = this.model.get('stringAdditionalData');
+ if (type == 'Hard') {
+ return '' + emailAddress + '';
+ } else {
+ return '' + emailAddress + '';
+ }
+ }
+ return '';
+ }
+
+ });
+});
+
+
diff --git a/frontend/client/modules/crm/src/views/campaign/record/detail-bottom.js b/frontend/client/modules/crm/src/views/campaign/record/detail-bottom.js
new file mode 100644
index 0000000000..8700adcd79
--- /dev/null
+++ b/frontend/client/modules/crm/src/views/campaign/record/detail-bottom.js
@@ -0,0 +1,31 @@
+/************************************************************************
+ * 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('Crm:Views.Campaign.Record.DetailBottom', 'Views.Record.DetailBottom', function (Dep) {
+
+ return Dep.extend({
+
+
+ });
+});
+
+
diff --git a/frontend/client/modules/crm/src/views/campaign/record/detail.js b/frontend/client/modules/crm/src/views/campaign/record/detail.js
new file mode 100644
index 0000000000..bf7dff6fcd
--- /dev/null
+++ b/frontend/client/modules/crm/src/views/campaign/record/detail.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('Crm:Views.Campaign.Record.Detail', 'Views.Record.Detail', function (Dep) {
+
+ return Dep.extend({
+
+ bottomView: 'Crm:Campaign.Record.DetailBottom',
+
+ handleStatisticsPanelAppearance: function() {
+ if (this.model.get('status') == 'Planning') {
+ this.hidePanel('statistics');
+ } else {
+ this.showPanel('statistics');
+ }
+ },
+
+ afterRender: function () {
+ Dep.prototype.afterRender.call(this);
+
+ this.handleStatisticsPanelAppearance();
+ this.listenTo(this.model, 'change:status', function () {
+ this.handleStatisticsPanelAppearance();
+ }, this);
+ },
+
+ });
+});
+
+
diff --git a/frontend/client/modules/crm/src/views/campaign/record/panels/campaign-log-records.js b/frontend/client/modules/crm/src/views/campaign/record/panels/campaign-log-records.js
new file mode 100644
index 0000000000..d07818acf5
--- /dev/null
+++ b/frontend/client/modules/crm/src/views/campaign/record/panels/campaign-log-records.js
@@ -0,0 +1,74 @@
+/************************************************************************
+ * 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('Crm:Views.Campaign.Record.Panels.CampaignLogRecords', 'Views.Record.Panels.Relationship', function (Dep) {
+
+ return Dep.extend({
+
+ template: 'crm:campaign.record.panels.campaign-log-records',
+
+ filterList: ["All", "Sent", "Opened", "Opted Out", "Bounced", "Clicked", "Lead Created"],
+
+ data: function () {
+ return _.extend({
+ filterList: this.filterList,
+ filterValue: this.filterValue,
+ filterTranslatedOptions: this.getFilterTranslatedOptions()
+ }, Dep.prototype.data.call(this));
+ },
+
+ getFilterTranslatedOptions: function () {
+ var o = Espo.Utils.clone(this.getLanguage().get('CampaignLogRecord', 'options', 'action'));
+ o['All'] = this.translate('All', 'labels', 'CampaignLogRecord');
+
+ return o;
+ },
+
+ setup: function () {
+ Dep.prototype.setup.call(this);
+ this.events = Espo.Utils.clone(this.events || {});
+
+ this.events['change select[name="filter"]'] = function (e) {
+ var value = $(e.currentTarget).val();
+ this.setFilter(value);
+ };
+ },
+
+ setFilter: function (value) {
+ this.filterValue = value;
+ if (value && value != 'All') {
+ this.collection.where = [{
+ field: 'action',
+ type: 'equals',
+ value: value
+ }];
+ } else {
+ this.collection.where = [];
+ }
+ this.collection.fetch();
+
+ }
+
+ });
+});
+
+
diff --git a/frontend/client/modules/crm/src/views/campaign/record/panels/statistics.js b/frontend/client/modules/crm/src/views/campaign/record/panels/statistics.js
new file mode 100644
index 0000000000..b990677f19
--- /dev/null
+++ b/frontend/client/modules/crm/src/views/campaign/record/panels/statistics.js
@@ -0,0 +1,69 @@
+/************************************************************************
+ * 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('Crm:Views.Campaign.Record.Panels.Statistics', 'Views.Record.Panels.Side', function (Dep) {
+
+ return Dep.extend({
+
+
+ setupFieldList: function () {
+ var type = this.model.get('type');
+ switch (type) {
+ case 'Email':
+ case 'Newsletter':
+ this.fieldList = ['sentCount', 'openedCount', 'clickedCount', 'optedOutCount', 'bouncedCount', 'revenue'];
+ break;
+ case 'Web':
+ case 'Television':
+ case 'Radio':
+ this.fieldList = ['leadCreatedCount', 'revenue'];
+ break;
+ case 'Mail':
+ this.fieldList = ['sentCount', 'leadCreatedCount', 'revenue'];
+ break;
+ default:
+ this.fieldList = ['leadCreatedCount', 'revenue'];
+ }
+ },
+
+ setup: function () {
+ this.fieldList = ['sentCount', 'openedCount', 'clickedCount', 'optedOutCount', 'bouncedCount', 'leadCreatedCount', 'revenue'];
+ Dep.prototype.setup.call(this);
+ this.setupFieldList();
+
+ this.listenTo(this.model, 'change:type', function () {
+ this.setupFieldList();
+ if (this.isRendered()) {
+ this.render();
+ }
+ }, this);
+ },
+
+ actionRefresh: function () {
+ this.model.fetch();
+ },
+
+
+ });
+});
+
+