From: Lars SG Date: Wed, 14 Apr 2021 16:24:01 +0000 (-0600) Subject: Allow re-use mailing on draft mailings X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=b4e1015b9e4eb0ca74b78e9a8cb6b4c071b51251;p=civicrm-core.git 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. --- 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;