Add searchkit and afform display
author19ATF72 <micah.hobby@gmail.com>
Mon, 4 Dec 2023 19:11:21 +0000 (11:11 -0800)
committer19ATF72 <micah.hobby@gmail.com>
Mon, 4 Dec 2023 20:44:03 +0000 (20:44 +0000)
ext/civicrm_admin_ui/ang/afsearchHeadersFootersAndAutomatedMessages.aff.html [new file with mode: 0644]
ext/civicrm_admin_ui/ang/afsearchHeadersFootersAndAutomatedMessages.aff.php [new file with mode: 0644]
ext/civicrm_admin_ui/managed/SavedSearch_Headers_Footers_and_Automated_Messages.mgd.php [new file with mode: 0644]

diff --git a/ext/civicrm_admin_ui/ang/afsearchHeadersFootersAndAutomatedMessages.aff.html b/ext/civicrm_admin_ui/ang/afsearchHeadersFootersAndAutomatedMessages.aff.html
new file mode 100644 (file)
index 0000000..e4208fb
--- /dev/null
@@ -0,0 +1,3 @@
+<div af-fieldset="">
+  <crm-search-display-table search-name="Headers_Footers_and_Automated_Messages" display-name="Headers_Footers_and_Automated_Messages_Table_1"></crm-search-display-table>
+</div>
diff --git a/ext/civicrm_admin_ui/ang/afsearchHeadersFootersAndAutomatedMessages.aff.php b/ext/civicrm_admin_ui/ang/afsearchHeadersFootersAndAutomatedMessages.aff.php
new file mode 100644 (file)
index 0000000..0fc31c7
--- /dev/null
@@ -0,0 +1,14 @@
+<?php
+use CRM_CivicrmAdminUi_ExtensionUtil as E;
+
+return [
+  'type' => 'search',
+  'title' => E::ts('Headers, Footers, and Automated Messages'),
+  'icon' => 'fa-list-alt',
+  'server_route' => 'civicrm/admin/component',
+  'permission' => [
+    'access CiviCRM',
+    'access CiviMail',
+  ],
+  'modified_date' => '2023-12-04 10:53:21',
+];
diff --git a/ext/civicrm_admin_ui/managed/SavedSearch_Headers_Footers_and_Automated_Messages.mgd.php b/ext/civicrm_admin_ui/managed/SavedSearch_Headers_Footers_and_Automated_Messages.mgd.php
new file mode 100644 (file)
index 0000000..efa3d70
--- /dev/null
@@ -0,0 +1,220 @@
+<?php
+use CRM_CivicrmAdminUi_ExtensionUtil as E;
+
+return [
+  [
+    'name' => 'SavedSearch_Headers_Footers_and_Automated_Messages',
+    'entity' => 'SavedSearch',
+    'cleanup' => 'unused',
+    'update' => 'unmodified',
+    'params' => [
+      'version' => 4,
+      'values' => [
+        'name' => 'Headers_Footers_and_Automated_Messages',
+        'label' => E::ts('Headers, Footers, and Automated Messages'),
+        'api_entity' => 'MailingComponent',
+        'api_params' => [
+          'version' => 4,
+          'select' => [
+            'name',
+            'component_type:label',
+            'subject',
+            'body_html',
+            'body_text',
+            'is_default',
+            'is_active',
+          ],
+          'orderBy' => [],
+          'where' => [],
+          'groupBy' => [],
+          'join' => [],
+          'having' => [],
+        ],
+      ],
+      'match' => [
+        'name',
+      ],
+    ],
+  ],
+  [
+    'name' => 'SavedSearch_Headers_Footers_and_Automated_Messages_SearchDisplay_Headers_Footers_and_Automated_Messages_Table_1',
+    'entity' => 'SearchDisplay',
+    'cleanup' => 'unused',
+    'update' => 'unmodified',
+    'params' => [
+      'version' => 4,
+      'values' => [
+        'name' => 'Headers_Footers_and_Automated_Messages_Table_1',
+        'label' => E::ts('Headers, Footers, and Automated Messages'),
+        'saved_search_id.name' => 'Headers_Footers_and_Automated_Messages',
+        'type' => 'table',
+        'settings' => [
+          'description' => NULL,
+          'sort' => [
+            [
+              'component_type',
+              'ASC',
+            ],
+          ],
+          'limit' => 50,
+          'pager' => [],
+          'placeholder' => 5,
+          'columns' => [
+            [
+              'type' => 'field',
+              'key' => 'name',
+              'dataType' => 'String',
+              'label' => E::ts('Name'),
+              'sortable' => FALSE,
+              'editable' => TRUE,
+            ],
+            [
+              'type' => 'field',
+              'key' => 'component_type:label',
+              'dataType' => 'String',
+              'label' => E::ts('Type'),
+              'sortable' => FALSE,
+            ],
+            [
+              'type' => 'field',
+              'key' => 'subject',
+              'dataType' => 'String',
+              'label' => E::ts('Subject'),
+              'sortable' => FALSE,
+            ],
+            [
+              'type' => 'field',
+              'key' => 'body_html',
+              'dataType' => 'Text',
+              'label' => E::ts('Body HTML'),
+              'sortable' => FALSE,
+            ],
+            [
+              'type' => 'field',
+              'key' => 'body_text',
+              'dataType' => 'Text',
+              'label' => E::ts('Body Text'),
+              'sortable' => FALSE,
+            ],
+            [
+              'type' => 'field',
+              'key' => 'is_default',
+              'dataType' => 'Boolean',
+              'label' => E::ts('Default?'),
+              'sortable' => FALSE,
+              'rewrite' => '[none]',
+              'title' => NULL,
+              'icons' => [
+                [
+                  'icon' => 'fa-check',
+                  'side' => 'left',
+                  'if' => [
+                    'is_default',
+                    '=',
+                    TRUE,
+                  ],
+                ],
+              ],
+            ],
+            [
+              'type' => 'field',
+              'key' => 'is_active',
+              'dataType' => 'Boolean',
+              'label' => E::ts('Enabled?'),
+              'sortable' => FALSE,
+              'icons' => [],
+              'rewrite' => '',
+            ],
+            [
+              'links' => [
+                [
+                  'entity' => 'MailingComponent',
+                  'action' => 'update',
+                  'join' => '',
+                  'target' => 'crm-popup',
+                  'icon' => '',
+                  'text' => E::ts('Edit'),
+                  'style' => 'default',
+                  'path' => '',
+                  'task' => '',
+                  'condition' => [],
+                ],
+                [
+                  'task' => 'disable',
+                  'entity' => 'MailingComponent',
+                  'join' => '',
+                  'target' => 'crm-popup',
+                  'icon' => '',
+                  'text' => E::ts('Disable'),
+                  'style' => 'default',
+                  'path' => '',
+                  'action' => '',
+                  'condition' => [
+                    'is_active',
+                    '=',
+                    TRUE,
+                  ],
+                ],
+                [
+                  'task' => 'enable',
+                  'entity' => 'MailingComponent',
+                  'join' => '',
+                  'target' => 'crm-popup',
+                  'icon' => '',
+                  'text' => E::ts('Enable'),
+                  'style' => 'default',
+                  'path' => '',
+                  'action' => '',
+                  'condition' => [
+                    'is_active',
+                    '=',
+                    FALSE,
+                  ],
+                ],
+              ],
+              'type' => 'links',
+              'alignment' => 'text-right',
+            ],
+          ],
+          'actions' => FALSE,
+          'classes' => [
+            'table-striped',
+            'table',
+          ],
+          'toolbar' => [
+            [
+              'action' => 'add',
+              'entity' => 'MailingComponent',
+              'text' => E::ts('Add Mailing Component'),
+              'icon' => 'fa-plus',
+              'style' => 'primary',
+              'target' => 'crm-popup',
+              'join' => '',
+              'path' => '',
+              'task' => '',
+              'condition' => [
+                'check user permission',
+                '=',
+                [
+                  'access CiviMail',
+                ],
+              ],
+            ],
+          ],
+          'cssRules' => [
+            [
+              'disabled',
+              'is_active',
+              '=',
+              FALSE,
+            ],
+          ],
+        ],
+      ],
+      'match' => [
+        'saved_search_id',
+        'name',
+      ],
+    ],
+  ],
+];