From f9df078759190e7342290bad7e2bb8654e834fa5 Mon Sep 17 00:00:00 2001 From: Aidan Saunders Date: Thu, 13 Apr 2023 17:09:28 +0100 Subject: [PATCH] AdminUI: Scheduled Jobs page --- .../ang/afsearchManageScheduledJobs.aff.html | 21 ++ .../ang/afsearchManageScheduledJobs.aff.json | 7 + .../SavedSearch_Manage_Scheduled_Jobs.mgd.php | 231 ++++++++++++++++++ 3 files changed, 259 insertions(+) create mode 100644 ext/civicrm_admin_ui/ang/afsearchManageScheduledJobs.aff.html create mode 100644 ext/civicrm_admin_ui/ang/afsearchManageScheduledJobs.aff.json create mode 100644 ext/civicrm_admin_ui/managed/SavedSearch_Manage_Scheduled_Jobs.mgd.php diff --git a/ext/civicrm_admin_ui/ang/afsearchManageScheduledJobs.aff.html b/ext/civicrm_admin_ui/ang/afsearchManageScheduledJobs.aff.html new file mode 100644 index 000000000000..15cfe161e99a --- /dev/null +++ b/ext/civicrm_admin_ui/ang/afsearchManageScheduledJobs.aff.html @@ -0,0 +1,21 @@ +
+
{{:: ts('You can configure scheduled jobs (cron tasks) for your CiviCRM installation. For most sites, your system administrator should set up one or more "cron" tasks to run the enabled jobs. However, you can also run all scheduled jobs manually using the button below, or specific jobs from this screen using the "Execute Now" buttons.')}} (Job parameters and command line syntax documentation...)
+
+
+
+ + + +
+ + +
diff --git a/ext/civicrm_admin_ui/ang/afsearchManageScheduledJobs.aff.json b/ext/civicrm_admin_ui/ang/afsearchManageScheduledJobs.aff.json new file mode 100644 index 000000000000..4aebf05131b4 --- /dev/null +++ b/ext/civicrm_admin_ui/ang/afsearchManageScheduledJobs.aff.json @@ -0,0 +1,7 @@ +{ + "type": "search", + "title": "Manage Scheduled Jobs", + "icon": "fa-list-alt", + "server_route": "civicrm/admin/job", + "permission": "access CiviCRM" +} diff --git a/ext/civicrm_admin_ui/managed/SavedSearch_Manage_Scheduled_Jobs.mgd.php b/ext/civicrm_admin_ui/managed/SavedSearch_Manage_Scheduled_Jobs.mgd.php new file mode 100644 index 000000000000..6f759bd35f42 --- /dev/null +++ b/ext/civicrm_admin_ui/managed/SavedSearch_Manage_Scheduled_Jobs.mgd.php @@ -0,0 +1,231 @@ + 'SavedSearch_Scheduled_Jobs', + 'entity' => 'SavedSearch', + 'cleanup' => 'always', + 'update' => 'unmodified', + 'params' => [ + 'version' => 4, + 'values' => [ + 'name' => 'Scheduled_Jobs', + 'label' => E::ts('Scheduled Jobs'), + 'form_values' => NULL, + 'mapping_id' => NULL, + 'search_custom_id' => NULL, + 'api_entity' => 'Job', + 'api_params' => [ + 'version' => 4, + 'select' => [ + 'id', + 'name', + 'description', + 'run_frequency:label', + 'parameters', + 'last_run', + 'is_active', + 'api_entity', + 'api_action', + ], + 'orderBy' => [], + 'where' => [], + 'groupBy' => [], + 'join' => [], + 'having' => [], + ], + 'expires_date' => NULL, + 'description' => NULL, + ], + 'match' => [ + 'name', + ], + ], + ], + [ + 'name' => 'SavedSearch_Scheduled_Jobs_SearchDisplay_Scheduled_Jobs_Table_2', + 'entity' => 'SearchDisplay', + 'cleanup' => 'always', + 'update' => 'unmodified', + 'params' => [ + 'version' => 4, + 'values' => [ + 'name' => 'Scheduled_Jobs_Table_2', + 'label' => E::ts('Scheduled Jobs Table 2'), + 'saved_search_id.name' => 'Scheduled_Jobs', + 'type' => 'table', + 'settings' => [ + 'description' => NULL, + 'sort' => [ + [ + 'is_active', + 'DESC', + ], + [ + 'name', + 'ASC', + ], + ], + 'limit' => 50, + 'pager' => [], + 'placeholder' => 5, + 'columns' => [ + [ + 'type' => 'html', + 'key' => 'name', + 'dataType' => 'String', + 'label' => E::ts('Job'), + 'sortable' => TRUE, + 'cssRules' => [ + [ + 'disabled', + 'is_active', + '=', + FALSE, + ], + ], + 'rewrite' => '[name]
[description]', + ], + [ + 'type' => 'field', + 'key' => 'run_frequency:label', + 'dataType' => 'String', + 'label' => E::ts('Frequency'), + 'sortable' => TRUE, + 'cssRules' => [ + [ + 'disabled', + 'is_active', + '=', + FALSE, + ], + ], + ], + [ + 'type' => 'field', + 'key' => 'last_run', + 'dataType' => 'Timestamp', + 'label' => E::ts('Last Run'), + 'sortable' => TRUE, + 'cssRules' => [ + [ + 'disabled', + 'is_active', + '=', + FALSE, + ], + ], + ], + [ + 'type' => 'field', + 'key' => 'is_active', + 'dataType' => 'Boolean', + 'label' => E::ts('Enabled'), + 'sortable' => TRUE, + 'editable' => TRUE, + 'cssRules' => [ + [ + 'disabled', + 'is_active', + '=', + FALSE, + ], + ], + ], + [ + 'type' => 'field', + 'key' => 'api_entity', + 'dataType' => 'String', + 'label' => E::ts('API'), + 'sortable' => TRUE, + 'cssRules' => [ + [ + 'disabled', + 'is_active', + '=', + FALSE, + ], + ], + 'rewrite' => '[api_entity].[api_action]', + ], + [ + 'text' => E::ts(''), + 'style' => 'default', + 'size' => 'btn-sm', + 'icon' => 'fa-bars', + 'links' => [ + [ + 'entity' => '', + 'action' => '', + 'join' => '', + 'target' => '', + 'icon' => 'fa-file-o', + 'text' => E::ts('View joblog'), + 'style' => 'default', + 'path' => 'civicrm/admin/joblog?jid=[id]&reset=1', + 'condition' => [], + ], + [ + 'entity' => '', + 'action' => '', + 'join' => '', + 'target' => '', + 'icon' => 'fa-play', + 'text' => E::ts('Execute now'), + 'style' => 'default', + 'path' => 'civicrm/admin/job/edit?action=view&id=[id]&reset=1', + 'condition' => [], + ], + [ + 'entity' => 'Job', + 'action' => 'update', + 'join' => '', + 'target' => 'crm-popup', + 'icon' => 'fa-pencil', + 'text' => E::ts('Edit Job'), + 'style' => 'default', + 'path' => '', + 'condition' => [], + ], + [ + 'entity' => '', + 'action' => '', + 'join' => '', + 'target' => '', + 'icon' => 'fa-clone', + 'text' => E::ts('Clone'), + 'style' => 'secondary', + 'path' => 'civicrm/admin/job/edit?action=copy&id=[id]', + 'condition' => [], + ], + [ + 'entity' => 'Job', + 'action' => 'delete', + 'join' => '', + 'target' => 'crm-popup', + 'icon' => 'fa-trash', + 'text' => E::ts('Delete Job'), + 'style' => 'danger', + 'path' => '', + 'condition' => [], + ], + ], + 'type' => 'menu', + 'alignment' => 'text-right', + ], + ], + 'actions' => FALSE, + 'classes' => [ + 'table', + 'table-striped', + ], + ], + 'acl_bypass' => FALSE, + ], + 'match' => [ + 'name', + ], + ], + ], +];