Vlrsnup according to Apmuthu's list.
authorJoe <unknown>
Wed, 21 Jan 2015 09:09:10 +0000 (10:09 +0100)
committerJoe <unknown>
Wed, 21 Jan 2015 09:09:10 +0000 (10:09 +0100)
includes/current_user.inc
includes/db/connect_db_mysql.inc

index 89b475fd6d6c83573e1c40c1d8a75afa841ed73e..8c754aec8f11091f835806537a75651fd9058b2d 100644 (file)
@@ -448,17 +448,23 @@ function user_qty_dec()
 
 function user_price_dec()
 {
-       return $_SESSION["wa_current_user"]->prefs->price_dec();
+       global $SysPrefs;
+
+       return isset($_SESSION["wa_current_user"]) ? $_SESSION["wa_current_user"]->prefs->price_dec() : $SysPrefs->prices_dec;
 }
 
 function user_exrate_dec()
 {
-       return $_SESSION["wa_current_user"]->prefs->exrate_dec();
+       global $SysPrefs;
+
+       return isset($_SESSION["wa_current_user"]) ? $_SESSION["wa_current_user"]->prefs->exrate_dec() : $SysPrefs->rates_dec;
 }
 
 function user_percent_dec()
 {
-       return $_SESSION["wa_current_user"]->prefs->percent_dec();
+       global $SysPrefs;
+
+       return isset($_SESSION["wa_current_user"]) ? $_SESSION["wa_current_user"]->prefs->percent_dec() : $SysPrefs->percent_dec;
 }
 
 function user_show_gl_info()
@@ -473,41 +479,38 @@ function user_show_codes()
 
 function user_date_format()
 {
-  global $SysPrefs;
+       global $SysPrefs;
 
-       return isset($_SESSION["wa_current_user"]) ?
-         $_SESSION["wa_current_user"]->prefs->date_format() : $SysPrefs->dflt_date_fmt;
+       return isset($_SESSION["wa_current_user"]) ? $_SESSION["wa_current_user"]->prefs->date_format() : $SysPrefs->dflt_date_fmt;
 }
 
 function user_date_display()
 {
-  global $SysPrefs;
+       global $SysPrefs;
 
-       return isset($_SESSION["wa_current_user"]) ?
-         $_SESSION["wa_current_user"]->prefs->date_display() : $SysPres->dflt_date_sep;
+       return isset($_SESSION["wa_current_user"]) ? $_SESSION["wa_current_user"]->prefs->date_display() : $SysPrefs->dflt_date_sep;
 }
 
 function user_date_sep()
 {
-       return $_SESSION["wa_current_user"]->prefs->date_sep();
+       global $SysPrefs;
+
+       return isset($_SESSION["wa_current_user"]) ? $_SESSION["wa_current_user"]->prefs->date_sep() : $SysPrefs->dflt_date_sep;
 }
 
 function user_tho_sep()
 {
-       return isset($_SESSION["wa_current_user"]) ?
-               $_SESSION["wa_current_user"]->prefs->tho_sep() : 0;
+       return isset($_SESSION["wa_current_user"]) ? $_SESSION["wa_current_user"]->prefs->tho_sep() : 0;
 }
 
 function user_dec_sep()
 {
-       return isset($_SESSION["wa_current_user"]) ?
-               $_SESSION["wa_current_user"]->prefs->dec_sep() : 0;
+       return isset($_SESSION["wa_current_user"]) ? $_SESSION["wa_current_user"]->prefs->dec_sep() : 0;
 }
 
 function user_theme()
 {
-       return isset($_SESSION["wa_current_user"]) ?
-               $_SESSION["wa_current_user"]->prefs->get_theme() : 'default';
+       return isset($_SESSION["wa_current_user"]) ? $_SESSION["wa_current_user"]->prefs->get_theme() : 'default';
 }
 
 function user_pagesize()
index f4dda47c6cef590e95f1af592c83b34dcae4e8c8..2606721443d7db758930482dcde01d80d403efb3 100644 (file)
@@ -42,7 +42,7 @@ function set_global_connection($company=-1)
 
 function db_query($sql, $err_msg=null)
 {
-       global $db, $SysPres, $sql_queries, $Ajax, $db_connections, $db_last_inserted_id;
+       global $db, $SysPrefs, $sql_queries, $Ajax, $db_connections, $db_last_inserted_id;
 
        // set current db prefix
        $comp = isset($_SESSION["wa_current_user"]->cur_con) ? $_SESSION["wa_current_user"]->cur_con : 0;