projects
/
fa-stable.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Rerun. Stuff forgotten.
[fa-stable.git]
/
admin
/
inst_upgrade.php
diff --git
a/admin/inst_upgrade.php
b/admin/inst_upgrade.php
index 20a056557e80d07fc16c263376f77b612ca7898a..670ecb1515d260bbdf3ccad7a05f7cd016d52282 100644
(file)
--- a/
admin/inst_upgrade.php
+++ b/
admin/inst_upgrade.php
@@
-13,7
+13,7
@@
$page_security = 'SA_SOFTWAREUPGRADE';
$path_to_root="..";
include_once($path_to_root . "/includes/session.inc");
$path_to_root="..";
include_once($path_to_root . "/includes/session.inc");
-page(_("Software Upgrade"));
+page(_(
$help_context =
"Software Upgrade"));
include_once($path_to_root . "/includes/date_functions.inc");
include_once($path_to_root . "/admin/db/company_db.inc");
include_once($path_to_root . "/includes/date_functions.inc");
include_once($path_to_root . "/admin/db/company_db.inc");
@@
-29,10
+29,11
@@
include_once($path_to_root . "/includes/ui.inc");
//
function check_table($pref, $table, $field=null, $properties=null)
{
//
function check_table($pref, $table, $field=null, $properties=null)
{
- $
fields = @db_query("SHOW COLUMNS FROM ".$pref.$table
);
- if (!
$fields
)
+ $
tables = @db_query("SHOW TABLES LIKE '".$pref.$table."'"
);
+ if (!
db_num_rows($tables)
)
return 1; // no such table or error
return 1; // no such table or error
+ $fields = @db_query("SHOW COLUMNS FROM ".$pref.$table);
if (!isset($field))
return 0; // table exists
if (!isset($field))
return 0; // table exists
@@
-89,7
+90,6
@@
function upgrade_step($index, $conn)
global $path_to_root, $installers;
$inst = $installers[$index];
global $path_to_root, $installers;
$inst = $installers[$index];
- $sql = $inst->sql;
$pref = $conn['tbpref'];
$ret = true;
$pref = $conn['tbpref'];
$ret = true;
@@
-99,7
+99,8
@@
function upgrade_step($index, $conn)
$state = $inst->installed($pref);
if (!$state || $force)
{
$state = $inst->installed($pref);
if (!$state || $force)
{
- if (!$inst->pre_check($pref)) return false;
+ if (!$inst->pre_check($pref, $force)) return false;
+ $sql = $inst->sql;
if ($sql != '')
$ret &= db_import($path_to_root.'/sql/'.$sql, $conn, $force);
if ($sql != '')
$ret &= db_import($path_to_root.'/sql/'.$sql, $conn, $force);
@@
-163,6
+164,7
@@
if (get_post('Upgrade'))
$_SESSION["wa_current_user"]->prefs = new user_prefs($user);
display_notification(_('All companies data has been successfully updated'));
}
$_SESSION["wa_current_user"]->prefs = new user_prefs($user);
display_notification(_('All companies data has been successfully updated'));
}
+ unset($_SESSION['SysPrefs']); // re-read system setup
$Ajax->activate('_page_body');
}
$Ajax->activate('_page_body');
}