Index: branches/5.3.x/install/upgrades.php =================================================================== diff -u -r12920 -r16508 --- branches/5.3.x/install/upgrades.php (.../5.0.x/install/upgrades.php) (revision 12920) +++ branches/5.3.x/install/upgrades.php (.../5.3.x/install/upgrades.php) (revision 16508) @@ -1,6 +1,6 @@ _toolkit =& $instance; + parent::__construct(); + + $this->dependencies = Array ( + '4.3.9' => Array ('Core' => '4.3.9'), + '5.0.0' => Array ('Core' => '5.0.0'), + '5.0.1' => Array ('Core' => '5.0.1'), + '5.0.2-B1' => Array ('Core' => '5.0.2-B1'), + '5.0.2-B2' => Array ('Core' => '5.0.2-B2'), + '5.0.2-RC1' => Array ('Core' => '5.0.2-RC1'), + '5.0.2' => Array ('Core' => '5.0.2'), + '5.0.3-B1' => Array ('Core' => '5.0.3-B1'), + '5.0.3-B2' => Array ('Core' => '5.0.3-B2'), + '5.0.3-RC1' => Array ('Core' => '5.0.3-RC1'), + '5.0.3' => Array ('Core' => '5.0.3'), + '5.0.4-B1' => Array ('Core' => '5.0.4-B1'), + '5.0.4-B2' => Array ('Core' => '5.0.4-B2'), + '5.0.4' => Array ('Core' => '5.0.4'), + '5.1.0-B1' => Array ('Core' => '5.1.0-B1'), + '5.1.0-RC1' => Array ('Core' => '5.1.0-RC1'), + '5.1.0' => Array ('Core' => '5.1.0'), + '5.1.1-B1' => Array ('Core' => '5.1.1-B1'), + '5.1.1-RC1' => Array ('Core' => '5.1.1-RC1'), + '5.1.1' => Array ('Core' => '5.1.1'), + '5.1.2-B1' => Array ('Core' => '5.1.2-B1'), + '5.1.2-RC1' => Array ('Core' => '5.1.2-RC1'), + '5.1.2' => Array ('Core' => '5.1.2'), + '5.1.3-B1' => Array ('Core' => '5.1.3-B2'), + '5.1.3-RC1' => Array ('Core' => '5.1.3-RC1'), + '5.1.3-RC2' => Array ('Core' => '5.1.3-RC2'), + '5.1.3' => Array ('Core' => '5.1.3'), + '5.2.0-B1' => Array ('Core' => '5.2.0-B1'), + '5.2.0-B2' => Array ('Core' => '5.2.0-B2'), + '5.2.0-B3' => Array ('Core' => '5.2.0-B3'), + '5.2.0-RC1' => Array ('Core' => '5.2.0-RC1'), + '5.2.0' => Array ('Core' => '5.2.0'), + '5.2.1-B1' => Array ('Core' => '5.2.1-B1'), + '5.2.1-B2' => Array ('Core' => '5.2.1-B2'), + '5.2.1-RC1' => Array ('Core' => '5.2.1-RC1'), + '5.2.1' => Array ('Core' => '5.2.1'), + '5.2.2-B1' => Array ('Core' => '5.2.2-B1'), + '5.3.0-B1' => Array ('Core' => '5.3.0-B1'), + ); } /** @@ -47,43 +76,19 @@ function Upgrade_5_0_0($mode) { if ($mode == 'after') { + $categories_config = $this->Application->getUnitConfig('c'); $root_category = $this->Application->findModule('Name', 'In-News', 'RootCat'); - $sql = 'UPDATE ' . $this->Application->getUnitOption('c', 'TableName') . ' + $sql = 'UPDATE ' . $categories_config->getTableName() . ' SET UseMenuIconUrl = 1, MenuIconUrl = "in-news/img/menu_articles.gif" - WHERE ' . $this->Application->getUnitOption('c', 'IDField') . ' = ' . $root_category; + WHERE ' . $categories_config->getIDField() . ' = ' . $root_category; $this->Conn->Query($sql); $this->_updateDetailTemplate('n', 'innews/detail', 'in-news/designs/detail'); } } /** - * Replaces deprecated detail template design with new one - * - * @param string $prefix - * @param string $from_template - * @param string $to_template - */ - function _updateDetailTemplate($prefix, $from_template, $to_template) - { - $sql = 'SELECT CustomFieldId - FROM ' . TABLE_PREFIX . 'CustomField - WHERE FieldName = "' . $prefix . '_ItemTemplate"'; - $custom_field_id = $this->Conn->GetOne($sql); - - $ml_formatter =& $this->Application->recallObject('kMultiLanguage'); - /* @var $ml_formatter kMultiLanguage */ - - $field = $ml_formatter->LangFieldName('cust_' . $custom_field_id, true); - - $sql = 'UPDATE ' . TABLE_PREFIX . 'CategoryCustomData - SET ' . $field . ' = "' . $to_template . '" - WHERE ' . $field . ' = "' . $from_template . '"'; - $this->Conn->Query($sql); - } - - /** * Update to 5.0.1 * * @param string $mode when called mode {before, after) @@ -115,4 +120,4 @@ } } } - } \ No newline at end of file + }