From b4e1015b9e4eb0ca74b78e9a8cb6b4c071b51251 Mon Sep 17 00:00:00 2001 From: Lars SG Date: Wed, 14 Apr 2021 10:24:01 -0600 Subject: [PATCH] Allow re-use mailing on draft mailings 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 | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/CRM/Mailing/Selector/Browse.php b/CRM/Mailing/Selector/Browse.php index 46df4a424c..efe72aa9d4 100644 --- a/CRM/Mailing/Selector/Browse.php +++ b/CRM/Mailing/Selector/Browse.php @@ -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; -- 2.25.1