First commit
This commit is contained in:
commit
c6e2478c40
13918 changed files with 2303184 additions and 0 deletions
52
sites/all/modules/civicrm/ang/crmMailingAB/ReportCtrl.js
Normal file
52
sites/all/modules/civicrm/ang/crmMailingAB/ReportCtrl.js
Normal file
|
@ -0,0 +1,52 @@
|
|||
(function(angular, $, _) {
|
||||
|
||||
angular.module('crmMailingAB').controller('CrmMailingABReportCtrl', function($scope, crmApi, crmMailingStats) {
|
||||
var ts = $scope.ts = CRM.ts(null);
|
||||
|
||||
var CrmMailingABReportCnt = 1, activeMailings = null;
|
||||
$scope.getActiveMailings = function() {
|
||||
if ($scope.abtest.$CrmMailingABReportCnt != CrmMailingABReportCnt) {
|
||||
$scope.abtest.$CrmMailingABReportCnt = ++CrmMailingABReportCnt;
|
||||
activeMailings = [
|
||||
{
|
||||
name: 'a',
|
||||
title: ts('Mailing A'),
|
||||
mailing: $scope.abtest.mailings.a,
|
||||
attachments: $scope.abtest.attachments.a
|
||||
},
|
||||
{
|
||||
name: 'b',
|
||||
title: ts('Mailing B'),
|
||||
mailing: $scope.abtest.mailings.b,
|
||||
attachments: $scope.abtest.attachments.b
|
||||
}
|
||||
];
|
||||
if ($scope.abtest.ab.status == 'Final') {
|
||||
activeMailings.push({
|
||||
name: 'c',
|
||||
title: ts('Final'),
|
||||
mailing: $scope.abtest.mailings.c,
|
||||
attachments: $scope.abtest.attachments.c
|
||||
});
|
||||
}
|
||||
}
|
||||
return activeMailings;
|
||||
};
|
||||
|
||||
crmMailingStats.getStats({
|
||||
a: $scope.abtest.ab.mailing_id_a,
|
||||
b: $scope.abtest.ab.mailing_id_b,
|
||||
c: $scope.abtest.ab.mailing_id_c
|
||||
}).then(function(stats) {
|
||||
$scope.stats = stats;
|
||||
});
|
||||
|
||||
$scope.statTypes = crmMailingStats.getStatTypes();
|
||||
$scope.statUrl = function statUrl(mailing, statType, view) {
|
||||
return crmMailingStats.getUrl(mailing, statType, view, 'abtest/' + $scope.abtest.ab.id);
|
||||
};
|
||||
|
||||
$scope.checkPerm = CRM.checkPerm;
|
||||
});
|
||||
|
||||
})(angular, CRM.$, CRM._);
|
Loading…
Add table
Add a link
Reference in a new issue