3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.5 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2014 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
10 | CiviCRM is free software; you can copy, modify, and distribute it |
11 | under the terms of the GNU Affero General Public License |
12 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
14 | CiviCRM is distributed in the hope that it will be useful, but |
15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
17 | See the GNU Affero General Public License for more details. |
19 | You should have received a copy of the GNU Affero General Public |
20 | License and the CiviCRM Licensing Exception along |
21 | with this program; if not, contact CiviCRM LLC |
22 | at info[AT]civicrm[DOT]org. If you have questions about the |
23 | GNU Affero General Public License or the licensing of CiviCRM, |
24 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
25 +--------------------------------------------------------------------+
31 * @copyright CiviCRM LLC (c) 2004-2014
35 class CRM_Upgrade_TwoOne_Form_Step4
extends CRM_Upgrade_Form
{
37 * @param $errorMessage
41 function verifyPreDBState(&$errorMessage) {
42 $errorMessage = ts('Pre-condition failed for upgrade step %1.', array(1 => '2'));
44 if (!CRM_Core_DAO
::checkTableExists('civicrm_cache') ||
45 !CRM_Core_DAO
::checkTableExists('civicrm_group_contact_cache') ||
46 !CRM_Core_DAO
::checkTableExists('civicrm_menu') ||
47 !CRM_Core_DAO
::checkTableExists('civicrm_discount') ||
48 !CRM_Core_DAO
::checkTableExists('civicrm_pledge') ||
49 !CRM_Core_DAO
::checkTableExists('civicrm_pledge_block') ||
50 !CRM_Core_DAO
::checkTableExists('civicrm_pledge_payment')
55 // check fields which MUST be present if a proper 2.1 db
56 if (!CRM_Core_DAO
::checkFieldExists('civicrm_cache', 'group_name') ||
57 !CRM_Core_DAO
::checkFieldExists('civicrm_cache', 'created_date') ||
58 !CRM_Core_DAO
::checkFieldExists('civicrm_cache', 'expired_date') ||
59 !CRM_Core_DAO
::checkFieldExists('civicrm_discount', 'option_group_id') ||
60 !CRM_Core_DAO
::checkFieldExists('civicrm_discount', 'end_date') ||
61 !CRM_Core_DAO
::checkFieldExists('civicrm_group_contact_cache', 'contact_id') ||
62 !CRM_Core_DAO
::checkFieldExists('civicrm_menu', 'path_arguments') ||
63 !CRM_Core_DAO
::checkFieldExists('civicrm_menu', 'is_exposed') ||
64 !CRM_Core_DAO
::checkFieldExists('civicrm_menu', 'page_type') ||
65 !CRM_Core_DAO
::checkFieldExists('civicrm_option_value', 'component_id') ||
66 !CRM_Core_DAO
::checkFieldExists('civicrm_option_group', 'id') ||
67 !CRM_Core_DAO
::checkFieldExists('civicrm_option_group', 'name')
69 // db looks to have stuck somewhere between 2.0 & 2.1
70 $errorMessage .= ' Few important fields were found missing in some of the tables.';
73 if ($this->checkVersion('2.03')) {
74 $this->setVersion($this->latestVersion
);
80 return $this->checkVersion($this->latestVersion
);
83 function buildQuickForm() {}
89 return ts('Database Upgrade to v2.1 Completed');
95 function getTemplateMessage() {
96 if ($this->_config
->userSystem
->is_drupal
) {
97 $upgradeDoc = 'http://wiki.civicrm.org/confluence/x/7IFH';
100 $upgradeDoc = 'http://wiki.civicrm.org/confluence/x/SoJH';
102 return '<p><strong>' . ts('Your CiviCRM database has been successfully upgraded to v2.1.') . '</strong></p><p>' . ts('Please be sure to follow the remaining steps in the <a href=\'%1\' target=\'_blank\'><strong>Upgrade Instructions</strong></a>.', array(
103 1 => $upgradeDoc)) . '</p><p>' . ts('Thank you for using CiviCRM.') . '</p>';