This commit is contained in:
yuri
2015-03-05 11:14:02 +02:00
parent a4050b1476
commit 2ff6946b91
3 changed files with 116 additions and 5 deletions

View File

@@ -6,7 +6,16 @@
"type": "Type",
"startDate": "Start Date",
"endDate": "End Date",
"targetLists": "Target Lists"
"targetLists": "Target Lists",
"sentCount": "Sent",
"openedCount": "Opened",
"clickedCount": "Clicked",
"optedOutCount": "Opted Out",
"bouncedCount": "Bounced",
"hardBouncedCount": "Hard Bounced",
"softBouncedCount": "Soft Bounced",
"leadCreatedCount": "Leads Created",
"revenue": "Revenue"
},
"links": {
"targetLists": "Target Lists",
@@ -22,7 +31,8 @@
"Web": "Web",
"Television": "Television",
"Radio": "Radio",
"Newsletter": "Newsletter"
"Newsletter": "Newsletter",
"Mail": "Mail"
},
"status": {
"Planning": "Planning",

View File

@@ -11,7 +11,7 @@
},
"type": {
"type": "enum",
"options": ["Email", "Web", "Television", "Radio", "Newsletter"]
"options": ["Email", "Newsletter", "Web", "Television", "Radio", "Mail"]
},
"startDate": {
"type": "date"
@@ -47,6 +47,78 @@
},
"targetLists": {
"type": "linkMultiple"
},
"sentCount": {
"type": "int",
"notStorable": true,
"readOnly": true,
"layoutDetailDisabled": true,
"layoutListDisabled": true,
"layoutSearchDisabled": true
},
"openedCount": {
"type": "int",
"notStorable": true,
"readOnly": true,
"layoutDetailDisabled": true,
"layoutListDisabled": true,
"layoutSearchDisabled": true
},
"clickedCount": {
"type": "int",
"notStorable": true,
"readOnly": true,
"layoutDetailDisabled": true,
"layoutListDisabled": true,
"layoutSearchDisabled": true
},
"optedOutCount": {
"type": "int",
"notStorable": true,
"readOnly": true,
"layoutDetailDisabled": true,
"layoutListDisabled": true,
"layoutSearchDisabled": true
},
"bouncedCount": {
"type": "int",
"notStorable": true,
"readOnly": true,
"layoutDetailDisabled": true,
"layoutListDisabled": true,
"layoutSearchDisabled": true
},
"hardBouncedCount": {
"type": "int",
"notStorable": true,
"readOnly": true,
"layoutDetailDisabled": true,
"layoutListDisabled": true,
"layoutSearchDisabled": true
},
"softBouncedCount": {
"type": "int",
"notStorable": true,
"readOnly": true,
"layoutDetailDisabled": true,
"layoutListDisabled": true,
"layoutSearchDisabled": true
},
"leadCreatedCount": {
"type": "int",
"notStorable": true,
"readOnly": true,
"layoutDetailDisabled": true,
"layoutListDisabled": true,
"layoutSearchDisabled": true
},
"revenue": {
"type": "currency",
"notStorable": true,
"readOnly": true,
"layoutDetailDisabled": true,
"layoutListDisabled": true,
"layoutSearchDisabled": true
}
},
"links": {

View File

@@ -24,17 +24,46 @@ Espo.define('Crm:Views.Campaign.Record.Panels.Statistics', 'Views.Record.Panels.
return Dep.extend({
template: 'crm:campaign.record.panels.statistics',
data: function () {
/*data: function () {
return {};
},*/
setupFieldList: function () {
var type = this.model.get('type');
switch (type) {
case 'Email':
case 'Newsletter':
this.fields = ['sentCount', 'openedCount', 'clickedCount', 'optedOutCount', 'bouncedCount', 'revenue'];
break;
case 'Web':
case 'Television':
case 'Radio':
this.fields = ['leadCreatedCount', 'revenue'];
break;
case 'Mail':
this.fields = ['sentCount', 'leadCreatedCount', 'revenue'];
break;
default:
this.fields = ['leadCreatedCount', 'revenue'];
}
},
setup: function () {
this.fields = ['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);
}
});
});