From 83b044e9dc5c720c082d9f8a8b6247cb2b68626f Mon Sep 17 00:00:00 2001 From: Joe Hunt Date: Fri, 17 Dec 2010 15:15:50 +0000 Subject: [PATCH] [0000304] Set locale functionality broken on Windows Bad test code left over, cleaning up --- CHANGELOG.txt | 7 +++++++ includes/db/inventory_db.inc | 7 ++----- includes/lang/gettext.php | 3 ++- includes/packages.inc | 1 + 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index b312c4b..0b8e05c 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -19,6 +19,13 @@ Legend: ! -> Note $ -> Affected files +17-Dec-2010 Joe Hunt +# [0000304] Set locale functionality broken on Windows +$ /includes/lang/gettext.php + /includes/packages.inc (missing include directive for hooks.inc) +# Bad test code left over, cleaning up +$ /includes/db/inventory_db.inc + 16-Dec-2010 Janusz Dobrowolski + Added hook for session handling, fixed bug [0000315] (session fixation) $ /includes/hooks.inc diff --git a/includes/db/inventory_db.inc b/includes/db/inventory_db.inc index 7f4daf9..fd4aff6 100644 --- a/includes/db/inventory_db.inc +++ b/includes/db/inventory_db.inc @@ -201,7 +201,7 @@ function get_purchases_from_trans($stock_id, $from) } //------------------------------------------------------------------- -// Original Code V0 +/* Original Code V0 Leave as is a while function adjust_deliveries_v0($stock_id, $material_cost, $to) { if (!is_inventory_item($stock_id)) @@ -234,7 +234,7 @@ function adjust_deliveries_v0($stock_id, $material_cost, $to) add_audit_trail(ST_COSTUPDATE, $update_no, $to); } } - +*/ //New written function function adjust_deliveries($stock_id, $material_cost, $to) { @@ -267,9 +267,6 @@ function adjust_deliveries($stock_id, $material_cost, $to) display_notification('Sales Diff - '.$sales_diff.' Purchase Diff - '.$purchase_diff); - $sql = "INSERT INTO trace values ('Diff', ".db_escape($diff).", '')"; - $result = db_query($sql, "The dstock moves could not be retrieved"); - if ($diff != 0) { $update_no = get_next_trans_no(ST_COSTUPDATE); diff --git a/includes/lang/gettext.php b/includes/lang/gettext.php index 4d80c9b..7d26256 100644 --- a/includes/lang/gettext.php +++ b/includes/lang/gettext.php @@ -104,7 +104,8 @@ class gettext_native_support */ function check_support($lang_code, $encoding) { - + if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') // don't do this test if server is WIN + return true; $old = setlocale(LC_CTYPE, '0'); // LC_MESSAGES does not exist on Win $up = strtoupper($encoding); $low = strtolower($encoding); diff --git a/includes/packages.inc b/includes/packages.inc index aa63042..cc387f6 100644 --- a/includes/packages.inc +++ b/includes/packages.inc @@ -11,6 +11,7 @@ ***********************************************************************/ include_once($path_to_root. "/includes/archive.inc"); include_once($path_to_root. "/includes/remote_url.inc"); +include_once($path_to_root. "/includes/hooks.inc"); define('PKG_CACHE_PATH', $path_to_root.'/modules/_cache'); define('PUBKEY_PATH', $path_to_root); -- 2.30.2