}
}
+ /**
+ * Use the form name to create the tpl file name
+ *
+ * @return string
+ * @access public
+ */
+ /**
+ * @return string
+ */
public function getTemplateFileName() {
return 'CRM/UF/Form/Preview.tpl';
}
$controller->run();
}
+ /**
+ * @param $id
+ * @param $action
+ */
function setContext($id, $action) {
$context = CRM_Utils_Request::retrieve('context', 'String', $this);
$session->pushUserContext($url);
}
+ /**
+ * @param $groupType
+ *
+ * @return array
+ */
static function extractGroupTypes($groupType) {
$returnGroupTypes = array();
if (!$groupType) {
9 => 'Nine',
);
+ /**
+ * Constructor for the basic form page
+ *
+ * We should not use QuickForm directly. This class provides a lot
+ * of default convenient functions, rules and buttons
+ *
+ * @param object $state State associated with this form
+ * @param \const|\enum $action The mode the form is operating in (None/Create/View/Update/Delete)
+ * @param string $method The type of http method used (GET/POST)
+ * @param string $name The name of the form if different from class name
+ *
+ * @return \CRM_Core_Form
+ @access public
+ */
+ /**
+ * @param null|object $state
+ * @param const|enum|int $action
+ * @param string $method
+ * @param null|string $name
+ */
function __construct($state = NULL,
$action = CRM_Core_Action::NONE,
$method = 'post',
parent::__construct($state, $action, $method, $name);
}
+ /**
+ * @param $version
+ *
+ * @return mixed
+ */
static function &incrementalPhpObject($version) {
static $incrementalPhpObject = array();
return $incrementalPhpObject[$versionName];
}
+ /**
+ * @param $version
+ * @param $release
+ *
+ * @return bool
+ */
function checkVersionRelease($version, $release) {
$versionParts = explode('.', $version);
if ($versionParts[2] == $release) {
return FALSE;
}
+ /**
+ * @param $constraints
+ *
+ * @return array
+ */
function checkSQLConstraints(&$constraints) {
$pass = $fail = 0;
foreach ($constraints as $constraint) {
}
}
+ /**
+ * @param $constraint
+ *
+ * @return bool
+ */
function checkSQLConstraint($constraint) {
// check constraint here
return TRUE;
}
+ /**
+ * @param $fileName
+ * @param bool $isQueryString
+ */
function source($fileName, $isQueryString = FALSE) {
CRM_Utils_File::sourceSQLFile($this->_config->dsn,
);
}
+ /**
+ * getter function for title. Should be over-ridden by derived class
+ *
+ * @return string
+ * @access public
+ */
+ /**
+ * @return string
+ */
function getTitle() {
return ts('Title not Set');
}
+ /**
+ * @return string
+ */
function getFieldsetTitle() {
return ts('');
}
+ /**
+ * @return string
+ */
function getButtonTitle() {
return ts('Continue');
}
+ /**
+ * Use the form name to create the tpl file name
+ *
+ * @return string
+ * @access public
+ */
+ /**
+ * @return string
+ */
function getTemplateFileName() {
$this->assign('title',
$this->getFieldsetTitle()
}
}
+ /**
+ * @param $query
+ *
+ * @return Object
+ */
function runQuery($query) {
return CRM_Core_DAO::executeQuery($query,
CRM_Core_DAO::$_nullArray
);
}
+ /**
+ * @param $version
+ *
+ * @return Object
+ */
function setVersion($version) {
$this->logVersion($version);
return $this->runQuery($query);
}
+ /**
+ * @param $newVersion
+ *
+ * @return bool
+ */
function logVersion($newVersion) {
if ($newVersion) {
$oldVersion = CRM_Core_BAO_Domain::version();
return FALSE;
}
+ /**
+ * @param $version
+ *
+ * @return bool
+ */
function checkVersion($version) {
$domainID = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_Domain',
$version, 'id',
return $domainID ? TRUE : FALSE;
}
+ /**
+ * @return array
+ * @throws Exception
+ */
function getRevisionSequence() {
$revList = array();
$sqlDir = implode(DIRECTORY_SEPARATOR,
return $revList;
}
+ /**
+ * @param $rev
+ * @param int $index
+ *
+ * @return null
+ */
static function getRevisionPart($rev, $index = 1) {
$revPattern = '/^((\d{1,2})\.\d{1,2})\.(\d{1,2}|\w{4,7})?$/i';
preg_match($revPattern, $rev, $matches);
return array_key_exists($index, $matches) ? $matches[$index] : NULL;
}
+ /**
+ * @param $tplFile
+ * @param $rev
+ *
+ * @return bool
+ */
function processLocales($tplFile, $rev) {
$smarty = CRM_Core_Smarty::singleton();
$smarty->assign('domainID', CRM_Core_Config::domainID());
return $this->multilingual;
}
+ /**
+ * @param $rev
+ */
function setSchemaStructureTables($rev) {
if ($this->multilingual) {
CRM_Core_I18n_Schema::schemaStructureTables($rev, TRUE);
}
}
+ /**
+ * @param $rev
+ *
+ * @throws Exception
+ */
function processSQL($rev) {
$sqlFile = implode(DIRECTORY_SEPARATOR,
array(
}
}
+ /**
+ * @param $template
+ * @param $message
+ * @param $latestVer
+ * @param $currentVer
+ */
static function checkMessageTemplate(&$template, &$message, $latestVer, $currentVer) {
if (version_compare($currentVer, '3.1.alpha1') < 0) {
return;
class CRM_Upgrade_Incremental_php_FourFive {
const BATCH_SIZE = 5000;
+ /**
+ * @param $errors
+ *
+ * @return bool
+ */
function verifyPreDBstate(&$errors) {
return TRUE;
}
}
}
+ /**
+ * @param $rev
+ *
+ * @return bool
+ */
function upgrade_4_5_alpha1($rev) {
// task to process sql
$this->addTask(ts('Migrate honoree information to module_data'), 'migrateHonoreeInfo');
const MAX_WORD_REPLACEMENT_SIZE = 255;
+ /**
+ * @param $errors
+ *
+ * @return bool
+ */
function verifyPreDBstate(&$errors) {
return TRUE;
}
}
}
+ /**
+ * @param $rev
+ *
+ * @return bool
+ */
function upgrade_4_4_alpha1($rev) {
// task to process sql
$this->addTask(ts('Upgrade DB to %1: SQL', array(1 => '4.4.alpha1')), 'task_4_4_x_runSql', $rev);
return TRUE;
}
+ /**
+ * @param $rev
+ */
function upgrade_4_4_beta1($rev) {
$this->addTask(ts('Upgrade DB to %1: SQL', array(1 => '4.4.beta1')), 'task_4_4_x_runSql', $rev);
$this->addTask('Migrate custom word-replacements', 'wordReplacements');
}
+ /**
+ * @param $rev
+ */
function upgrade_4_4_1($rev) {
$config = CRM_Core_Config::singleton();
// CRM-13327 upgrade handling for the newly added name badges
$this->addTask('Patch word-replacement schema', 'wordReplacements_patch', $rev);
}
+ /**
+ * @param $rev
+ *
+ * @return bool
+ */
function upgrade_4_4_4($rev) {
$fkConstraint = array();
if (!CRM_Core_DAO::checkFKConstraintInFormat('civicrm_activity_contact', 'activity_id')) {
return TRUE;
}
+ /**
+ * @param $rev
+ */
function upgrade_4_4_6($rev){
$minId = CRM_Core_DAO::singleValueQuery('SELECT coalesce(min(id),0) FROM civicrm_contact');
$maxId = CRM_Core_DAO::singleValueQuery('SELECT coalesce(max(id),0) FROM civicrm_contact');
}
}
+ /**
+ * @param CRM_Queue_TaskContext $ctx
+ * @param $startId
+ * @param $endId
+ *
+ * @return bool
+ */
static function upgradeImageUrls(CRM_Queue_TaskContext $ctx, $startId, $endId){
$sql = "CREATE INDEX index_image_url ON civicrm_contact (image_url);";
$dao = CRM_Core_DAO::executeQuery($sql);
// This was changed in 4.3 so we define it locally for compatability with older dbs
const NAVIGATION_NAME = "Navigation Menu";
+ /**
+ * @param $errors
+ *
+ * @return bool
+ */
function verifyPreDBstate(&$errors) {
$config = CRM_Core_Config::singleton();
if (in_array('CiviCase', $config->enableComponents)) {
}
}
+ /**
+ * @param $rev
+ */
function upgrade_4_1_alpha1($rev) {
$config = CRM_Core_Config::singleton();
if (in_array('CiviCase', $config->enableComponents)) {
CRM_Core_DAO::executeQuery($sql);
}
+ /**
+ * @param $params
+ */
static function retrieveDirectoryAndURLPaths(&$params) {
$sql = "
}
}
+ /**
+ * @param $rev
+ */
function upgrade_4_1_alpha2($rev) {
$dao = new CRM_Core_DAO_Setting();
$dao->group_name = 'Directory Preferences';
$upgrade->processSQL($rev);
}
+ /**
+ * @param $rev
+ */
function upgrade_4_1_beta1($rev) {
//CRM-9311
$groupNames = array('directory_preferences', 'url_preferences');
$upgrade->processSQL($rev);
}
+ /**
+ * @param $rev
+ */
function upgrade_4_1_1($rev) {
$upgrade = new CRM_Upgrade_Form();
$upgrade->assign('addDedupeEmail', !(CRM_Core_DAO::checkFieldExists('civicrm_mailing', 'dedupe_email')));
$upgrade->processSQL($rev);
}
+ /**
+ * @return string
+ */
function getTemplateMessage() {
return "Blah";
}
class CRM_Upgrade_Incremental_php_FourThree {
const BATCH_SIZE = 5000;
+ /**
+ * @param $errors
+ *
+ * @return bool
+ */
function verifyPreDBstate(&$errors) {
return TRUE;
}
}
}
+ /**
+ * @param $rev
+ *
+ * @return bool
+ */
function upgrade_4_3_alpha1($rev) {
self::task_4_3_alpha1_checkDBConstraints();
return TRUE;
}
+ /**
+ * @param $rev
+ */
function upgrade_4_3_alpha2($rev) {
//CRM-11847
$isColumnPresent = CRM_Core_DAO::checkFieldExists('civicrm_dedupe_rule_group', 'is_default');
$this->addTask(ts('Upgrade DB to %1: SQL', array(1 => '4.3.alpha2')), 'task_4_3_x_runSql', $rev);
}
+ /**
+ * @param $rev
+ */
function upgrade_4_3_alpha3($rev) {
$this->addTask(ts('Upgrade DB to %1: SQL', array(1 => '4.3.alpha3')), 'task_4_3_x_runSql', $rev);
}
+ /**
+ * @param $rev
+ */
function upgrade_4_3_beta2($rev) {
$this->addTask(ts('Upgrade DB to %1: SQL', array(1 => '4.3.beta2')), 'task_4_3_x_runSql', $rev);
}
}
+ /**
+ * @param $rev
+ */
function upgrade_4_3_beta3($rev) {
$this->addTask(ts('Upgrade DB to %1: SQL', array(1 => '4.3.beta3')), 'task_4_3_x_runSql', $rev);
// CRM-12065
$this->addTask('Replace contribution_type to financial_type in table civicrm_saved_search', 'replaceContributionTypeId', $query, 'savedSearch');
}
+ /**
+ * @param $rev
+ */
function upgrade_4_3_beta4($rev) {
$this->addTask(ts('Upgrade DB to %1: SQL', array(1 => '4.3.beta4')), 'task_4_3_x_runSql', $rev);
// add indexes for civicrm_entity_financial_trxn
$this->addTask('Check/Add indexes for civicrm_entity_financial_trxn', 'task_4_3_x_checkIndexes', $rev);
}
+ /**
+ * @param $rev
+ */
function upgrade_4_3_beta5($rev) {
// CRM-12205
if (
$this->addTask(ts('Upgrade DB to %1: SQL', array(1 => '4.3.beta5')), 'task_4_3_x_runSql', $rev);
}
+ /**
+ * @param $rev
+ */
function upgrade_4_3_4($rev) {
$this->addTask(ts('Upgrade DB to %1: SQL', array(1 => '4.3.4')), 'task_4_3_x_runSql', $rev);
}
+ /**
+ * @param $rev
+ */
function upgrade_4_3_5($rev) {
// CRM-12156
$config = CRM_Core_Config::singleton();
$this->addTask(ts('Upgrade DB to %1: SQL', array(1 => '4.3.5')), 'task_4_3_x_runSql', $rev);
}
+ /**
+ * @param $rev
+ */
function upgrade_4_3_6($rev) {
//CRM-13094
$this->addTask(ts('Add missing constraints'), 'addMissingConstraints', $rev);
}
//CRM-11636
+ /**
+ * @return bool
+ */
function assignFinancialTypeToPriceRecords() {
$upgrade = new CRM_Upgrade_Form();
//here we update price set entries
return TRUE;
}
+ /**
+ * @return bool
+ */
static function _checkAndMigrateDefaultFinancialTypes() {
$modifiedDefaults = FALSE;
//insert types if not exists
return $modifiedDefaults;
}
+ /**
+ * @return bool
+ */
function createFinancialRecords() {
$upgrade = new CRM_Upgrade_Form();
return TRUE;
}
+ /**
+ * @return array
+ */
function createDomainContacts() {
$domainParams = $context = array();
$query = "
const SETTINGS_SNIPPET_PATTERN = '/CRM_Core_ClassLoader::singleton\(\)-\>register/';
const SETTINGS_SNIPPET = "\nrequire_once 'CRM/Core/ClassLoader.php';\nCRM_Core_ClassLoader::singleton()->register();\n";
+ /**
+ * @param $errors
+ *
+ * @return bool
+ */
function verifyPreDBstate(&$errors) {
return TRUE;
}
}
}
+ /**
+ * @param $rev
+ */
function upgrade_4_2_alpha1($rev) {
//checking whether the foreign key exists before dropping it
//drop foreign key queries of CRM-9850
$this->addTask(ts('Upgrade DB to 4.2.alpha1: Event Profile'), 'task_4_2_alpha1_eventProfile');
}
+ /**
+ * @param $rev
+ */
function upgrade_4_2_beta2($rev) {
// note: error conditions are also checked in setPreUpgradeMessage()
if (defined('CIVICRM_SETTINGS_PATH')) {
}
}
+ /**
+ * @param $rev
+ */
function upgrade_4_2_beta3($rev) {
$this->addTask(ts('Upgrade DB to %1: SQL', array(1 => '4.2.beta3')), 'task_4_2_x_runSql', $rev);
$minParticipantId = CRM_Core_DAO::singleValueQuery('SELECT coalesce(min(id),0) FROM civicrm_participant');
}
}
+ /**
+ * @param $rev
+ */
function upgrade_4_2_beta5($rev) {
// CRM-10629 Create a setting for extension URLs
// For some reason, this isn't working when placed in the .sql file
");
}
+ /**
+ * @param $rev
+ */
function upgrade_4_2_0($rev) {
$this->addTask(ts('Upgrade DB to %1: SQL', array(1 => '4.2.0')), 'task_4_2_x_runSql', $rev);
}
+ /**
+ * @param $rev
+ */
function upgrade_4_2_2($rev) {
$this->addTask(ts('Upgrade DB to %1: SQL', array(1 => '4.2.2')), 'task_4_2_x_runSql', $rev);
//create line items for memberships and participants for api/import
}
}
+ /**
+ * @param $rev
+ */
function upgrade_4_2_3($rev) {
$this->addTask(ts('Upgrade DB to %1: SQL', array(1 => '4.2.3')), 'task_4_2_x_runSql', $rev);
// CRM-10953 Remove duplicate activity type for 'Reminder Sent' which is mistakenly inserted by 4.2.alpha1 upgrade script
}
}
+ /**
+ * @param $rev
+ */
function upgrade_4_2_5($rev) {
$this->addTask(ts('Upgrade DB to %1: SQL', array(1 => '4.2.5')), 'task_4_2_x_runSql', $rev);
//CRM-11077
$queue->createItem($task, array('weight' => -1));
}
+ /**
+ * @return array
+ */
public static function deleteInvalidPairs() {
require_once 'CRM/Member/PseudoConstant.php';
require_once 'CRM/Contribute/PseudoConstant.php';
*
*/
class CRM_Upgrade_Incremental_php_FourZero {
+ /**
+ * @param $errors
+ *
+ * @return bool
+ */
function verifyPreDBstate(&$errors) {
return TRUE;
}
+ /**
+ * @param $rev
+ */
function upgrade_4_0_alpha1($rev) {
// do nothing, db is already upgraded to 3.4.alpha1.
}
*
*/
class CRM_Upgrade_Incremental_php_ThreeFour {
+ /**
+ * @param $errors
+ *
+ * @return bool
+ */
function verifyPreDBstate(&$errors) {
return TRUE;
}
+ /**
+ * @param $rev
+ */
function upgrade_3_4_alpha3($rev) {
// CRM-7681, update report instance criteria.
$modifiedReportIds = array('contact/summary', 'contact/detail', 'event/participantListing', 'member/summary', 'pledge/summary', 'pledge/pbnp', 'member/detail', 'member/lapse', 'grant/detail', 'contribute/bookkeeping', 'contribute/lybunt', 'contribute/summary', 'contribute/repeat', 'contribute/detail', 'contribute/organizationSummary', 'contribute/sybunt', 'contribute/householdSummary', 'contact/relationship', 'contact/currentEmployer', 'case/demographics', 'walklist', 'case/detail', 'contact/log', 'activitySummary', 'case/timespent', 'case/summary');
$upgrade->processSQL($rev);
}
+ /**
+ * @param $rev
+ */
function upgrade_3_4_beta2($rev) {
$addPetitionOptionGroup = !(boolean) CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionGroup', 'msg_tpl_workflow_petition', 'id', 'name');
$upgrade = new CRM_Upgrade_Form();
$upgrade->processSQL($rev);
}
+ /**
+ * @param $rev
+ */
function upgrade_3_4_beta3($rev) {
// do the regular upgrade
$upgrade = new CRM_Upgrade_Form;
}
}
+ /**
+ * @param $rev
+ */
function upgrade_3_4_3($rev) {
// CRM-8147, update group_type for uf groups, check and add component field types
$ufGroups = new CRM_Core_DAO_UFGroup();
$upgrade->processSQL($rev);
}
+ /**
+ * @param $rev
+ */
function upgrade_3_4_4($rev) {
// CRM-8315, update report instance criteria.
$modifiedReportIds = array('member/summary', 'member/detail');
$upgrade->processSQL($rev);
}
+ /**
+ * @param $rev
+ */
function upgrade_3_4_5($rev) {
// handle db changes done for CRM-8218
$alterContactDashboard = FALSE;
$upgrade->processSQL($rev);
}
+ /**
+ * @param $rev
+ */
function upgrade_3_4_6($rev) {
$modifiedReportIds = array('event/summary', 'activity', 'Mailing/bounce', 'Mailing/clicks', 'Mailing/opened');
$upgrade->processSQL($rev);
}
+ /**
+ * @param $rev
+ *
+ * @throws Exception
+ */
function upgrade_3_4_7($rev) {
$onBehalfProfileId = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_UFGroup', 'on_behalf_organization', 'id', 'name');
if (!$onBehalfProfileId) {
*
*/
class CRM_Upgrade_Incremental_php_ThreeThree {
+ /**
+ * @param $errors
+ *
+ * @return bool
+ */
function verifyPreDBstate(&$errors) {
return TRUE;
}
+ /**
+ * @param $rev
+ */
function upgrade_3_3_alpha1($rev) {
$config = CRM_Core_Config::singleton();
if ($config->userSystem->is_drupal) {
// CRM_Core_BAO_ConfigSetting::add( $parambs );
}
+ /**
+ * @param $rev
+ */
function upgrade_3_3_beta1($rev) {
$upgrade = new CRM_Upgrade_Form();
$upgrade->processSQL($rev);
}
}
+ /**
+ * @param $rev
+ */
function upgrade_3_3_beta3($rev) {
// get the duplicate Ids of line item entries
$dupeLineItemIds = array();
$upgrade->processSQL($rev);
}
+ /**
+ * @param $rev
+ */
function upgrade_3_3_0($rev) {
$upgrade = new CRM_Upgrade_Form();
$upgrade->processSQL($rev);
}
}
+ /**
+ * @param $rev
+ */
function upgrade_3_3_2($rev) {
$dropMailingIndex = FALSE;
$indexes = CRM_Core_DAO::executeQuery('SHOW INDEXES FROM civicrm_mailing_job');
$upgrade->processSQL($rev);
}
+ /**
+ * @param $rev
+ */
function upgrade_3_3_7($rev) {
$dao = new CRM_Contact_DAO_Contact();
$dbName = $dao->_database;
*
*/
class CRM_Upgrade_Incremental_php_ThreeTwo {
+ /**
+ * @param $errors
+ *
+ * @return bool
+ */
function verifyPreDBstate(&$errors) {
return TRUE;
}
+ /**
+ * @param $rev
+ */
function upgrade_3_2_alpha1($rev) {
//CRM-5666 -if user already have 'access CiviCase'
//give all new permissions and drop access CiviCase.
$upgrade->processSQL($rev);
}
+ /**
+ * @param $rev
+ */
function upgrade_3_2_beta4($rev) {
$upgrade = new CRM_Upgrade_Form;
}
}
+ /**
+ * @param $rev
+ */
function upgrade_3_2_1($rev) {
//CRM-6565 check if Activity Index is already exists or not.
$addActivityTypeIndex = TRUE;
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
*/
+
+/**
+ * Class CRM_Upgrade_Page_Cleanup
+ */
class CRM_Upgrade_Page_Cleanup extends CRM_Core_Page {
public function cleanup425() {
$rows = CRM_Upgrade_Incremental_php_FourTwo::deleteInvalidPairs();
return $options[$fieldId];
}
+ /**
+ * @param $optionLabel
+ * @param $fid
+ *
+ * @return mixed
+ */
public static function getOptionId($optionLabel, $fid) {
if (!$optionLabel || !$fid) {
return;
return NULL;
}
+ /**
+ * @return array
+ */
static function &htmlTypes() {
static $htmlTypes = NULL;
if (!$htmlTypes) {
return $result;
}
+ /**
+ * @param $entityId
+ * @param string $entityTable
+ * @param $amount
+ * @param null $otherParams
+ */
public static function syncLineItems($entityId, $entityTable = 'civicrm_contribution', $amount, $otherParams = NULL) {
if (!$entityId || CRM_Utils_System::isNull($amount))
return;
return $setTree;
}
+ /**
+ * @param $form
+ * @param $id
+ * @param string $entityTable
+ * @param bool $validOnly
+ * @param null $priceSetId
+ *
+ * @return bool|false|int|null
+ */
static function initSet(&$form, $id, $entityTable = 'civicrm_event', $validOnly = FALSE, $priceSetId = NULL) {
if (!$priceSetId) {
$priceSetId = self::getFor($entityTable, $id);
return FALSE;
}
+ /**
+ * @param $fields
+ * @param $params
+ * @param $lineItem
+ */
static function processAmount(&$fields, &$params, &$lineItem) {
// using price set
$totalPrice = 0;
return $pricesetFieldCount[$sid];
}
-public static function getMembershipCount($ids) {
+ /**
+ * @param $ids
+ *
+ * @return array
+ */public static function getMembershipCount($ids) {
$queryString = "
SELECT count( pfv.id ) AS count, pfv.id AS id
FROM civicrm_price_field_value pfv
return array($dao->duration_interval, $dao->duration_unit);
}
+ /**
+ * @return object
+ */
static function eventPriceSetDomainID() {
return CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::MULTISITE_PREFERENCES_NAME,
'event_price_set_domain_id',
*/
require_once 'CRM/Core/DAO.php';
require_once 'CRM/Utils/Type.php';
+
+/**
+ * Class CRM_Upgrade_Snapshot_V4p2_Price_DAO_Field
+ */
class CRM_Upgrade_Snapshot_V4p2_Price_DAO_Field extends CRM_Core_DAO
{
/**
*/
require_once 'CRM/Core/DAO.php';
require_once 'CRM/Utils/Type.php';
+
+/**
+ * Class CRM_Upgrade_Snapshot_V4p2_Price_DAO_FieldValue
+ */
class CRM_Upgrade_Snapshot_V4p2_Price_DAO_FieldValue extends CRM_Core_DAO
{
/**
*/
require_once 'CRM/Core/DAO.php';
require_once 'CRM/Utils/Type.php';
+
+/**
+ * Class CRM_Upgrade_Snapshot_V4p2_Price_DAO_LineItem
+ */
class CRM_Upgrade_Snapshot_V4p2_Price_DAO_LineItem extends CRM_Core_DAO
{
/**
*/
require_once 'CRM/Core/DAO.php';
require_once 'CRM/Utils/Type.php';
+
+/**
+ * Class CRM_Upgrade_Snapshot_V4p2_Price_DAO_Set
+ */
class CRM_Upgrade_Snapshot_V4p2_Price_DAO_Set extends CRM_Core_DAO
{
/**
*/
require_once 'CRM/Core/DAO.php';
require_once 'CRM/Utils/Type.php';
+
+/**
+ * Class CRM_Upgrade_Snapshot_V4p2_Price_DAO_SetEntity
+ */
class CRM_Upgrade_Snapshot_V4p2_Price_DAO_SetEntity extends CRM_Core_DAO
{
/**
*
*/
class CRM_Upgrade_ThreeOne_ThreeOne extends CRM_Upgrade_Form {
+ /**
+ * @param $errorMessage
+ *
+ * @return bool
+ */
function verifyPreDBState(&$errorMessage) {
$latestVer = CRM_Utils_System::version();
return TRUE;
}
+ /**
+ * @param $rev
+ */
function upgrade($rev) {
$upgrade = new CRM_Upgrade_Form();
*
*/
class CRM_Upgrade_ThreeZero_ThreeZero extends CRM_Upgrade_Form {
+ /**
+ * @param $errorMessage
+ *
+ * @return bool
+ */
function verifyPreDBState(&$errorMessage) {
$latestVer = CRM_Utils_System::version();
return TRUE;
}
+ /**
+ * @param $rev
+ */
function upgrade($rev) {
// fix CRM-5270: if civicrm_report_instance.description is localised,
*
*/
class CRM_Upgrade_TwoOne_Controller extends CRM_Upgrade_Controller {
+ /**
+ * @return array
+ */
function &getPages() {
$pages = array(
'CRM_Upgrade_TwoOne_Form_Step1' => NULL,
*
*/
class CRM_Upgrade_TwoOne_Form_Step1 extends CRM_Upgrade_Form {
+ /**
+ * @param $errorMessage
+ *
+ * @return bool
+ */
function verifyPreDBState(&$errorMessage) {
$config = CRM_Core_Config::singleton();
$this->setVersion('2.01');
}
+ /**
+ * @param $errorMessage
+ *
+ * @return bool
+ */
function verifyPostDBState(&$errorMessage) {
$errorMessage = ts('Post-condition failed for upgrade step %1.', array(1 => '1'));
return $this->checkVersion('2.01');
}
+ /**
+ * @return string
+ */
function getTitle() {
return ts('CiviCRM 2.1 Upgrade: Step One (Domain Ids)');
}
+ /**
+ * @return string
+ */
function getTemplateMessage() {
$msg = '<p><strong>' . ts('This process will upgrade your v2.0 CiviCRM database to the v2.1 database format.') . '</strong></p><div class="messsages status"><ul><li><strong>' . ts('Make sure you have a current and complete backup of your CiviCRM database and codebase files before starting the upgrade process.') . '</strong></li><li>' . '</li></ul></div><p>' . ts('Click <strong>Begin Upgrade</strong> to begin the process.') . '</p>';
return $msg;
}
+ /**
+ * @return string
+ */
function getButtonTitle() {
return ts('Begin Upgrade');
}
*
*/
class CRM_Upgrade_TwoOne_Form_Step2 extends CRM_Upgrade_Form {
+ /**
+ * @param $errorMessage
+ *
+ * @return bool
+ */
function verifyPreDBState(&$errorMessage) {
$errorMessage = ts('Pre-condition failed for upgrade step %1.', array(1 => '2'));
$this->setVersion('2.02');
}
+ /**
+ * @param $errorMessage
+ *
+ * @return bool
+ */
function verifyPostDBState(&$errorMessage) {
// check if Option Group & Option Values tables exists
if (!CRM_Core_DAO::checkTableExists('civicrm_option_group') ||
return $this->checkVersion('2.02');
}
+ /**
+ * @return string
+ */
function getTitle() {
return ts('CiviCRM 2.1 Upgrade: Step Two (Option Group And Values)');
}
+ /**
+ * @return string
+ */
function getTemplateMessage() {
return '<p>' . ts('Step Two will upgrade the Option Group And Values in your database.') . '</p>';
}
+ /**
+ * @return string
+ */
function getButtonTitle() {
return ts('Upgrade & Continue');
}
*
*/
class CRM_Upgrade_TwoOne_Form_Step3 extends CRM_Upgrade_Form {
+ /**
+ * @param $errorMessage
+ *
+ * @return bool
+ */
function verifyPreDBState(&$errorMessage) {
$errorMessage = ts('Pre-condition failed for upgrade step %1.', array(1 => '3'));
$this->setVersion('2.03');
}
+ /**
+ * @param $errorMessage
+ *
+ * @return bool
+ */
function verifyPostDBState(&$errorMessage) {
if (!CRM_Core_DAO::checkTableExists('civicrm_cache') ||
!CRM_Core_DAO::checkTableExists('civicrm_discount') ||
return $this->checkVersion('2.03');
}
+ /**
+ * @return string
+ */
function getTitle() {
return ts('CiviCRM 2.1 Upgrade: Step Three (Miscellaneous)');
}
+ /**
+ * @return string
+ */
function getTemplateMessage() {
return '<p>' . ts('Step Three will upgrade rest of your database.') . '</p>';
}
+ /**
+ * @return string
+ */
function getButtonTitle() {
return ts('Upgrade & Continue');
}
*
*/
class CRM_Upgrade_TwoOne_Form_Step4 extends CRM_Upgrade_Form {
+ /**
+ * @param $errorMessage
+ *
+ * @return bool
+ */
function verifyPreDBState(&$errorMessage) {
$errorMessage = ts('Pre-condition failed for upgrade step %1.', array(1 => '2'));
function buildQuickForm() {}
+ /**
+ * @return string
+ */
function getTitle() {
return ts('Database Upgrade to v2.1 Completed');
}
+ /**
+ * @return string
+ */
function getTemplateMessage() {
if ($this->_config->userSystem->is_drupal) {
$upgradeDoc = 'http://wiki.civicrm.org/confluence/x/7IFH';
*
*/
class CRM_Upgrade_TwoOne_Form_TwoOneTwo extends CRM_Upgrade_Form {
+ /**
+ * @param null|object $version
+ */
function __construct($version) {
parent::__construct();
$this->latestVersion = $version;
}
+ /**
+ * @param $errorMessage
+ *
+ * @return bool
+ */
function verifyPreDBState(&$errorMessage) {
$errorMessage = ts('Pre-condition failed for upgrade to 2.1.2.');
// check if the db is 2.2
$this->setVersion($this->latestVersion);
}
+ /**
+ * @param $errorMessage
+ *
+ * @return bool
+ */
function verifyPostDBState(&$errorMessage) {
$errorMessage = ts('Post-condition failed for upgrade to 2.1.2.');
return $this->checkVersion($this->latestVersion);
echo $contents;
}
+ /**
+ * @param $stepID
+ *
+ * @throws Exception
+ */
function runForm($stepID) {
$formName = "CRM_Upgrade_TwoOne_Form_Step{$stepID}";
$form = new $formName();
*
*/
class CRM_Upgrade_TwoTwo_Controller extends CRM_Upgrade_Controller {
+ /**
+ * @return array
+ */
function &getPages() {
$pages = array(
'CRM_Upgrade_TwoTwo_Form_Step1' => NULL,
*
*/
class CRM_Upgrade_TwoTwo_Form_Step1 extends CRM_Upgrade_Form {
+ /**
+ * @param $errorMessage
+ *
+ * @return bool
+ */
function verifyPreDBState(&$errorMessage) {
// check if log file is writable
$config = CRM_Core_Config::singleton();
$this->setVersion('2.1.101');
}
+ /**
+ * @param $errorMessage
+ *
+ * @return bool
+ */
function verifyPostDBState(&$errorMessage) {
$errorMessage = ts('Post-condition failed for upgrade step %1.', array(1 => '1'));
return $this->checkVersion('2.1.101');
}
+ /**
+ * @return string
+ */
function getTitle() {
return ts('CiviCRM 2.2 Upgrade: Step One (Check Version)');
}
+ /**
+ * @return string
+ */
function getTemplateMessage() {
$msg = '<p><strong>' . ts('This process will upgrade your v2.1 CiviCRM database to the v2.2 database format.') . '</strong></p><div class="messsages status"><ul><li><strong>' . ts('Make sure you have a current and complete backup of your CiviCRM database and codebase files before starting the upgrade process.') . '</strong></li><li>' . '</li></ul></div><p>' . ts('Click <strong>Begin Upgrade</strong> to begin the process.') . '</p>';
return $msg;
}
+ /**
+ * @return string
+ */
function getButtonTitle() {
return ts('Begin Upgrade');
}
*
*/
class CRM_Upgrade_TwoTwo_Form_Step2 extends CRM_Upgrade_Form {
+ /**
+ * @param $errorMessage
+ *
+ * @return bool
+ */
function verifyPreDBState(&$errorMessage) {
$errorMessage = ts('Pre-condition failed for upgrade step %1.', array(1 => '2'));
$this->setVersion('2.1.102');
}
+ /**
+ * @param $errorMessage
+ *
+ * @return bool
+ */
function verifyPostDBState(&$errorMessage) {
// check if civicrm_event_page tables droped
if (CRM_Core_DAO::checkTableExists('civicrm_event_page')) {
return $this->checkVersion('2.1.102');
}
+ /**
+ * @return string
+ */
function getTitle() {
return ts('CiviCRM 2.2 Upgrade: Step Two (Merge CiviEvent Tables)');
}
+ /**
+ * @return string
+ */
function getTemplateMessage() {
return '<p>' . ts('Step Two will merge the table EventPage into Event table in your database.') . '</p>';
}
+ /**
+ * @return string
+ */
function getButtonTitle() {
return ts('Upgrade & Continue');
}
*
*/
class CRM_Upgrade_TwoTwo_Form_Step3 extends CRM_Upgrade_Form {
+ /**
+ * @param $errorMessage
+ *
+ * @return bool
+ */
function verifyPreDBState(&$errorMessage) {
$errorMessage = ts('Pre-condition failed for upgrade step %1.', array(1 => '3'));
return $this->checkVersion('2.1.102');
$this->setVersion('2.1.103');
}
+ /**
+ * @param $errorMessage
+ *
+ * @return bool
+ */
function verifyPostDBState(&$errorMessage) {
// check if Option Group & Option Values tables exists
if (!CRM_Core_DAO::checkTableExists('civicrm_option_group') ||
return $this->checkVersion('2.1.103');
}
+ /**
+ * @return string
+ */
function getTitle() {
return ts('CiviCRM 2.2 Upgrade: Step Three (Option Group And Values)');
}
+ /**
+ * @return string
+ */
function getTemplateMessage() {
return '<p>' . ts('Step Three will upgrade the Option Group And Values in your database.') . '</p>';
}
+ /**
+ * @return string
+ */
function getButtonTitle() {
return ts('Upgrade & Continue');
}
*
*/
class CRM_Upgrade_TwoTwo_Form_Step4 extends CRM_Upgrade_Form {
+ /**
+ * @param $errorMessage
+ *
+ * @return bool
+ */
function verifyPreDBState(&$errorMessage) {
$errorMessage = ts('Pre-condition failed for upgrade step %1.', array(1 => '4'));
function buildQuickForm() {}
+ /**
+ * @return string
+ */
function getTitle() {
return ts('Database Upgrade to v2.2 Completed');
}
+ /**
+ * @return string
+ */
function getTemplateMessage() {
$upgradeDoc = CRM_Utils_System::docURL2('Installation and Upgrades', TRUE, NULL, NULL, NULL, "wiki");
return '<p><strong>' . ts('Your CiviCRM database has been successfully upgraded to v2.2.') . '</strong></p><p>' . ts('Please be sure to follow the remaining steps in the upgrade instructions specific to your version of CiviCRM: %1.', array(