From 606d1035a253b81478e6f7fd0e6e8f6643666f13 Mon Sep 17 00:00:00 2001 From: demeritcowboy Date: Thu, 11 Aug 2022 10:27:13 -0400 Subject: [PATCH] remove unused code --- CRM/Upgrade/Form.php | 2 - CRM/Upgrade/Incremental/General.php | 76 ----------------------------- 2 files changed, 78 deletions(-) diff --git a/CRM/Upgrade/Form.php b/CRM/Upgrade/Form.php index 5682df2bf0..12cabd18ab 100644 --- a/CRM/Upgrade/Form.php +++ b/CRM/Upgrade/Form.php @@ -907,8 +907,6 @@ SET version = '$version' * @param $latestVer */ public function setPreUpgradeMessage(&$preUpgradeMessage, $currentVer, $latestVer) { - // check for changed message templates - CRM_Upgrade_Incremental_General::checkMessageTemplate($preUpgradeMessage, $latestVer, $currentVer); // set global messages CRM_Upgrade_Incremental_General::setPreUpgradeMessage($preUpgradeMessage, $currentVer, $latestVer); diff --git a/CRM/Upgrade/Incremental/General.php b/CRM/Upgrade/Incremental/General.php index 899dfc784c..2c9ae583a8 100644 --- a/CRM/Upgrade/Incremental/General.php +++ b/CRM/Upgrade/Incremental/General.php @@ -186,80 +186,4 @@ class CRM_Upgrade_Incremental_General { $messageObj->updateTemplates(); } - /** - * @param $message - * @param $latestVer - * @param $currentVer - */ - public static function checkMessageTemplate(&$message, $latestVer, $currentVer) { - if (version_compare($currentVer, 5.0, '>')) { - return; - } - $sql = "SELECT orig.workflow_id as workflow_id, - orig.msg_title as title - FROM civicrm_msg_template diverted JOIN civicrm_msg_template orig ON ( - diverted.workflow_id = orig.workflow_id AND - orig.is_reserved = 1 AND ( - diverted.msg_subject != orig.msg_subject OR - diverted.msg_text != orig.msg_text OR - diverted.msg_html != orig.msg_html - ) - )"; - - $dao = CRM_Core_DAO::executeQuery($sql); - while ($dao->fetch()) { - $workflows[$dao->workflow_id] = $dao->title; - } - - if (empty($workflows)) { - return; - } - - $html = NULL; - $pathName = dirname(dirname(__FILE__)); - $flag = FALSE; - foreach ($workflows as $workflow => $title) { - $name = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionValue', - $workflow, - 'name', - 'id' - ); - - // check if file exists locally - $textFileName = implode(DIRECTORY_SEPARATOR, - [ - $pathName, - "{$latestVer}.msg_template", - 'message_templates', - "{$name}_text.tpl", - ] - ); - - $htmlFileName = implode(DIRECTORY_SEPARATOR, - [ - $pathName, - "{$latestVer}.msg_template", - 'message_templates', - "{$name}_html.tpl", - ] - ); - - if (file_exists($textFileName) || - file_exists($htmlFileName) - ) { - $flag = TRUE; - $html .= "
  • {$title}
  • "; - } - } - - if ($flag == TRUE) { - $html = "