From bf6806e5dba77c5b80b9e08b8202725f1783f2cd Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Tue, 5 Sep 2023 16:13:11 +1200 Subject: [PATCH] Remove unreachable page I searched the code (including universe) and the UI for how to reach CRM_Mailing_Page_Preview / civicrm/mailing/preview but could not find it The alternate CRM_Mailing_Page_View civicrm/mailing/view appears to be what is used now --- CRM/Mailing/Page/Preview.php | 85 -------------------------------- CRM/Mailing/xml/Menu/Mailing.xml | 7 --- 2 files changed, 92 deletions(-) delete mode 100644 CRM/Mailing/Page/Preview.php diff --git a/CRM/Mailing/Page/Preview.php b/CRM/Mailing/Page/Preview.php deleted file mode 100644 index 565388b023..0000000000 --- a/CRM/Mailing/Page/Preview.php +++ /dev/null @@ -1,85 +0,0 @@ -getVars($options, "CRM_Mailing_Controller_Send_$qfKey"); - - // get the options if control come from search context, CRM-3711 - if (empty($options)) { - $session->getVars($options, "CRM_Contact_Controller_Search_$qfKey"); - } - - // FIXME: the below and CRM_Mailing_Form_Test::testMail() - // should be refactored - $fromEmail = NULL; - $mailing = new CRM_Mailing_BAO_Mailing(); - if (!empty($options)) { - $mailing->id = $options['mailing_id']; - $fromEmail = $options['from_email'] ?? NULL; - } - - $mailing->find(TRUE); - - CRM_Mailing_BAO_Mailing::tokenReplace($mailing); - - // get and format attachments - $attachments = CRM_Core_BAO_File::getEntityFile('civicrm_mailing', - $mailing->id - ); - - // get details of contact with token value including Custom Field Token Values.CRM-3734 - $returnProperties = $mailing->getReturnProperties(); - $params = ['contact_id' => $session->get('userID')]; - - [$details] = CRM_Utils_Token::getTokenDetails($params, - $returnProperties, - TRUE, TRUE, NULL, - $mailing->getFlattenedTokens(), - get_class($this) - ); - // $details is an array of [ contactID => contactDetails ] - $mime = &$mailing->compose(NULL, NULL, NULL, $session->get('userID'), $fromEmail, $fromEmail, - TRUE, $details[$session->get('userID')], $attachments - ); - - if ($type == 'html') { - CRM_Utils_System::setHttpHeader('Content-Type', 'text/html; charset=utf-8'); - print $mime->getHTMLBody(); - } - else { - CRM_Utils_System::setHttpHeader('Content-Type', 'text/plain; charset=utf-8'); - print $mime->getTXTBody(); - } - CRM_Utils_System::civiExit(); - } - -} diff --git a/CRM/Mailing/xml/Menu/Mailing.xml b/CRM/Mailing/xml/Menu/Mailing.xml index 5e6b7b474e..3067227861 100644 --- a/CRM/Mailing/xml/Menu/Mailing.xml +++ b/CRM/Mailing/xml/Menu/Mailing.xml @@ -143,13 +143,6 @@ true 660 - - civicrm/mailing/preview - Preview Mailing - CRM_Mailing_Page_Preview - access CiviMail;approve mailings;create mailings;schedule mailings - 670 - civicrm/mailing/report Mailing Report -- 2.25.1