From: Joe Date: Wed, 21 Jan 2015 09:09:10 +0000 (+0100) Subject: Vlrsnup according to Apmuthu's list. X-Git-Tag: v2.4.2~19^2~260 X-Git-Url: https://delta.frontaccounting.com/gitweb/?p=fa-stable.git;a=commitdiff_plain;h=40c3b111b007ad16a2eedff175e1612150191d04 Vlrsnup according to Apmuthu's list. --- diff --git a/includes/current_user.inc b/includes/current_user.inc index 89b475fd..8c754aec 100644 --- a/includes/current_user.inc +++ b/includes/current_user.inc @@ -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() diff --git a/includes/db/connect_db_mysql.inc b/includes/db/connect_db_mysql.inc index f4dda47c..26067214 100644 --- a/includes/db/connect_db_mysql.inc +++ b/includes/db/connect_db_mysql.inc @@ -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;