From f7041b8b7a005ba5be706f48b592a6a9980707fe Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Thu, 31 Aug 2023 23:09:31 +1200 Subject: [PATCH] Add weights to scheduled jobs --- CRM/Admin/Page/Job.php | 7 +++++++ CRM/Event/Selector/Search.php | 8 ++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/CRM/Admin/Page/Job.php b/CRM/Admin/Page/Job.php index 005b38f5ee..f8a1a10171 100644 --- a/CRM/Admin/Page/Job.php +++ b/CRM/Admin/Page/Job.php @@ -51,40 +51,47 @@ class CRM_Admin_Page_Job extends CRM_Core_Page_Basic { 'url' => 'civicrm/admin/joblog', 'qs' => 'jid=%%id%%&reset=1', 'title' => ts('See log entries for this Scheduled Job'), + 'weight' => CRM_Core_Action::getWeight(CRM_Core_Action::VIEW), ], CRM_Core_Action::VIEW => [ 'name' => ts('Execute'), 'url' => 'civicrm/admin/job/edit', 'qs' => 'action=view&id=%%id%%&reset=1', 'title' => ts('Execute Scheduled Job Now'), + 'weight' => -15, ], CRM_Core_Action::UPDATE => [ 'name' => ts('Edit'), 'url' => 'civicrm/admin/job/edit', 'qs' => 'action=update&id=%%id%%&reset=1', 'title' => ts('Edit Scheduled Job'), + 'weight' => CRM_Core_Action::getWeight(CRM_Core_Action::UPDATE), ], CRM_Core_Action::DISABLE => [ 'name' => ts('Disable'), 'ref' => 'crm-enable-disable', 'title' => ts('Disable Scheduled Job'), + 'weight' => CRM_Core_Action::getWeight(CRM_Core_Action::DISABLE), ], CRM_Core_Action::ENABLE => [ 'name' => ts('Enable'), 'ref' => 'crm-enable-disable', 'title' => ts('Enable Scheduled Job'), + 'weight' => CRM_Core_Action::getWeight(CRM_Core_Action::ENABLE), ], CRM_Core_Action::DELETE => [ 'name' => ts('Delete'), 'url' => 'civicrm/admin/job/edit', 'qs' => 'action=delete&id=%%id%%', 'title' => ts('Delete Scheduled Job'), + 'weight' => CRM_Core_Action::getWeight(CRM_Core_Action::DELETE), ], CRM_Core_Action::COPY => [ 'name' => ts('Copy'), 'url' => 'civicrm/admin/job/edit', 'qs' => 'action=copy&id=%%id%%', 'title' => ts('Copy Scheduled Job'), + 'weight' => CRM_Core_Action::getWeight(CRM_Core_Action::COPY), ], ]; } diff --git a/CRM/Event/Selector/Search.php b/CRM/Event/Selector/Search.php index b7f6967f6b..9000dbbf90 100644 --- a/CRM/Event/Selector/Search.php +++ b/CRM/Event/Selector/Search.php @@ -354,12 +354,13 @@ class CRM_Event_Selector_Search extends CRM_Core_Selector_Base implements CRM_Co $row['checkbox'] = CRM_Core_Form::CB_PREFIX . $result->participant_id; $links = self::links($this->_key, $this->_context, $this->_compContext); - if ($statusTypes[$row['participant_status_id']] == 'Partially paid') { + if ($statusTypes[$row['participant_status_id']] === 'Partially paid') { $links[CRM_Core_Action::ADD] = [ 'name' => ts('Record Payment'), 'url' => 'civicrm/payment', 'qs' => 'reset=1&id=%%id%%&cid=%%cid%%&action=add&component=event', 'title' => ts('Record Payment'), + 'weight' => CRM_Core_Action::getWeight(CRM_Core_Action::ADD), ]; if (CRM_Core_Config::isEnabledBackOfficeCreditCardPayments()) { $links[CRM_Core_Action::BASIC] = [ @@ -367,16 +368,18 @@ class CRM_Event_Selector_Search extends CRM_Core_Selector_Base implements CRM_Co 'url' => 'civicrm/payment/add', 'qs' => 'reset=1&id=%%id%%&cid=%%cid%%&action=add&component=event&mode=live', 'title' => ts('Submit Credit Card payment'), + 'weight' => 50, ]; } } - if ($statusTypes[$row['participant_status_id']] == 'Pending refund') { + if ($statusTypes[$row['participant_status_id']] === 'Pending refund') { $links[CRM_Core_Action::ADD] = [ 'name' => ts('Record Refund'), 'url' => 'civicrm/payment', 'qs' => 'reset=1&id=%%id%%&cid=%%cid%%&action=add&component=event', 'title' => ts('Record Refund'), + 'weight' => 60, ]; } @@ -391,6 +394,7 @@ class CRM_Event_Selector_Search extends CRM_Core_Selector_Base implements CRM_Co 'url' => 'civicrm/event/selfsvcupdate', 'qs' => 'reset=1&pid=%%id%%&is_backoffice=1&cs=' . CRM_Contact_BAO_Contact_Utils::generateChecksum($result->contact_id, NULL, 'inf'), 'title' => ts('Transfer or Cancel'), + 'weight' => 70, ]; } -- 2.25.1