Add some missing weights
authorEileen McNaughton <emcnaughton@wikimedia.org>
Mon, 18 Sep 2023 05:06:22 +0000 (17:06 +1200)
committerEileen McNaughton <emcnaughton@wikimedia.org>
Mon, 18 Sep 2023 05:06:22 +0000 (17:06 +1200)
CRM/Admin/Page/EventTemplate.php
CRM/Mailing/Selector/Browse.php

index c373135e635af01c710ac26fd5d5caa52b51b97b..77ee19f553b20df755e4cd14b9b232ad97c7d1db 100644 (file)
@@ -52,12 +52,14 @@ class CRM_Admin_Page_EventTemplate extends CRM_Core_Page_Basic {
           'url' => 'civicrm/event/manage/settings',
           'qs' => 'action=update&id=%%id%%&reset=1',
           'title' => ts('Edit Event Template'),
+          'weight' => CRM_Core_Action::getWeight(CRM_Core_Action::UPDATE),
         ],
         CRM_Core_Action::DELETE => [
           'name' => ts('Delete'),
           'url' => 'civicrm/event/manage',
           'qs' => 'action=delete&id=%%id%%',
           'title' => ts('Delete Event Template'),
+          'weight' => CRM_Core_Action::getWeight(CRM_Core_Action::DELETE),
         ],
       ];
     }
index c5253d53dba04d0844cff405fda46b831866571a..d5cf043fb62f0b3fa0d792664afd224e5c3ff23c 100644 (file)
@@ -238,12 +238,14 @@ LEFT JOIN  civicrm_contact scheduledContact ON ( $mailing.scheduled_id = schedul
           'url' => 'civicrm/mailing/approve',
           'qs' => 'mid=%%mid%%&reset=1',
           'title' => ts('Approve/Reject Mailing'),
+          'weight' => -50,
         ],
         CRM_Core_Action::VIEW => [
           'name' => ts('Report'),
           'url' => 'civicrm/mailing/report',
           'qs' => 'mid=%%mid%%&reset=1',
           'title' => ts('View Mailing Report'),
+          'weight' => CRM_Core_Action::getWeight(CRM_Core_Action::VIEW),
         ],
         CRM_Core_Action::DISABLE => [
           'name' => ts('Cancel'),
@@ -251,18 +253,21 @@ LEFT JOIN  civicrm_contact scheduledContact ON ( $mailing.scheduled_id = schedul
           'qs' => 'action=disable&mid=%%mid%%&reset=1',
           'extra' => 'onclick="if (confirm(\'' . $cancelExtra . '\')) this.href+=\'&amp;confirmed=1\'; else return false;"',
           'title' => ts('Cancel Mailing'),
+          'weight' => CRM_Core_Action::getWeight(CRM_Core_Action::DISABLE),
         ],
         CRM_Core_Action::PREVIEW => [
           'name' => ts('Continue'),
           'url' => 'civicrm/mailing/send',
           'qs' => 'mid=%%mid%%&continue=true&reset=1',
           'title' => ts('Continue Mailing'),
+          'weight' => 50,
         ],
         CRM_Core_Action::UPDATE => [
           'name' => ts('Copy'),
           'url' => 'civicrm/mailing/send',
           'qs' => 'mid=%%mid%%&reset=1',
           'title' => ts('Copy Mailing'),
+          'weight' => CRM_Core_Action::getWeight(CRM_Core_Action::UPDATE),
         ],
         CRM_Core_Action::DELETE => [
           'name' => ts('Delete'),
@@ -270,6 +275,7 @@ LEFT JOIN  civicrm_contact scheduledContact ON ( $mailing.scheduled_id = schedul
           'qs' => 'action=delete&mid=%%mid%%&reset=1',
           'extra' => 'onclick="if (confirm(\'' . $deleteExtra . '\')) this.href+=\'&amp;confirmed=1\'; else return false;"',
           'title' => ts('Delete Mailing'),
+          'weight' => CRM_Core_Action::getWeight(CRM_Core_Action::DELETE),
         ],
         CRM_Core_Action::RENEW => [
           'name' => ts('Archive'),
@@ -277,18 +283,21 @@ LEFT JOIN  civicrm_contact scheduledContact ON ( $mailing.scheduled_id = schedul
           'qs' => 'action=renew&mid=%%mid%%&reset=1',
           'extra' => 'onclick="if (confirm(\'' . $archiveExtra . '\')) this.href+=\'&amp;confirmed=1\'; else return false;"',
           'title' => ts('Archive Mailing'),
+          'weight' => 110,
         ],
         CRM_Core_Action::REOPEN => [
           'name' => ts('Resume'),
           'url' => 'civicrm/mailing/browse',
           'qs' => 'action=reopen&mid=%%mid%%&reset=1',
           'title' => ts('Resume mailing'),
+          'weight' => 120,
         ],
         CRM_Core_Action::CLOSE => [
           'name' => ts('Pause'),
           'url' => 'civicrm/mailing/browse',
           'qs' => 'action=close&mid=%%mid%%&reset=1',
           'title' => ts('Pause mailing'),
+          'weight' => CRM_Core_Action::getWeight(CRM_Core_Action::BROWSE),
         ],
       ];
     }
@@ -359,7 +368,7 @@ LEFT JOIN  civicrm_contact scheduledContact ON ( $mailing.scheduled_id = schedul
           $actionLinks[CRM_Core_Action::PREVIEW]['url'] = 'civicrm/sms/send';
         }
 
-        if (!($row['status'] == 'Not scheduled') && !$row['sms_provider_id']) {
+        if (!($row['status'] === 'Not scheduled') && !$row['sms_provider_id']) {
           if ($allAccess || $showCreateLinks) {
             $actionMask = CRM_Core_Action::VIEW;
           }
@@ -379,14 +388,14 @@ LEFT JOIN  civicrm_contact scheduledContact ON ( $mailing.scheduled_id = schedul
           ) {
 
             $actionMask |= CRM_Core_Action::DISABLE;
-            if ($row['status'] == "Paused") {
+            if ($row['status'] === "Paused") {
               $actionMask |= CRM_Core_Action::REOPEN;
             }
             else {
               $actionMask |= CRM_Core_Action::CLOSE;
             }
           }
-          if ($row['status'] == 'Scheduled' &&
+          if ($row['status'] === 'Scheduled' &&
             empty($row['approval_status_id'])
           ) {
             if ($workFlow && ($allAccess || $showApprovalLinks)) {
@@ -429,6 +438,7 @@ LEFT JOIN  civicrm_contact scheduledContact ON ( $mailing.scheduled_id = schedul
             'qs' => 'id=%%hashOrMid%%&reset=1',
             'title' => ts('Public View'),
             'fe' => TRUE,
+            'weight' => 150,
           ];
           $actionMask |= CRM_Core_Action::BROWSE;
         }
@@ -441,7 +451,7 @@ LEFT JOIN  civicrm_contact scheduledContact ON ( $mailing.scheduled_id = schedul
             'mid' => $row['id'],
             'hashOrMid' => $hash ?: $row['id'],
           ],
-          "more",
+          'more',
           FALSE,
           $opString,
           "Mailing",