X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=sql%2Falter2.3.php;h=2667d15cb925d66d58a4f311fe5eeae4c2917cb1;hb=48589f9ce6c51bb25e2fa8ed83c57d9dfa485e44;hp=0fa5e2606487e1e36425096a8308757c43d57bd2;hpb=5b8f4c4b4aa8cf996bc071f116bfce1273200fa2;p=fa-stable.git diff --git a/sql/alter2.3.php b/sql/alter2.3.php index 0fa5e260..2667d15c 100644 --- a/sql/alter2.3.php +++ b/sql/alter2.3.php @@ -9,14 +9,15 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the License here . ***********************************************************************/ -class fa2_3 { - var $version = '2.3'; // version installed +class fa2_3 extends fa_patch { + var $previous = '2.2rc'; // applicable database version + var $version = '2.3rc'; // version installed var $description; var $sql = 'alter2.3.sql'; var $preconf = true; var $beta = false; // upgrade from 2.2 or 2.3beta; - function fa2_3() { + function __construct() { $this->description = _('Upgrade from version 2.2 to 2.3'); } @@ -24,7 +25,7 @@ class fa2_3 { // Install procedure. All additional changes // not included in sql file should go here. // - function install($company, $force) + function install($company, $force=false) { global $db_version, $dflt_lang; @@ -98,36 +99,19 @@ class fa2_3 { // // Checking before install // - function pre_check($pref, $force) + function prepare() { - if ($this->beta && !$force) + if ($this->beta) $this->sql = 'alter2.3rc.sql'; return true; } - // - // Test if patch was applied before. - // - function installed($pref) { - $this->beta = !check_table($pref, 'suppliers', 'tax_included'); - - $n = 1; // number of patches to be installed - $patchcnt = 0; - if (!$this->beta) { - $n += 3; - if (!check_table($pref, 'comments', 'type', array('Key'=>'MUL'))) $patchcnt++; - if (!check_table($pref, 'sys_prefs')) $patchcnt++; - if (!check_table($pref, 'sales_orders', 'payment_terms')) $patchcnt++; - } - if (!check_table($pref, 'purch_orders', 'tax_included')) $patchcnt++; - return $n == $patchcnt ? true : ($patchcnt ? ($patchcnt.'/'. $n) : 0); - } //========================================================================================= // 2.3 specific update functions // - + /* Update order totals */ @@ -264,11 +248,11 @@ class fa2_3 { } return true; } - + function fix_extensions() { global $path_to_root, $next_extension_id, $installed_languages; - + $lang_chd = false; foreach($installed_languages as $i => $lang) { if (!isset($lang['path'])) { @@ -281,15 +265,14 @@ class fa2_3 { if ($lang_chd) write_lang(); - $installed_extensions= get_company_extensions(); if (!isset($next_extension_id)) $next_extension_id = 1; $new_exts = array(); - + /* Old extension modules are uninstalled - they need manual porting after heavy changes in extension system in FA2.3 - + foreach($installed_extensions as $i => $ext) { if (isset($ext['title'])) // old type entry