From: Tim Otten Date: Tue, 17 Feb 2015 22:05:26 +0000 (-0800) Subject: CRM-15970 - crmMailingAB - Add support for filtering and sorting X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=5ad42de87e5c11a0457b7c2d4c3e5bd371ff4a93;p=civicrm-core.git CRM-15970 - crmMailingAB - Add support for filtering and sorting --- diff --git a/js/angular-crmMailingAB.js b/js/angular-crmMailingAB.js index e1b822a5e0..c5861d45ff 100644 --- a/js/angular-crmMailingAB.js +++ b/js/angular-crmMailingAB.js @@ -10,6 +10,9 @@ resolve: { mailingABList: function ($route, crmApi) { return crmApi('MailingAB', 'get', {rowCount: 0}); + }, + fields: function(crmMetadata){ + return crmMetadata.getFields('MailingAB'); } } }); @@ -48,11 +51,13 @@ } ]); - angular.module('crmMailingAB').controller('CrmMailingABListCtrl', function ($scope, mailingABList, crmMailingABCriteria, crmMailingABStatus) { + angular.module('crmMailingAB').controller('CrmMailingABListCtrl', function($scope, mailingABList, crmMailingABCriteria, crmMailingABStatus, fields) { var ts = $scope.ts = CRM.ts(null); - $scope.mailingABList = mailingABList.values; + $scope.mailingABList = _.values(mailingABList.values); $scope.crmMailingABCriteria = crmMailingABCriteria; $scope.crmMailingABStatus = crmMailingABStatus; + $scope.fields = fields; + $scope.filter = {}; }); angular.module('crmMailingAB').controller('CrmMailingABNewCtrl', function ($scope, abtest, $location) { diff --git a/partials/crmMailingAB/list.html b/partials/crmMailingAB/list.html index 06c3a8afa1..a59ce9fa8d 100644 --- a/partials/crmMailingAB/list.html +++ b/partials/crmMailingAB/list.html @@ -3,21 +3,45 @@ Controller: ABListingCtrl Required vars: mailingABList --> + + +
+
+ + + + + + + + + +
+
+
- - - + + + + - + +
{{ts('Name')}}{{ts('Status')}}{{ts('Test Type')}}{{ts('Name')}}{{ts('Status')}}{{ts('Test Type')}}{{ts('Created')}}
{{mailingAB.name}} {{crmMailingABStatus.getByName(mailingAB.status).label}} {{crmMailingABCriteria.get(mailingAB.testing_criteria_id).label}}{{mailingAB.created_date}} {{ts('Continue')}} {{ts('Results')}}