From 6a1e1dc3b41c41e9adf684f345fb9985f415fd8b Mon Sep 17 00:00:00 2001 From: Mathieu Lutfy Date: Fri, 7 Jul 2023 10:55:03 -0400 Subject: [PATCH] Edit Manage Job: remove double-title, top buttons, help only on the main job page --- CRM/Admin/Form/Job.php | 25 +++++++++++++++++++++++-- CRM/Admin/Page/Job.php | 12 ++++-------- templates/CRM/Admin/Form/Job.tpl | 8 +++++--- templates/CRM/Admin/Page/Job.tpl | 17 ++++++++--------- 4 files changed, 40 insertions(+), 22 deletions(-) diff --git a/CRM/Admin/Form/Job.php b/CRM/Admin/Form/Job.php index d5d099417b..1a95bf7d61 100644 --- a/CRM/Admin/Form/Job.php +++ b/CRM/Admin/Form/Job.php @@ -27,11 +27,32 @@ class CRM_Admin_Form_Job extends CRM_Admin_Form { public $submitOnce = TRUE; public function preProcess() { - parent::preProcess(); $this->setContext(); - $this->setTitle(ts('Manage - Scheduled Jobs')); + if ($this->_action == CRM_Core_Action::DELETE) { + $this->setTitle(ts('Delete Scheduled Job')); + } + elseif ($this->_action == CRM_Core_Action::ADD) { + $this->setTitle(ts('New Scheduled Job')); + } + elseif ($this->_action == CRM_Core_Action::UPDATE) { + $this->setTitle(ts('Edit Scheduled Job')); + } + elseif ($this->_action == CRM_Core_Action::VIEW) { + $this->setTitle(ts('Execute Scheduled Job')); + } + + CRM_Utils_System::appendBreadCrumb([ + [ + 'title' => ts('Administer CiviCRM'), + 'url' => CRM_Utils_System::url('civicrm/admin', 'reset=1'), + ], + [ + 'title' => ts('Scheduled Jobs'), + 'url' => CRM_Utils_System::url('civicrm/admin/job', 'reset=1'), + ], + ]); if ($this->_id) { $refreshURL = CRM_Utils_System::url('civicrm/admin/job/edit', diff --git a/CRM/Admin/Page/Job.php b/CRM/Admin/Page/Job.php index 72d9d3eed8..abfa14bfbc 100644 --- a/CRM/Admin/Page/Job.php +++ b/CRM/Admin/Page/Job.php @@ -99,17 +99,13 @@ class CRM_Admin_Page_Job extends CRM_Core_Page_Basic { * Finally it calls the parent's run method. */ public function run() { - // set title and breadcrumb CRM_Utils_System::setTitle(ts('Settings - Scheduled Jobs')); - $breadCrumb = [ + CRM_Utils_System::appendBreadCrumb([ [ - 'title' => ts('Scheduled Jobs'), - 'url' => CRM_Utils_System::url('civicrm/admin', - 'reset=1' - ), + 'title' => ts('Administer CiviCRM'), + 'url' => CRM_Utils_System::url('civicrm/admin', 'reset=1'), ], - ]; - CRM_Utils_System::appendBreadCrumb($breadCrumb); + ]); $this->_id = CRM_Utils_Request::retrieve('id', 'String', $this, FALSE, 0 diff --git a/templates/CRM/Admin/Form/Job.tpl b/templates/CRM/Admin/Form/Job.tpl index 8cd1dd1d5d..f3e14eed70 100644 --- a/templates/CRM/Admin/Form/Job.tpl +++ b/templates/CRM/Admin/Form/Job.tpl @@ -7,10 +7,8 @@ | and copyright information, see https://civicrm.org/licensing | +--------------------------------------------------------------------+ *} -{* This template is used for adding/configuring Scheduled Jobs. *} -

{if $action eq 1}{ts}New Scheduled Job{/ts}{elseif $action eq 2}{ts}Edit Scheduled Job{/ts}{elseif $action eq 4}{ts}Execute Scheduled Job{/ts}{else}{ts}Delete Scheduled Job{/ts}{/if}

+{* Edit/Run Scheduled Jobs *}
-
{include file="CRM/common/formButtons.tpl" location="top"}
{if $action eq 8}
@@ -23,6 +21,10 @@ {ts 1=$jobName}Are you sure you would like to execute %1 job?{/ts}
{else} +
+ {capture assign=docUrlText}{ts}Job parameters and command line syntax documentation{/ts}{/capture} + {docURL page="user/initial-set-up/scheduled-jobs" text=$docUrlText} +
diff --git a/templates/CRM/Admin/Page/Job.tpl b/templates/CRM/Admin/Page/Job.tpl index 0030cffa10..902ce448e2 100644 --- a/templates/CRM/Admin/Page/Job.tpl +++ b/templates/CRM/Admin/Page/Job.tpl @@ -7,19 +7,18 @@ | and copyright information, see https://civicrm.org/licensing | +--------------------------------------------------------------------+ *} -{capture assign=docUrlText}{ts}(Job parameters and command line syntax documentation...){/ts}{/capture} -{capture assign=runAllURL}{crmURL p='civicrm/admin/runjobs' q="reset=1"}{/capture} -
- {ts 1=$runAllURL}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, or run specific jobs from this screen (click 'more' and then 'Execute Now').{/ts} {docURL page="sysadmin/setup/jobs" text=$docUrlText} -
{if $action eq 1 or $action eq 2 or $action eq 8 or $action eq 4} {include file="CRM/Admin/Form/Job.tpl"} {else} - -
-{if $rows} - + {capture assign=docUrlText}{ts}(How to setup cron on the command line...){/ts}{/capture} + {capture assign=runAllURL}{crmURL p='civicrm/admin/runjobs' q="reset=1"}{/capture} +
+ {ts}CiviCRM relies on a number of scheduled jobs that run automatically on a regular basis. These jobs keep data up-to-date and perform other important tasks.{/ts} + {ts 1=$runAllURL}For most sites, your system administrator should set up one or more 'cron' tasks to run the enabled jobs. You can also run all scheduled jobs manually, or run specific jobs from this screen.{/ts} {docURL page="sysadmin/setup/jobs" text=$docUrlText} +
+
+ {if $rows} {if $action ne 1 and $action ne 2}
{$form.name.label}{$form.name.html}