CRM-15578 - crmMailing recipients - Filter on group_type="Mailing List" instead of...
authorTim Otten <totten@civicrm.org>
Mon, 23 Feb 2015 21:52:36 +0000 (13:52 -0800)
committerTim Otten <totten@civicrm.org>
Mon, 23 Feb 2015 21:54:26 +0000 (13:54 -0800)
js/angular-crmMailing.js
partials/crmMailing/recipients.html

index beb26bb7134f4eb40e66f41ebd009f73932446f0..1407f85695ea975d5777d03735d3e58ff4dc7edc 100644 (file)
   //  - [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;
index 8c1f143dd790c413ffc12e7f2570924398db4da3..80e7a4ae9d6fafbe49f1fb199ee96dae307272f4 100644 (file)
@@ -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}}"