Allow re-use mailing on draft mailings
authorLars SG <lars@wildsight.ca>
Wed, 14 Apr 2021 16:24:01 +0000 (10:24 -0600)
committerLars SG <lars@wildsight.ca>
Wed, 14 Apr 2021 16:24:01 +0000 (10:24 -0600)
Before, re-use was shown only on scheduled/sent and archived mailings pages, now shown on draft/unscheduled as well (i.e. on all mailings pages).
Also re-ordered options to put Re-use after Continue.

CRM/Mailing/Selector/Browse.php

index 46df4a424c2aba5a0eca9939d74112f5890772de..efe72aa9d4697d1a3c9ba60a115a0ffcd59fa8b2 100644 (file)
@@ -245,12 +245,6 @@ LEFT JOIN  civicrm_contact scheduledContact ON ( $mailing.scheduled_id = schedul
           'qs' => 'mid=%%mid%%&reset=1',
           'title' => ts('View Mailing Report'),
         ],
-        CRM_Core_Action::UPDATE => [
-          'name' => ts('Re-Use'),
-          'url' => 'civicrm/mailing/send',
-          'qs' => 'mid=%%mid%%&reset=1',
-          'title' => ts('Re-Send Mailing'),
-        ],
         CRM_Core_Action::DISABLE => [
           'name' => ts('Cancel'),
           'url' => 'civicrm/mailing/browse',
@@ -264,6 +258,12 @@ LEFT JOIN  civicrm_contact scheduledContact ON ( $mailing.scheduled_id = schedul
           'qs' => 'mid=%%mid%%&continue=true&reset=1',
           'title' => ts('Continue Mailing'),
         ],
+        CRM_Core_Action::UPDATE => [
+          'name' => ts('Re-Use'),
+          'url' => 'civicrm/mailing/send',
+          'qs' => 'mid=%%mid%%&reset=1',
+          'title' => ts('Re-Send Mailing'),
+        ],
         CRM_Core_Action::DELETE => [
           'name' => ts('Delete'),
           'url' => 'civicrm/mailing/browse',
@@ -363,12 +363,6 @@ LEFT JOIN  civicrm_contact scheduledContact ON ( $mailing.scheduled_id = schedul
           if ($allAccess || $showCreateLinks) {
             $actionMask = CRM_Core_Action::VIEW;
           }
-
-          if (!in_array($row['id'], $searchMailings)) {
-            if ($allAccess || $showCreateLinks) {
-              $actionMask |= CRM_Core_Action::UPDATE;
-            }
-          }
         }
         else {
           if ($allAccess || ($showCreateLinks || $showScheduleLinks)) {
@@ -409,6 +403,10 @@ LEFT JOIN  civicrm_contact scheduledContact ON ( $mailing.scheduled_id = schedul
           }
         }
 
+        if ($allAccess || $showCreateLinks) {
+          $actionMask |= CRM_Core_Action::UPDATE;
+          }
+
         // check for delete permission.
         if ($allowToDelete) {
           $actionMask |= CRM_Core_Action::DELETE;