From 5ad42de87e5c11a0457b7c2d4c3e5bd371ff4a93 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Tue, 17 Feb 2015 14:05:26 -0800 Subject: [PATCH] CRM-15970 - crmMailingAB - Add support for filtering and sorting --- js/angular-crmMailingAB.js | 9 +++++++-- partials/crmMailingAB/list.html | 32 ++++++++++++++++++++++++++++---- 2 files changed, 35 insertions(+), 6 deletions(-) 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')}} -- 2.25.1