'crmUi',
'crmUtil',
'ngRoute',
+ 'ngSanitize',
'api4',
],
'settings' => [],
'basePages' => [],
'permissions' => [
- "edit message templates",
- "edit user-driven message templates",
- "edit system workflow message templates",
+ 'edit message templates',
+ 'edit user-driven message templates',
+ 'edit system workflow message templates',
+ 'access CiviMail',
],
];
var hs = $scope.hs = crmUiHelp({file: 'CRM/msgtplui/User'}); // See: templates/CRM/msgtplui/User.hlp
$scope.crmUrl = CRM.url;
$scope.crmUiAlert = crmUiAlert;
+ $scope.location = $location;
+ $scope.checkPerm = CRM.checkPerm;
+ $scope.help = CRM.help;
var ctrl = this;
ctrl.records = records;
--- /dev/null
+<div class="panel panel-info">
+
+ <ul class="panel-heading nav nav-tabs">
+ <li role="presentation"
+ ng-class="{active: location.path() === '/user'}"
+ ng-if="checkPerm('edit message templates') || checkPerm('edit user-driven message templates')">
+ <a ng-href="#/user">{{ts('User-Driven Messages')}}</a>
+ </li>
+ <li role="presentation"
+ ng-class="{active: location.path() === '/workflow'}"
+ ng-if="checkPerm('edit message templates') || checkPerm('edit system workflow message templates')">
+ <a ng-href="#/workflow">{{ts('System Workflow Messages')}}</a>
+ </li>
+ </ul>
+
+</div>
+
+<div class="help">
+
+ <div ng-if="location.path() === '/user'">
+ <span ng-bind-html="ts('Message templates allow you to easily create similar emails or letters on a recurring basis. Messages used for membership renewal reminders, as well as event and activity related reminders should be created via <a href=\'%1\'>Schedule Reminders</a>.', {1: crmUrl('civicrm/admin/scheduleReminders', 'reset=1')})"></span>
+ <span ng-if="checkPerm('access CiviMail')" ng-bind-html="ts('You can also use message templates for CiviMail (bulk email) content. However, subscribe, unsubscribe and opt-out messages are configured at <a href=\'%1\'>Administer > CiviMail > Headers, Footers and Automated Messages</a>.', {1: crmUrl('civicrm/admin/component', 'reset=1')})"></span>
+ <a crm-ui-help="hs({title:ts('User-Driven Messages'), id:'id-intro', file:'CRM/Admin/Page/MessageTemplates'})"></a>
+ </div>
+ <div ng-if="location.path() === '/workflow'">
+ {{ts('System workflow message templates are used to generate the emails sent to constituents and administrators for contribution receipts, event confirmations and many other workflows. You can customize the style and wording of these messages here.')}}
+ <a crm-ui-help="hs({title:ts('System Workflow Messages'), id:'id-system-workflow', file:'CRM/Admin/Page/MessageTemplates'})"></a>
+ </div>
+
+</div>
<div id="bootstrap-theme">
<div crm-ui-debug="$ctrl"></div>
+ <div ng-include="'~/msgtplui/ListNav.html'"></div>
+
<div class="form-inline">
<label for="msgtpl-filter-text">{{:: ts('Filter') }}</label>
<input class="form-control" type="search" id="msgtpl-filter-text" ng-model="$ctrl.filterText">
controllerAs: '$ctrl',
templateUrl: '~/msgtplui/User.html',
resolve: {
- records: function(crmApi4) {
- return crmApi4('MessageTemplate', 'get', {
+ records: function(crmApi4, crmStatus) {
+ var q = crmApi4('MessageTemplate', 'get', {
select: ["id", "msg_title", "msg_subject", "is_active"],
where: [["workflow_name", "IS EMPTY"]],
orderBy: {"msg_title":"ASC"},
});
+ return crmStatus({start: ts('Loading...'), success: ''}, q);
}
}
});
<div id="bootstrap-theme">
<div crm-ui-debug="$ctrl"></div>
+ <div ng-include="'~/msgtplui/ListNav.html'"></div>
+
<div class="form-inline">
<label for="msgtpl-filter-text">{{:: ts('Filter') }}</label>
<input class="form-control" type="search" id="msgtpl-filter-text" ng-model="$ctrl.filterText">
controllerAs: '$ctrl',
templateUrl: '~/msgtplui/Workflow.html',
resolve: {
- records: function(crmApi4) {
- return crmApi4('MessageTemplate', 'get', {
+ records: function(crmApi4, crmStatus) {
+ var q= crmApi4('MessageTemplate', 'get', {
select: ["id", "msg_title", "tx.language:label", "tx.language", "is_default"],
join: [["Translation AS tx", "LEFT", null, ["tx.entity_table", "=", "'civicrm_msg_template'"], ["tx.entity_id", "=", "id"]]],
where: [["workflow_name", "IS NOT EMPTY"]],
orderBy: {"msg_title":"ASC", "tx.language:label":"ASC"},
chain: {"statuses":["Translation", "get", {"select":["status_id:name"], "where":[["entity_table", "=", "civicrm_msg_template"], ["entity_id", "=", "$id"], ["language", "=", "$tx.language"]], "groupBy":["status_id"]}, "status_id:name"]}
});
+ return crmStatus({start: ts('Loading...'), success: ''}, q);
},
},
});