-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
crmMosaicoBlockMailing - Fix "Unsubscribe Group"
Upstream made some changes in how the list of groups is supplied (CRM-21411, circa v4.7.28). This patch ports the change from civicrm/civicrm-core#11258. Note the use of `CRM.crmMailing.testGroupNames || CRM.crmMailing.groupNames` is intended to provide compatibility with older and newer protocols.
- Loading branch information
Showing
2 changed files
with
27 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,27 @@ | ||
(function(angular, $, _) { | ||
angular.module('crmMosaico').directive('crmMosaicoBlockMailing', function(crmMailingSimpleDirective) { | ||
return crmMailingSimpleDirective('crmMosaicoBlockMailing', '~/crmMosaico/BlockMailing.html'); | ||
angular.module('crmMosaico').directive('crmMosaicoBlockMailing', function($q, crmMetadata, crmUiHelp) { | ||
var directiveName = 'crmMosaicoBlockMailing', templateUrl = '~/crmMosaico/BlockMailing.html'; | ||
return { | ||
scope: { | ||
crmMailing: '@' | ||
}, | ||
templateUrl: templateUrl, | ||
link: function (scope, elm, attr) { | ||
// Common elements - like crmMailingSimpleDirective | ||
scope.$parent.$watch(attr.crmMailing, function(newValue){ | ||
scope.mailing = newValue; | ||
}); | ||
scope.crmMailingConst = CRM.crmMailing; | ||
scope.ts = CRM.ts(null); | ||
scope.hs = crmUiHelp({file: 'CRM/Mailing/MailingUI'}); | ||
scope[directiveName] = attr[directiveName] ? scope.$parent.$eval(attr[directiveName]) : {}; | ||
$q.when(crmMetadata.getFields('Mailing'), function(fields) { | ||
scope.mailingFields = fields; | ||
}); | ||
|
||
// Unique elements | ||
scope.groupNames = CRM.crmMailing.testGroupNames || CRM.crmMailing.groupNames; | ||
} | ||
}; | ||
}); | ||
})(angular, CRM.$, CRM._); |