From 5d544a77219d66c0dbbe7ce865bf5ffcb03d035d Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Mon, 23 Feb 2015 13:52:36 -0800 Subject: [PATCH] CRM-15578 - crmMailing recipients - Filter on group_type="Mailing List" instead of visibility --- js/angular-crmMailing.js | 6 ++++++ partials/crmMailing/recipients.html | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/js/angular-crmMailing.js b/js/angular-crmMailing.js index beb26bb713..1407f85695 100644 --- a/js/angular-crmMailing.js +++ b/js/angular-crmMailing.js @@ -231,6 +231,12 @@ // - [output] recipients: array of recipient records angular.module('crmMailing').controller('EditRecipCtrl', function EditRecipCtrl($scope, dialogService, crmApi, crmMailingMgr, $q, crmMetadata) { var ts = $scope.ts = CRM.ts(null); + + $scope.isMailingList = function isMailingList(group) { + var GROUP_TYPE_MAILING_LIST = '2'; + return _.contains(group.group_type, GROUP_TYPE_MAILING_LIST); + }; + $scope.recipients = null; $scope.getRecipientsEstimate = function () { var ts = $scope.ts; diff --git a/partials/crmMailing/recipients.html b/partials/crmMailing/recipients.html index 8c1f143dd7..80e7a4ae9d 100644 --- a/partials/crmMailing/recipients.html +++ b/partials/crmMailing/recipients.html @@ -8,7 +8,7 @@ crm-mailing-recipients ng-model="mailing.recipients" crm-mandatory-groups="crmMailingConst.groupNames | filter:{is_hidden:1}" - crm-avail-groups="crmMailingConst.groupNames | filter:{visibility:'Public pages'}" + crm-avail-groups="crmMailingConst.groupNames | filter:isMailingList" crm-avail-mailings="crmMailingConst.civiMails | filter:{is_completed:1}" crm-ui-id="{{crmMailingBlockRecipients.id}}" name="{{crmMailingBlockRecipients.name}}" -- 2.25.1