[0000304] Set locale functionality broken on Windows
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Fri, 17 Dec 2010 15:15:50 +0000 (15:15 +0000)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Fri, 17 Dec 2010 15:15:50 +0000 (15:15 +0000)
Bad test code left over, cleaning up

CHANGELOG.txt
includes/db/inventory_db.inc
includes/lang/gettext.php
includes/packages.inc

index b312c4b2a90e94856e05f7c4c7e49425c4f863da..0b8e05cf00391baf07a48d1af61c7f47134134ff 100644 (file)
@@ -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
index 7f4daf9b28a415b34fd73782be7e5d436ea0cfce..fd4aff6d2490af42280fef2e4d90df67bb43ecfb 100644 (file)
@@ -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);
index 4d80c9b3b163af0b09b5013840e8700e65a2eb62..7d26256d51a2917f28e234dfb010a11ff7c50b68 100644 (file)
@@ -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);
index aa6304228e0d354ee786860c5db4942b76678278..cc387f64425d121491be0cfa0497ad5ed31d4ef8 100644 (file)
@@ -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);