Unverified Commit b52f032d authored by eileen's avatar eileen 🎱 Committed by GitHub

Merge pull request #11258 from seamuslee001/CRM-21411

CRM-21411 Fix issue where unsubscribe group field would not show beca…
parents d12cde10 4b0fb6ef
......@@ -61,7 +61,7 @@ It could perhaps be thinned by 30-60% by making more directives.
ng-model="mailing.recipients.groups.base[0]"
ng-required="true"
>
<option ng-repeat="grp in crmMailingConst.groupNames | filter:{is_hidden:0} | orderBy:'title'" value="{{grp.id}}">{{grp.title}}</option>
<option ng-repeat="grp in crmMailingConst.testGroupNames | filter:{is_hidden:0} | orderBy:'title'" value="{{grp.id}}">{{grp.title}}</option>
</select>
</div>
</span>
......
......@@ -3,14 +3,16 @@
angular.module('crmMailing').controller('EditUnsubGroupCtrl', function EditUnsubGroupCtrl($scope) {
// CRM.crmMailing.groupNames is a global constant - since it doesn't change, we can digest & cache.
var mandatoryIds = [];
_.each(CRM.crmMailing.groupNames, function(grp) {
if (grp.is_hidden == "1") {
mandatoryIds.push(parseInt(grp.id));
}
});
$scope.isUnsubGroupRequired = function isUnsubGroupRequired(mailing) {
return _.intersection(mandatoryIds, mailing.recipients.groups.include).length > 0;
if (!_.isEmpty(CRM.crmMailing.groupNames)) {
_.each(CRM.crmMailing.groupNames, function(grp) {
if (grp.is_hidden == "1") {
mandatoryIds.push(parseInt(grp.id));
}
});
return _.intersection(mandatoryIds, mailing.recipients.groups.include).length > 0;
}
};
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment