From b0583607ba82c386f4f5335fc3b4afee3a8ffaaa Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Mon, 14 Jun 2021 22:58:47 -0700 Subject: [PATCH] msgtplui - Add navbar and help box --- ext/msgtplui/ang/msgtplui.ang.php | 8 ++++--- ext/msgtplui/ang/msgtplui/ListCtrl.js | 3 +++ ext/msgtplui/ang/msgtplui/ListNav.html | 30 +++++++++++++++++++++++++ ext/msgtplui/ang/msgtplui/User.html | 2 ++ ext/msgtplui/ang/msgtplui/User.js | 5 +++-- ext/msgtplui/ang/msgtplui/Workflow.html | 2 ++ ext/msgtplui/ang/msgtplui/Workflow.js | 5 +++-- 7 files changed, 48 insertions(+), 7 deletions(-) create mode 100644 ext/msgtplui/ang/msgtplui/ListNav.html diff --git a/ext/msgtplui/ang/msgtplui.ang.php b/ext/msgtplui/ang/msgtplui.ang.php index ddf0e71b0a..02ffdc3fa0 100644 --- a/ext/msgtplui/ang/msgtplui.ang.php +++ b/ext/msgtplui/ang/msgtplui.ang.php @@ -21,13 +21,15 @@ return [ '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', ], ]; diff --git a/ext/msgtplui/ang/msgtplui/ListCtrl.js b/ext/msgtplui/ang/msgtplui/ListCtrl.js index b827c32505..3fc0e8cf79 100644 --- a/ext/msgtplui/ang/msgtplui/ListCtrl.js +++ b/ext/msgtplui/ang/msgtplui/ListCtrl.js @@ -5,6 +5,9 @@ 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; diff --git a/ext/msgtplui/ang/msgtplui/ListNav.html b/ext/msgtplui/ang/msgtplui/ListNav.html new file mode 100644 index 0000000000..b623eaade2 --- /dev/null +++ b/ext/msgtplui/ang/msgtplui/ListNav.html @@ -0,0 +1,30 @@ +
+ + + +
+ +
+ +
+ + + +
+
+ {{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.')}} + +
+ +
diff --git a/ext/msgtplui/ang/msgtplui/User.html b/ext/msgtplui/ang/msgtplui/User.html index 3d78ae04c7..a0cb2ebebd 100644 --- a/ext/msgtplui/ang/msgtplui/User.html +++ b/ext/msgtplui/ang/msgtplui/User.html @@ -1,6 +1,8 @@
+
+
diff --git a/ext/msgtplui/ang/msgtplui/User.js b/ext/msgtplui/ang/msgtplui/User.js index 28f4e4cb85..61a4f433cb 100644 --- a/ext/msgtplui/ang/msgtplui/User.js +++ b/ext/msgtplui/ang/msgtplui/User.js @@ -7,12 +7,13 @@ 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); } } }); diff --git a/ext/msgtplui/ang/msgtplui/Workflow.html b/ext/msgtplui/ang/msgtplui/Workflow.html index a9f46a5fd9..7775c41be1 100644 --- a/ext/msgtplui/ang/msgtplui/Workflow.html +++ b/ext/msgtplui/ang/msgtplui/Workflow.html @@ -1,6 +1,8 @@
+
+
diff --git a/ext/msgtplui/ang/msgtplui/Workflow.js b/ext/msgtplui/ang/msgtplui/Workflow.js index 11ed5cf0e5..c73768330a 100644 --- a/ext/msgtplui/ang/msgtplui/Workflow.js +++ b/ext/msgtplui/ang/msgtplui/Workflow.js @@ -7,8 +7,8 @@ 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"]], @@ -16,6 +16,7 @@ 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); }, }, }); -- 2.25.1