= 0 ) || (version_compare($currentVer, '3.4.alpha1') < 0 && version_compare($latestVer, '3.4.alpha1') >= 0 ) ) { $query = " SELECT id FROM civicrm_mailing_job WHERE status NOT IN ( 'Complete', 'Canceled' ) AND is_test = 0 LIMIT 1"; $mjId = CRM_Core_DAO::singleValueQuery($query); if ($mjId) { $preUpgradeMessage = ts("There are one or more Scheduled or In Progress mailings in your install. Scheduled mailings will not be sent and In Progress mailings will not finish if you continue with the upgrade. We strongly recommend that all Scheduled and In Progress mailings be completed or cancelled and then upgrade your CiviCRM install."); } } //turning some tables to monolingual during 3.4.beta3, CRM-7869 $upgradeTo = str_replace('4.0.', '3.4.', $latestVer); $upgradeFrom = str_replace('4.0.', '3.4.', $currentVer); // check for changed message templates self::checkMessageTemplate($template, $preUpgradeMessage, $upgradeTo, $upgradeFrom); $upgrade = new CRM_Upgrade_Form(); if ($upgrade->multilingual && version_compare($upgradeFrom, '3.4.beta3') == -1 && version_compare($upgradeTo, '3.4.beta3') >= 0 ) { $config = CRM_Core_Config::singleton(); $preUpgradeMessage .= '
' . ts("As per the related blog post, we are making contact names, addresses and mailings monolingual; the values entered for the default locale (%2) will be preserved and values for other locales removed.", array(1 => 'http://civicrm.org/blogs/shot/multilingual-civicrm-3440-making-some-fields-monolingual', 2 => $config->lcMessages)); } if (version_compare($currentVer, '3.4.6') == -1 && version_compare($latestVer, '3.4.6') >= 0 ) { $googleProcessorExists = CRM_Core_DAO::singleValueQuery("SELECT id FROM civicrm_payment_processor WHERE payment_processor_type = 'Google_Checkout' AND is_active = 1 LIMIT 1;"); if ($googleProcessorExists) { $preUpgradeMessage .= '
' . ts('To continue using Google Checkout Payment Processor with latest version of CiviCRM, requires updating merchant account settings. Please refer "Set API callback URL and other settings" section of Google Checkout Configuration doc.', array(1 => 'http://wiki.civicrm.org/confluence/x/zAJTAg')); } } // http://issues.civicrm.org/jira/browse/CRM-13572 // Depending on how the code was upgraded, some sites may still have copies of old // source files left behind. This is often a forgivable offense, but it's quite // dangerous for CIVI-SA-2013-001. global $civicrm_root; $ofcFile = "$civicrm_root/packages/OpenFlashChart/php-ofc-library/ofc_upload_image.php"; if (file_exists($ofcFile)) { if (@unlink($ofcFile)) { $preUpgradeMessage .= '
' . ts('This system included an outdated, insecure script (%1). The file was automatically deleted.', array( 1 => $ofcFile )); } else { $preUpgradeMessage .= '
' . ts('This system includes an outdated, insecure script (%1). Please delete it.', array( 1 => $ofcFile )); } } if (CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SEARCH_PREFERENCES_NAME, 'enable_innodb_fts', NULL, FALSE)) { // The FTS indexing feature dynamically manipulates the schema which could // cause conflicts with other layers that manipulate the schema. The // simplest thing is to turn it off and back on. // It may not always be necessary to do this -- but I doubt we're going to test // systematically in future releases. When it is necessary, one could probably // ignore the matter and simply run CRM_Core_InnoDBIndexer::fixSchemaDifferences // after the upgrade. But that's speculative. For now, we'll leave this // advanced feature in the hands of the sysadmin. $preUpgradeMessage .= '
' . ts('This database uses InnoDB Full Text Search for optimized searching. The upgrade procedure has not been tested with this feature. You should disable (and later re-enable) the feature by navigating to "Administer => System Settings => Miscellaneous".'); } } /** * @param $template * @param $message * @param $latestVer * @param $currentVer */ public static function checkMessageTemplate(&$template, &$message, $latestVer, $currentVer) { if (version_compare($currentVer, '3.1.alpha1') < 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, array( $pathName, "{$latestVer}.msg_template", 'message_templates', "{$name}_text.tpl", ) ); $htmlFileName = implode(DIRECTORY_SEPARATOR, array( $pathName, "{$latestVer}.msg_template", 'message_templates', "{$name}_html.tpl", ) ); if (file_exists($textFileName) || file_exists($htmlFileName) ) { $flag = TRUE; $html .= "
  • {$title}
  • "; } } if ($flag == TRUE) { $html = "