From b704ec052ad04e66ccbf1a1c7702687e46617a7a Mon Sep 17 00:00:00 2001 From: Seamus Lee Date: Mon, 31 Jul 2017 21:51:02 +0000 Subject: [PATCH] CRM-20521 Ensure that only Mailing List groups appear in the receipients box --- ang/crmMailing/Recipients.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/ang/crmMailing/Recipients.js b/ang/crmMailing/Recipients.js index 69bcd2f4f9..d9714d48e6 100644 --- a/ang/crmMailing/Recipients.js +++ b/ang/crmMailing/Recipients.js @@ -207,11 +207,20 @@ } rcpAjaxState.page_i = page_num - rcpAjaxState.page_n; + var filterParams = {}; + switch(rcpAjaxState.entity) { + case 'civicrm_group': + filterParams = { is_hidden: 0, is_active: 1, group_type: {"LIKE": "%2%"} }; + break; + case 'civicrm_mailing': + filterParams = { is_hidden: 0, is_active: 1 }; + break; + } var params = { input: input, page_num: rcpAjaxState.page_i, - params: { is_hidden: 0, is_active: 1 }, + params: filterParams, }; return params; }, -- 2.25.1