2 /**********************************************************************
3 Copyright (C) FrontAccounting, LLC.
4 Released under the terms of the GNU General Public License, GPL,
5 as published by the Free Software Foundation, either version 3
6 of the License, or (at your option) any later version.
7 This program is distributed in the hope that it will be useful,
8 but WITHOUT ANY WARRANTY; without even the implied warranty of
9 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10 See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
11 ***********************************************************************/
13 class fa2_5 extends fa_patch {
14 var $previous = '2.4.1'; // applicable database version
15 var $version = '2.5.0'; // version installed
17 var $sql = 'alter2.5.sql';
18 var $max_upgrade_time = 900;
20 function __construct() {
21 parent::__construct();
22 $this->description = _('Upgrade from version 2.4 to 2.5');
26 Shows parameters to be selected before upgrade (if any)
28 function show_params($company)
31 display_note(_('Check upgrade parameters below and start upgrade.'));
32 start_table(TABLESTYLE);
34 table_section_title(_("Shipments category default settings"));
35 text_row(_("Category Name:"), 'shipping_cat_description', _('Shippment'), 30, 30);
36 item_tax_types_list_row(_('Item Tax Type:'), 'shipping_tax_type');
37 stock_units_list_row(_('Unit of measure:'), 'shipping_units');
38 gl_all_accounts_list_row(_("Sales Account:"), 'shipping_sales_act', get_company_pref('freight_act'));
39 gl_all_accounts_list_row(_("C.O.G.S. Account:"), 'shipping_cogs_act', get_company_pref('default_cogs_act'));
46 Fetch & check upgrade parameters, check additional upgrade pre-conditions, set SQL variables.
47 This function is run after successfull switching to target database connection, before sql upgrade script is run.
51 // set upgrade script parameters
52 foreach( array('shipping_cat_description', 'shipping_tax_type', 'shipping_units', 'shipping_sales_act', 'shipping_cogs_act') as $name)
53 db_query("SET @$name=".db_escape(get_post($name)));
59 Install procedure. All additional changes
60 not included in sql file should go here.
62 function install($company, $force=false)
68 Optional procedure done after upgrade fail, before backup is restored
70 function post_fail($company)