From 4f89441866b40d759f43327d753b4dff31f3f02a Mon Sep 17 00:00:00 2001 From: Janusz Dobrowolski Date: Tue, 11 May 2010 21:48:05 +0000 Subject: [PATCH] Fixed bug in company upgrade. --- admin/create_coy.php | 2 +- admin/db/company_db.inc | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/admin/create_coy.php b/admin/create_coy.php index 1ee6d400..2d9242f4 100644 --- a/admin/create_coy.php +++ b/admin/create_coy.php @@ -185,7 +185,7 @@ function handle_delete() // Without this after operation we end up with changed per-company owners! for($i = $id; $i < count($db_connections); $i++) { $comp_path = company_path($i); - if (!is_dir($comp_path.'/'.$i) || !is_writable($comp_path.'/'.$i)) { + if (!is_dir($comp_path) || !is_writable($comp_path)) { display_error(_('Broken company subdirectories system. You have to remove this company manually.')); return; } diff --git a/admin/db/company_db.inc b/admin/db/company_db.inc index 632bab18..cf20d52b 100644 --- a/admin/db/company_db.inc +++ b/admin/db/company_db.inc @@ -12,9 +12,9 @@ /* Update main or gl company setup. */ -function update_company_prefs( $params ) +function update_company_prefs( $params, $pref = TB_PREF ) { - $sql = "UPDATE ".TB_PREF."sys_prefs SET value = "; + $sql = "UPDATE {$pref}sys_prefs SET value = "; foreach($params as $name => $value) { if (!db_query($sql. db_escape($value). " WHERE name=".db_escape($name), "The company prefferences could not be updated ")) @@ -38,7 +38,7 @@ function get_company_pref($prefs = null, $tbpref = TB_PREF) $_SESSION['SysPrefs'] = new sys_prefs(); - $sql = "SELECT name, value FROM ".$tbpref."sys_prefs"; + $sql = "SELECT name, value FROM {$tbpref}sys_prefs"; $result = @db_query($sql); // supress errors before 2.3 db structure upgrade if(!$result) -- 2.30.2