X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=admin%2Finst_upgrade.php;h=183221e1ada5c451ee715e3af6ad346261432296;hb=bbb034b7e0ab111ce200d81ab5a9b56ad9ad880c;hp=5fc66fc810378507edcc72488c4b74e01670a546;hpb=d1babda7c01b314d35fb89f2d195553b55936532;p=fa-stable.git diff --git a/admin/inst_upgrade.php b/admin/inst_upgrade.php index 5fc66fc8..183221e1 100644 --- a/admin/inst_upgrade.php +++ b/admin/inst_upgrade.php @@ -50,7 +50,7 @@ if (get_post('Upgrade')) $i = find_submit('Clear'); if ($i != -1) { - unlink($path_to_root.'/tmp/upgrade.'.$i.'.log'); + unlink(VARLOG_PATH.'/upgrade.'.$i.'.log'); $Ajax->activate('_page_body'); } if (get_post('_select_comp_update')) @@ -63,6 +63,7 @@ start_form(); $th = array(_("Company"), _("Table set"), _("Current version"), _("Last log"), _('Upgrade')); start_table(TABLESTYLE); table_header($th); +$k = 0; //row colour counter $uptodate = true; foreach($site_status as $i => $comp) @@ -76,7 +77,7 @@ foreach($site_status as $i => $comp) label_cell($comp['version'], 'align=center' .($status ? '':' class=redfg')/*, 'class='.( $status ? 'ok' : 'error')*/); - $log = $path_to_root.'/tmp/upgrade.'.$i.'.log'; + $log = VARLOG_PATH.'/upgrade.'.$i.'.log'; if (file_exists($log)) { label_cell(viewer_link(_('View log'), "admin/view/view_upgrade_log.php?id=$i", null, $i, 'log.png') @@ -85,7 +86,6 @@ foreach($site_status as $i => $comp) } else label_cell('-', 'align=center'); - if (!$status) { label_cell(radio(null, 'select_comp', $i, null, true), 'align=center'); @@ -102,8 +102,14 @@ div_start('upgrade_args'); if (get_post('select_comp') !== '') { $patch = @$installers[$site_status[get_post('select_comp')]['version']]; - if ($patch) - $patch->show_params(get_post('select_comp')); + if ($patch) { + if (!set_global_connection(get_post('select_comp'))) // create page in target database context + display_error(_("Cannot connect to company database for database restore.")); + else { + $patch->show_params(get_post('select_comp')); + set_global_connection(); // switch back + } + } } div_end();