- // connect to database
- if (!(set_global_connection($comp)))
- {
- display_error(_("Cannot connect to database for company")
- ." '".$conn['name']."'");
- continue;
- }
- // create security backup
- db_backup($conn, 'no', 'Security backup before upgrade');
- // apply all upgrade data
- foreach ($installers as $i => $inst)
- {
- $ret = upgrade_step($i, $comp, $conn);
- if (!$ret)
- {
- display_error(
- sprintf(_("Database upgrade to version %s failed for company '%s'."),
- $inst->version, $conn['name'])
- .'<br>'
- ._('You should restore company database from latest backup file'));
- }
- }
-// db_close($conn); ?
- if (!$ret) break;
- }
- set_global_connection();
- if($ret)
- { // re-read the prefs
- global $path_to_root;
- include_once($path_to_root . "/admin/db/users_db.inc");
- $user = get_user_by_login($_SESSION["wa_current_user"]->username);
- $_SESSION["wa_current_user"]->prefs = new user_prefs($user);
- display_notification(_('All companies data has been successfully updated'));
- }
- refresh_sys_prefs(); // re-read system setup
- $Ajax->activate('_page_body');
+ label_cell(radio(null, 'select_comp', $i, null, true), 'align=center');
+ $uptodate = false;
+ } else
+ label_cell(_('Up to date'));
+ end_row();