From 624e56fad5612855504bcfdc414a473d94e142b4 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Sat, 24 May 2014 13:29:33 +1200 Subject: [PATCH] CRM/Upgrade add missing comment blocks --- CRM/UF/Form/AbstractPreview.php | 9 ++ CRM/UF/Page/Group.php | 9 ++ CRM/Upgrade/Form.php | 113 ++++++++++++++++++ CRM/Upgrade/Incremental/Legacy.php | 6 + CRM/Upgrade/Incremental/php/FourFive.php | 10 ++ CRM/Upgrade/Incremental/php/FourFour.php | 31 +++++ CRM/Upgrade/Incremental/php/FourOne.php | 23 ++++ CRM/Upgrade/Incremental/php/FourThree.php | 49 ++++++++ CRM/Upgrade/Incremental/php/FourTwo.php | 32 +++++ CRM/Upgrade/Incremental/php/FourZero.php | 8 ++ CRM/Upgrade/Incremental/php/ThreeFour.php | 31 +++++ CRM/Upgrade/Incremental/php/ThreeThree.php | 23 ++++ CRM/Upgrade/Incremental/php/ThreeTwo.php | 14 +++ CRM/Upgrade/Page/Cleanup.php | 4 + CRM/Upgrade/Snapshot/V4p2/Price/BAO/Field.php | 9 ++ .../Snapshot/V4p2/Price/BAO/LineItem.php | 6 + CRM/Upgrade/Snapshot/V4p2/Price/BAO/Set.php | 23 +++- CRM/Upgrade/Snapshot/V4p2/Price/DAO/Field.php | 4 + .../Snapshot/V4p2/Price/DAO/FieldValue.php | 4 + .../Snapshot/V4p2/Price/DAO/LineItem.php | 4 + CRM/Upgrade/Snapshot/V4p2/Price/DAO/Set.php | 4 + .../Snapshot/V4p2/Price/DAO/SetEntity.php | 4 + CRM/Upgrade/ThreeOne/ThreeOne.php | 8 ++ CRM/Upgrade/ThreeZero/ThreeZero.php | 8 ++ CRM/Upgrade/TwoOne/Controller.php | 3 + CRM/Upgrade/TwoOne/Form/Step1.php | 19 +++ CRM/Upgrade/TwoOne/Form/Step2.php | 19 +++ CRM/Upgrade/TwoOne/Form/Step3.php | 19 +++ CRM/Upgrade/TwoOne/Form/Step4.php | 11 ++ CRM/Upgrade/TwoOne/Form/TwoOneTwo.php | 13 ++ CRM/Upgrade/TwoOne/Page/Upgrade.php | 5 + CRM/Upgrade/TwoTwo/Controller.php | 3 + CRM/Upgrade/TwoTwo/Form/Step1.php | 19 +++ CRM/Upgrade/TwoTwo/Form/Step2.php | 19 +++ CRM/Upgrade/TwoTwo/Form/Step3.php | 19 +++ CRM/Upgrade/TwoTwo/Form/Step4.php | 11 ++ 36 files changed, 595 insertions(+), 1 deletion(-) diff --git a/CRM/UF/Form/AbstractPreview.php b/CRM/UF/Form/AbstractPreview.php index 69be70a702..6f1d8fb04f 100644 --- a/CRM/UF/Form/AbstractPreview.php +++ b/CRM/UF/Form/AbstractPreview.php @@ -124,6 +124,15 @@ class CRM_UF_Form_AbstractPreview extends CRM_Core_Form { } } + /** + * 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'; } diff --git a/CRM/UF/Page/Group.php b/CRM/UF/Page/Group.php index 8d3c3c5e27..184a07a08a 100644 --- a/CRM/UF/Page/Group.php +++ b/CRM/UF/Page/Group.php @@ -400,6 +400,10 @@ class CRM_UF_Page_Group extends CRM_Core_Page { $controller->run(); } + /** + * @param $id + * @param $action + */ function setContext($id, $action) { $context = CRM_Utils_Request::retrieve('context', 'String', $this); @@ -419,6 +423,11 @@ class CRM_UF_Page_Group extends CRM_Core_Page { $session->pushUserContext($url); } + /** + * @param $groupType + * + * @return array + */ static function extractGroupTypes($groupType) { $returnGroupTypes = array(); if (!$groupType) { diff --git a/CRM/Upgrade/Form.php b/CRM/Upgrade/Form.php index e6fa97e301..bd2413619d 100644 --- a/CRM/Upgrade/Form.php +++ b/CRM/Upgrade/Form.php @@ -83,6 +83,26 @@ class CRM_Upgrade_Form extends CRM_Core_Form { 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', @@ -114,6 +134,11 @@ class CRM_Upgrade_Form extends CRM_Core_Form { parent::__construct($state, $action, $method, $name); } + /** + * @param $version + * + * @return mixed + */ static function &incrementalPhpObject($version) { static $incrementalPhpObject = array(); @@ -127,6 +152,12 @@ class CRM_Upgrade_Form extends CRM_Core_Form { return $incrementalPhpObject[$versionName]; } + /** + * @param $version + * @param $release + * + * @return bool + */ function checkVersionRelease($version, $release) { $versionParts = explode('.', $version); if ($versionParts[2] == $release) { @@ -135,6 +166,11 @@ class CRM_Upgrade_Form extends CRM_Core_Form { return FALSE; } + /** + * @param $constraints + * + * @return array + */ function checkSQLConstraints(&$constraints) { $pass = $fail = 0; foreach ($constraints as $constraint) { @@ -148,11 +184,20 @@ class CRM_Upgrade_Form extends CRM_Core_Form { } } + /** + * @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, @@ -179,18 +224,42 @@ class CRM_Upgrade_Form extends CRM_Core_Form { ); } + /** + * 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() @@ -212,12 +281,22 @@ class CRM_Upgrade_Form extends CRM_Core_Form { } } + /** + * @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); @@ -228,6 +307,11 @@ SET version = '$version' return $this->runQuery($query); } + /** + * @param $newVersion + * + * @return bool + */ function logVersion($newVersion) { if ($newVersion) { $oldVersion = CRM_Core_BAO_Domain::version(); @@ -248,6 +332,11 @@ SET version = '$version' return FALSE; } + /** + * @param $version + * + * @return bool + */ function checkVersion($version) { $domainID = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_Domain', $version, 'id', @@ -256,6 +345,10 @@ SET version = '$version' return $domainID ? TRUE : FALSE; } + /** + * @return array + * @throws Exception + */ function getRevisionSequence() { $revList = array(); $sqlDir = implode(DIRECTORY_SEPARATOR, @@ -286,6 +379,12 @@ SET version = '$version' 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); @@ -293,6 +392,12 @@ SET version = '$version' 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()); @@ -305,12 +410,20 @@ SET version = '$version' 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( diff --git a/CRM/Upgrade/Incremental/Legacy.php b/CRM/Upgrade/Incremental/Legacy.php index 26f8904995..c6e1da861e 100644 --- a/CRM/Upgrade/Incremental/Legacy.php +++ b/CRM/Upgrade/Incremental/Legacy.php @@ -112,6 +112,12 @@ SELECT id } } + /** + * @param $template + * @param $message + * @param $latestVer + * @param $currentVer + */ static function checkMessageTemplate(&$template, &$message, $latestVer, $currentVer) { if (version_compare($currentVer, '3.1.alpha1') < 0) { return; diff --git a/CRM/Upgrade/Incremental/php/FourFive.php b/CRM/Upgrade/Incremental/php/FourFive.php index caf71b2f32..7e9662847c 100644 --- a/CRM/Upgrade/Incremental/php/FourFive.php +++ b/CRM/Upgrade/Incremental/php/FourFive.php @@ -34,6 +34,11 @@ class CRM_Upgrade_Incremental_php_FourFive { const BATCH_SIZE = 5000; + /** + * @param $errors + * + * @return bool + */ function verifyPreDBstate(&$errors) { return TRUE; } @@ -69,6 +74,11 @@ class CRM_Upgrade_Incremental_php_FourFive { } } + /** + * @param $rev + * + * @return bool + */ function upgrade_4_5_alpha1($rev) { // task to process sql $this->addTask(ts('Migrate honoree information to module_data'), 'migrateHonoreeInfo'); diff --git a/CRM/Upgrade/Incremental/php/FourFour.php b/CRM/Upgrade/Incremental/php/FourFour.php index e8c705767d..52080bc282 100644 --- a/CRM/Upgrade/Incremental/php/FourFour.php +++ b/CRM/Upgrade/Incremental/php/FourFour.php @@ -36,6 +36,11 @@ class CRM_Upgrade_Incremental_php_FourFour { const MAX_WORD_REPLACEMENT_SIZE = 255; + /** + * @param $errors + * + * @return bool + */ function verifyPreDBstate(&$errors) { return TRUE; } @@ -103,6 +108,11 @@ WHERE ceft.entity_table = 'civicrm_contribution' AND cft.payment_instrument_id I } } + /** + * @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); @@ -113,6 +123,9 @@ WHERE ceft.entity_table = 'civicrm_contribution' AND cft.payment_instrument_id I 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); @@ -139,6 +152,9 @@ WHERE ceft.entity_table = 'civicrm_contribution' AND cft.payment_instrument_id I $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 @@ -236,6 +252,11 @@ VALUES {$insertStatus}"; $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')) { @@ -310,6 +331,9 @@ ALTER TABLE civicrm_dashboard 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'); @@ -320,6 +344,13 @@ ALTER TABLE civicrm_dashboard } } + /** + * @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); diff --git a/CRM/Upgrade/Incremental/php/FourOne.php b/CRM/Upgrade/Incremental/php/FourOne.php index 4dc2710ba7..b25de5da6a 100644 --- a/CRM/Upgrade/Incremental/php/FourOne.php +++ b/CRM/Upgrade/Incremental/php/FourOne.php @@ -36,6 +36,11 @@ class CRM_Upgrade_Incremental_php_FourOne { // 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)) { @@ -66,6 +71,9 @@ class CRM_Upgrade_Incremental_php_FourOne { } } + /** + * @param $rev + */ function upgrade_4_1_alpha1($rev) { $config = CRM_Core_Config::singleton(); if (in_array('CiviCase', $config->enableComponents)) { @@ -271,6 +279,9 @@ VALUES CRM_Core_DAO::executeQuery($sql); } + /** + * @param $params + */ static function retrieveDirectoryAndURLPaths(&$params) { $sql = " @@ -296,6 +307,9 @@ AND v.is_active = 1 } } + /** + * @param $rev + */ function upgrade_4_1_alpha2($rev) { $dao = new CRM_Core_DAO_Setting(); $dao->group_name = 'Directory Preferences'; @@ -313,6 +327,9 @@ AND v.is_active = 1 $upgrade->processSQL($rev); } + /** + * @param $rev + */ function upgrade_4_1_beta1($rev) { //CRM-9311 $groupNames = array('directory_preferences', 'url_preferences'); @@ -389,6 +406,9 @@ AND v.is_active = 1 $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'))); @@ -399,6 +419,9 @@ AND v.is_active = 1 $upgrade->processSQL($rev); } + /** + * @return string + */ function getTemplateMessage() { return "Blah"; } diff --git a/CRM/Upgrade/Incremental/php/FourThree.php b/CRM/Upgrade/Incremental/php/FourThree.php index 42c9a5cf38..fe76aee539 100644 --- a/CRM/Upgrade/Incremental/php/FourThree.php +++ b/CRM/Upgrade/Incremental/php/FourThree.php @@ -35,6 +35,11 @@ class CRM_Upgrade_Incremental_php_FourThree { const BATCH_SIZE = 5000; + /** + * @param $errors + * + * @return bool + */ function verifyPreDBstate(&$errors) { return TRUE; } @@ -236,6 +241,11 @@ WHERE ccp.financial_type_id IS NULL and cp.cost > 0'); } } + /** + * @param $rev + * + * @return bool + */ function upgrade_4_3_alpha1($rev) { self::task_4_3_alpha1_checkDBConstraints(); @@ -271,6 +281,9 @@ WHERE ccp.financial_type_id IS NULL and cp.cost > 0'); return TRUE; } + /** + * @param $rev + */ function upgrade_4_3_alpha2($rev) { //CRM-11847 $isColumnPresent = CRM_Core_DAO::checkFieldExists('civicrm_dedupe_rule_group', 'is_default'); @@ -280,10 +293,16 @@ WHERE ccp.financial_type_id IS NULL and cp.cost > 0'); $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); @@ -296,6 +315,9 @@ WHERE ccp.financial_type_id IS NULL and cp.cost > 0'); } } + /** + * @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 @@ -305,6 +327,9 @@ WHERE ccp.financial_type_id IS NULL and cp.cost > 0'); $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 @@ -312,6 +337,9 @@ WHERE ccp.financial_type_id IS NULL and cp.cost > 0'); $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 ( @@ -336,10 +364,16 @@ ADD COLUMN premiums_nothankyou_label varchar(255) COLLATE utf8_unicode_ci DEFA $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(); @@ -365,6 +399,9 @@ ADD CONSTRAINT `FK_civicrm_financial_item_contact_id` FOREIGN KEY (`contact_id`) $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); @@ -378,6 +415,9 @@ ADD CONSTRAINT `FK_civicrm_financial_item_contact_id` FOREIGN KEY (`contact_id`) } //CRM-11636 + /** + * @return bool + */ function assignFinancialTypeToPriceRecords() { $upgrade = new CRM_Upgrade_Form(); //here we update price set entries @@ -419,6 +459,9 @@ INNER JOIN civicrm_price_set ps ON (pf.price_set_id = ps.id) return TRUE; } + /** + * @return bool + */ static function _checkAndMigrateDefaultFinancialTypes() { $modifiedDefaults = FALSE; //insert types if not exists @@ -448,6 +491,9 @@ ON DUPLICATE KEY UPDATE is_active = 1 return $modifiedDefaults; } + /** + * @return bool + */ function createFinancialRecords() { $upgrade = new CRM_Upgrade_Form(); @@ -789,6 +835,9 @@ FROM civicrm_financial_item fi"; return TRUE; } + /** + * @return array + */ function createDomainContacts() { $domainParams = $context = array(); $query = " diff --git a/CRM/Upgrade/Incremental/php/FourTwo.php b/CRM/Upgrade/Incremental/php/FourTwo.php index e72b43c60f..b85943a4b1 100644 --- a/CRM/Upgrade/Incremental/php/FourTwo.php +++ b/CRM/Upgrade/Incremental/php/FourTwo.php @@ -37,6 +37,11 @@ class CRM_Upgrade_Incremental_php_FourTwo { 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; } @@ -160,6 +165,9 @@ INNER JOIN civicrm_price_set cps ON cps.id = cpf.price_set_id AND cps.name <>'de } } + /** + * @param $rev + */ function upgrade_4_2_alpha1($rev) { //checking whether the foreign key exists before dropping it //drop foreign key queries of CRM-9850 @@ -203,6 +211,9 @@ INNER JOIN civicrm_price_set cps ON cps.id = cpf.price_set_id AND cps.name <>'de $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')) { @@ -214,6 +225,9 @@ INNER JOIN civicrm_price_set cps ON cps.id = cpf.price_set_id AND cps.name <>'de } } + /** + * @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'); @@ -226,6 +240,9 @@ INNER JOIN civicrm_price_set cps ON cps.id = cpf.price_set_id AND cps.name <>'de } } + /** + * @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 @@ -235,10 +252,16 @@ INNER JOIN civicrm_price_set cps ON cps.id = cpf.price_set_id AND cps.name <>'de "); } + /** + * @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 @@ -276,6 +299,9 @@ INNER JOIN civicrm_price_set cps ON cps.id = cpf.price_set_id AND cps.name <>'de } } + /** + * @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 @@ -315,6 +341,9 @@ DELETE from civicrm_option_value } } + /** + * @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 @@ -861,6 +890,9 @@ VALUES $queue->createItem($task, array('weight' => -1)); } + /** + * @return array + */ public static function deleteInvalidPairs() { require_once 'CRM/Member/PseudoConstant.php'; require_once 'CRM/Contribute/PseudoConstant.php'; diff --git a/CRM/Upgrade/Incremental/php/FourZero.php b/CRM/Upgrade/Incremental/php/FourZero.php index 2ba61ff51c..3e7dff4d90 100644 --- a/CRM/Upgrade/Incremental/php/FourZero.php +++ b/CRM/Upgrade/Incremental/php/FourZero.php @@ -33,10 +33,18 @@ * */ 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. } diff --git a/CRM/Upgrade/Incremental/php/ThreeFour.php b/CRM/Upgrade/Incremental/php/ThreeFour.php index c99730417c..309f079a1a 100644 --- a/CRM/Upgrade/Incremental/php/ThreeFour.php +++ b/CRM/Upgrade/Incremental/php/ThreeFour.php @@ -32,10 +32,18 @@ * */ 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'); @@ -99,6 +107,9 @@ class CRM_Upgrade_Incremental_php_ThreeFour { $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(); @@ -106,6 +117,9 @@ class CRM_Upgrade_Incremental_php_ThreeFour { $upgrade->processSQL($rev); } + /** + * @param $rev + */ function upgrade_3_4_beta3($rev) { // do the regular upgrade $upgrade = new CRM_Upgrade_Form; @@ -130,6 +144,9 @@ class CRM_Upgrade_Incremental_php_ThreeFour { } } + /** + * @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(); @@ -171,6 +188,9 @@ INSERT INTO civicrm_location_type ( name, description, is_reserved, is_active ) $upgrade->processSQL($rev); } + /** + * @param $rev + */ function upgrade_3_4_4($rev) { // CRM-8315, update report instance criteria. $modifiedReportIds = array('member/summary', 'member/detail'); @@ -204,6 +224,9 @@ INSERT INTO civicrm_location_type ( name, description, is_reserved, is_active ) $upgrade->processSQL($rev); } + /** + * @param $rev + */ function upgrade_3_4_5($rev) { // handle db changes done for CRM-8218 $alterContactDashboard = FALSE; @@ -225,6 +248,9 @@ INSERT INTO civicrm_location_type ( name, description, is_reserved, is_active ) $upgrade->processSQL($rev); } + /** + * @param $rev + */ function upgrade_3_4_6($rev) { $modifiedReportIds = array('event/summary', 'activity', 'Mailing/bounce', 'Mailing/clicks', 'Mailing/opened'); @@ -300,6 +326,11 @@ WHERE v.option_group_id = g.id $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) { diff --git a/CRM/Upgrade/Incremental/php/ThreeThree.php b/CRM/Upgrade/Incremental/php/ThreeThree.php index 33e4b8231b..73776bb75f 100644 --- a/CRM/Upgrade/Incremental/php/ThreeThree.php +++ b/CRM/Upgrade/Incremental/php/ThreeThree.php @@ -33,10 +33,18 @@ * */ 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) { @@ -126,6 +134,9 @@ WHERE id = %2 // CRM_Core_BAO_ConfigSetting::add( $parambs ); } + /** + * @param $rev + */ function upgrade_3_3_beta1($rev) { $upgrade = new CRM_Upgrade_Form(); $upgrade->processSQL($rev); @@ -240,6 +251,9 @@ WHERE id = %2 } } + /** + * @param $rev + */ function upgrade_3_3_beta3($rev) { // get the duplicate Ids of line item entries $dupeLineItemIds = array(); @@ -268,6 +282,9 @@ WHERE id = %2 $upgrade->processSQL($rev); } + /** + * @param $rev + */ function upgrade_3_3_0($rev) { $upgrade = new CRM_Upgrade_Form(); $upgrade->processSQL($rev); @@ -305,6 +322,9 @@ INNER JOIN civicrm_option_group grp ON ( grp.id = val.option_group_id ) } } + /** + * @param $rev + */ function upgrade_3_3_2($rev) { $dropMailingIndex = FALSE; $indexes = CRM_Core_DAO::executeQuery('SHOW INDEXES FROM civicrm_mailing_job'); @@ -347,6 +367,9 @@ INNER JOIN civicrm_option_group grp ON ( grp.id = val.option_group_id ) $upgrade->processSQL($rev); } + /** + * @param $rev + */ function upgrade_3_3_7($rev) { $dao = new CRM_Contact_DAO_Contact(); $dbName = $dao->_database; diff --git a/CRM/Upgrade/Incremental/php/ThreeTwo.php b/CRM/Upgrade/Incremental/php/ThreeTwo.php index 0c68aacd06..1225de8743 100644 --- a/CRM/Upgrade/Incremental/php/ThreeTwo.php +++ b/CRM/Upgrade/Incremental/php/ThreeTwo.php @@ -32,10 +32,18 @@ * */ 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. @@ -79,6 +87,9 @@ class CRM_Upgrade_Incremental_php_ThreeTwo { $upgrade->processSQL($rev); } + /** + * @param $rev + */ function upgrade_3_2_beta4($rev) { $upgrade = new CRM_Upgrade_Form; @@ -250,6 +261,9 @@ UPDATE civicrm_membership_status } } + /** + * @param $rev + */ function upgrade_3_2_1($rev) { //CRM-6565 check if Activity Index is already exists or not. $addActivityTypeIndex = TRUE; diff --git a/CRM/Upgrade/Page/Cleanup.php b/CRM/Upgrade/Page/Cleanup.php index 0cb2610e53..b29871e301 100644 --- a/CRM/Upgrade/Page/Cleanup.php +++ b/CRM/Upgrade/Page/Cleanup.php @@ -24,6 +24,10 @@ | 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(); diff --git a/CRM/Upgrade/Snapshot/V4p2/Price/BAO/Field.php b/CRM/Upgrade/Snapshot/V4p2/Price/BAO/Field.php index a59152e560..3ff95f126d 100644 --- a/CRM/Upgrade/Snapshot/V4p2/Price/BAO/Field.php +++ b/CRM/Upgrade/Snapshot/V4p2/Price/BAO/Field.php @@ -475,6 +475,12 @@ class CRM_Upgrade_Snapshot_V4p2_Price_BAO_Field extends CRM_Upgrade_Snapshot_V4p return $options[$fieldId]; } + /** + * @param $optionLabel + * @param $fid + * + * @return mixed + */ public static function getOptionId($optionLabel, $fid) { if (!$optionLabel || !$fid) { return; @@ -531,6 +537,9 @@ WHERE return NULL; } + /** + * @return array + */ static function &htmlTypes() { static $htmlTypes = NULL; if (!$htmlTypes) { diff --git a/CRM/Upgrade/Snapshot/V4p2/Price/BAO/LineItem.php b/CRM/Upgrade/Snapshot/V4p2/Price/BAO/LineItem.php index a52d059009..21ea952992 100644 --- a/CRM/Upgrade/Snapshot/V4p2/Price/BAO/LineItem.php +++ b/CRM/Upgrade/Snapshot/V4p2/Price/BAO/LineItem.php @@ -254,6 +254,12 @@ WHERE %2.id = %1"; 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; diff --git a/CRM/Upgrade/Snapshot/V4p2/Price/BAO/Set.php b/CRM/Upgrade/Snapshot/V4p2/Price/BAO/Set.php index 50c950a3d7..7f915ac22c 100644 --- a/CRM/Upgrade/Snapshot/V4p2/Price/BAO/Set.php +++ b/CRM/Upgrade/Snapshot/V4p2/Price/BAO/Set.php @@ -553,6 +553,15 @@ WHERE id = %1"; 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); @@ -645,6 +654,11 @@ WHERE id = %1"; return FALSE; } + /** + * @param $fields + * @param $params + * @param $lineItem + */ static function processAmount(&$fields, &$params, &$lineItem) { // using price set $totalPrice = 0; @@ -1014,7 +1028,11 @@ $pricesetFieldCount[$sid] = ($count) ? $count : 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 @@ -1101,6 +1119,9 @@ return 0; 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', diff --git a/CRM/Upgrade/Snapshot/V4p2/Price/DAO/Field.php b/CRM/Upgrade/Snapshot/V4p2/Price/DAO/Field.php index 844bf0f897..52709e4e53 100644 --- a/CRM/Upgrade/Snapshot/V4p2/Price/DAO/Field.php +++ b/CRM/Upgrade/Snapshot/V4p2/Price/DAO/Field.php @@ -33,6 +33,10 @@ */ 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 { /** diff --git a/CRM/Upgrade/Snapshot/V4p2/Price/DAO/FieldValue.php b/CRM/Upgrade/Snapshot/V4p2/Price/DAO/FieldValue.php index 2e90a00be6..895d9a2b88 100644 --- a/CRM/Upgrade/Snapshot/V4p2/Price/DAO/FieldValue.php +++ b/CRM/Upgrade/Snapshot/V4p2/Price/DAO/FieldValue.php @@ -33,6 +33,10 @@ */ 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 { /** diff --git a/CRM/Upgrade/Snapshot/V4p2/Price/DAO/LineItem.php b/CRM/Upgrade/Snapshot/V4p2/Price/DAO/LineItem.php index 0ace871a34..d990cdb0de 100644 --- a/CRM/Upgrade/Snapshot/V4p2/Price/DAO/LineItem.php +++ b/CRM/Upgrade/Snapshot/V4p2/Price/DAO/LineItem.php @@ -33,6 +33,10 @@ */ 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 { /** diff --git a/CRM/Upgrade/Snapshot/V4p2/Price/DAO/Set.php b/CRM/Upgrade/Snapshot/V4p2/Price/DAO/Set.php index c6437c2e89..5645ae17b3 100644 --- a/CRM/Upgrade/Snapshot/V4p2/Price/DAO/Set.php +++ b/CRM/Upgrade/Snapshot/V4p2/Price/DAO/Set.php @@ -33,6 +33,10 @@ */ 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 { /** diff --git a/CRM/Upgrade/Snapshot/V4p2/Price/DAO/SetEntity.php b/CRM/Upgrade/Snapshot/V4p2/Price/DAO/SetEntity.php index 1589a9a8f8..aa01941372 100644 --- a/CRM/Upgrade/Snapshot/V4p2/Price/DAO/SetEntity.php +++ b/CRM/Upgrade/Snapshot/V4p2/Price/DAO/SetEntity.php @@ -33,6 +33,10 @@ */ 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 { /** diff --git a/CRM/Upgrade/ThreeOne/ThreeOne.php b/CRM/Upgrade/ThreeOne/ThreeOne.php index 99322dee77..ced7344120 100644 --- a/CRM/Upgrade/ThreeOne/ThreeOne.php +++ b/CRM/Upgrade/ThreeOne/ThreeOne.php @@ -33,6 +33,11 @@ * */ class CRM_Upgrade_ThreeOne_ThreeOne extends CRM_Upgrade_Form { + /** + * @param $errorMessage + * + * @return bool + */ function verifyPreDBState(&$errorMessage) { $latestVer = CRM_Utils_System::version(); @@ -101,6 +106,9 @@ class CRM_Upgrade_ThreeOne_ThreeOne extends CRM_Upgrade_Form { return TRUE; } + /** + * @param $rev + */ function upgrade($rev) { $upgrade = new CRM_Upgrade_Form(); diff --git a/CRM/Upgrade/ThreeZero/ThreeZero.php b/CRM/Upgrade/ThreeZero/ThreeZero.php index 8961aaa420..732250233b 100644 --- a/CRM/Upgrade/ThreeZero/ThreeZero.php +++ b/CRM/Upgrade/ThreeZero/ThreeZero.php @@ -33,6 +33,11 @@ * */ class CRM_Upgrade_ThreeZero_ThreeZero extends CRM_Upgrade_Form { + /** + * @param $errorMessage + * + * @return bool + */ function verifyPreDBState(&$errorMessage) { $latestVer = CRM_Utils_System::version(); @@ -84,6 +89,9 @@ class CRM_Upgrade_ThreeZero_ThreeZero extends CRM_Upgrade_Form { return TRUE; } + /** + * @param $rev + */ function upgrade($rev) { // fix CRM-5270: if civicrm_report_instance.description is localised, diff --git a/CRM/Upgrade/TwoOne/Controller.php b/CRM/Upgrade/TwoOne/Controller.php index 48ab1f466a..a1cd70e2c0 100644 --- a/CRM/Upgrade/TwoOne/Controller.php +++ b/CRM/Upgrade/TwoOne/Controller.php @@ -33,6 +33,9 @@ * */ class CRM_Upgrade_TwoOne_Controller extends CRM_Upgrade_Controller { + /** + * @return array + */ function &getPages() { $pages = array( 'CRM_Upgrade_TwoOne_Form_Step1' => NULL, diff --git a/CRM/Upgrade/TwoOne/Form/Step1.php b/CRM/Upgrade/TwoOne/Form/Step1.php index b23fe74fae..ed8eaf3493 100644 --- a/CRM/Upgrade/TwoOne/Form/Step1.php +++ b/CRM/Upgrade/TwoOne/Form/Step1.php @@ -33,6 +33,11 @@ * */ class CRM_Upgrade_TwoOne_Form_Step1 extends CRM_Upgrade_Form { + /** + * @param $errorMessage + * + * @return bool + */ function verifyPreDBState(&$errorMessage) { $config = CRM_Core_Config::singleton(); @@ -285,21 +290,35 @@ DROP domain_id;"; $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 = '

' . ts('This process will upgrade your v2.0 CiviCRM database to the v2.1 database format.') . '

' . ts('Click Begin Upgrade to begin the process.') . '

'; return $msg; } + /** + * @return string + */ function getButtonTitle() { return ts('Begin Upgrade'); } diff --git a/CRM/Upgrade/TwoOne/Form/Step2.php b/CRM/Upgrade/TwoOne/Form/Step2.php index fec7ac3a49..d12f7c87b2 100644 --- a/CRM/Upgrade/TwoOne/Form/Step2.php +++ b/CRM/Upgrade/TwoOne/Form/Step2.php @@ -33,6 +33,11 @@ * */ 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')); @@ -101,6 +106,11 @@ AND `label` IN ('html', 'htm') $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') || @@ -136,14 +146,23 @@ AND `label` IN ('html', 'htm') 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 '

' . ts('Step Two will upgrade the Option Group And Values in your database.') . '

'; } + /** + * @return string + */ function getButtonTitle() { return ts('Upgrade & Continue'); } diff --git a/CRM/Upgrade/TwoOne/Form/Step3.php b/CRM/Upgrade/TwoOne/Form/Step3.php index cc415593d0..8ef3d756fe 100644 --- a/CRM/Upgrade/TwoOne/Form/Step3.php +++ b/CRM/Upgrade/TwoOne/Form/Step3.php @@ -33,6 +33,11 @@ * */ 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')); @@ -80,6 +85,11 @@ class CRM_Upgrade_TwoOne_Form_Step3 extends CRM_Upgrade_Form { $this->setVersion('2.03'); } + /** + * @param $errorMessage + * + * @return bool + */ function verifyPostDBState(&$errorMessage) { if (!CRM_Core_DAO::checkTableExists('civicrm_cache') || !CRM_Core_DAO::checkTableExists('civicrm_discount') || @@ -111,14 +121,23 @@ class CRM_Upgrade_TwoOne_Form_Step3 extends CRM_Upgrade_Form { return $this->checkVersion('2.03'); } + /** + * @return string + */ function getTitle() { return ts('CiviCRM 2.1 Upgrade: Step Three (Miscellaneous)'); } + /** + * @return string + */ function getTemplateMessage() { return '

' . ts('Step Three will upgrade rest of your database.') . '

'; } + /** + * @return string + */ function getButtonTitle() { return ts('Upgrade & Continue'); } diff --git a/CRM/Upgrade/TwoOne/Form/Step4.php b/CRM/Upgrade/TwoOne/Form/Step4.php index 1b06c5bcaf..6607d972fa 100644 --- a/CRM/Upgrade/TwoOne/Form/Step4.php +++ b/CRM/Upgrade/TwoOne/Form/Step4.php @@ -33,6 +33,11 @@ * */ 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')); @@ -77,10 +82,16 @@ class CRM_Upgrade_TwoOne_Form_Step4 extends CRM_Upgrade_Form { 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'; diff --git a/CRM/Upgrade/TwoOne/Form/TwoOneTwo.php b/CRM/Upgrade/TwoOne/Form/TwoOneTwo.php index 44bb9cb74f..f9d3d3157f 100644 --- a/CRM/Upgrade/TwoOne/Form/TwoOneTwo.php +++ b/CRM/Upgrade/TwoOne/Form/TwoOneTwo.php @@ -33,11 +33,19 @@ * */ 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 @@ -138,6 +146,11 @@ AND civicrm_option_value.label = civicrm_participant.fee_level $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); diff --git a/CRM/Upgrade/TwoOne/Page/Upgrade.php b/CRM/Upgrade/TwoOne/Page/Upgrade.php index f49b21f9ec..6bfa980e2a 100644 --- a/CRM/Upgrade/TwoOne/Page/Upgrade.php +++ b/CRM/Upgrade/TwoOne/Page/Upgrade.php @@ -87,6 +87,11 @@ class CRM_Upgrade_TwoOne_Page_Upgrade extends CRM_Core_Page { echo $contents; } + /** + * @param $stepID + * + * @throws Exception + */ function runForm($stepID) { $formName = "CRM_Upgrade_TwoOne_Form_Step{$stepID}"; $form = new $formName(); diff --git a/CRM/Upgrade/TwoTwo/Controller.php b/CRM/Upgrade/TwoTwo/Controller.php index 6cb1a7b5f3..442c04804f 100644 --- a/CRM/Upgrade/TwoTwo/Controller.php +++ b/CRM/Upgrade/TwoTwo/Controller.php @@ -33,6 +33,9 @@ * */ class CRM_Upgrade_TwoTwo_Controller extends CRM_Upgrade_Controller { + /** + * @return array + */ function &getPages() { $pages = array( 'CRM_Upgrade_TwoTwo_Form_Step1' => NULL, diff --git a/CRM/Upgrade/TwoTwo/Form/Step1.php b/CRM/Upgrade/TwoTwo/Form/Step1.php index 05fcd354e5..8cac69728a 100644 --- a/CRM/Upgrade/TwoTwo/Form/Step1.php +++ b/CRM/Upgrade/TwoTwo/Form/Step1.php @@ -33,6 +33,11 @@ * */ 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(); @@ -174,21 +179,35 @@ class CRM_Upgrade_TwoTwo_Form_Step1 extends CRM_Upgrade_Form { $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 = '

' . ts('This process will upgrade your v2.1 CiviCRM database to the v2.2 database format.') . '

' . ts('Click Begin Upgrade to begin the process.') . '

'; return $msg; } + /** + * @return string + */ function getButtonTitle() { return ts('Begin Upgrade'); } diff --git a/CRM/Upgrade/TwoTwo/Form/Step2.php b/CRM/Upgrade/TwoTwo/Form/Step2.php index 2be294c8ab..3fa6e0f68d 100644 --- a/CRM/Upgrade/TwoTwo/Form/Step2.php +++ b/CRM/Upgrade/TwoTwo/Form/Step2.php @@ -33,6 +33,11 @@ * */ 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')); @@ -69,6 +74,11 @@ class CRM_Upgrade_TwoTwo_Form_Step2 extends CRM_Upgrade_Form { $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')) { @@ -106,14 +116,23 @@ class CRM_Upgrade_TwoTwo_Form_Step2 extends CRM_Upgrade_Form { 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 '

' . ts('Step Two will merge the table EventPage into Event table in your database.') . '

'; } + /** + * @return string + */ function getButtonTitle() { return ts('Upgrade & Continue'); } diff --git a/CRM/Upgrade/TwoTwo/Form/Step3.php b/CRM/Upgrade/TwoTwo/Form/Step3.php index 7d9abebc58..447b917742 100644 --- a/CRM/Upgrade/TwoTwo/Form/Step3.php +++ b/CRM/Upgrade/TwoTwo/Form/Step3.php @@ -33,6 +33,11 @@ * */ 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'); @@ -48,6 +53,11 @@ class CRM_Upgrade_TwoTwo_Form_Step3 extends CRM_Upgrade_Form { $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') || @@ -83,14 +93,23 @@ class CRM_Upgrade_TwoTwo_Form_Step3 extends CRM_Upgrade_Form { 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 '

' . ts('Step Three will upgrade the Option Group And Values in your database.') . '

'; } + /** + * @return string + */ function getButtonTitle() { return ts('Upgrade & Continue'); } diff --git a/CRM/Upgrade/TwoTwo/Form/Step4.php b/CRM/Upgrade/TwoTwo/Form/Step4.php index 2f763407bd..e83ca8705b 100644 --- a/CRM/Upgrade/TwoTwo/Form/Step4.php +++ b/CRM/Upgrade/TwoTwo/Form/Step4.php @@ -33,6 +33,11 @@ * */ 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')); @@ -95,10 +100,16 @@ class CRM_Upgrade_TwoTwo_Form_Step4 extends CRM_Upgrade_Form { 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 '

' . ts('Your CiviCRM database has been successfully upgraded to v2.2.') . '

' . ts('Please be sure to follow the remaining steps in the upgrade instructions specific to your version of CiviCRM: %1.', array( -- 2.25.1