X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=includes%2Fcurrent_user.inc;h=4d2d208177d0af531764cf1a097c64d6acaa2f73;hb=c5ea8220cbcdc1c60fdf60d9a045ae3eada78041;hp=e2dd4f37671db64ca1f321661345120643eb779c;hpb=37da0ea920fdff712ccef4e1324aa822e981c8fc;p=fa-stable.git diff --git a/includes/current_user.inc b/includes/current_user.inc index e2dd4f37..4d2d2081 100644 --- a/includes/current_user.inc +++ b/includes/current_user.inc @@ -11,10 +11,12 @@ class current_user var $username; var $name; var $company; + var $pos; var $access; var $logged; - + var $ui_mode = 0; + var $prefs; function current_user() @@ -47,6 +49,7 @@ class current_user $this->access = $myrow["full_access"]; $this->name = $myrow["real_name"]; + $this->pos = $myrow["pos"]; $this->loginname = $loginname; $this->username = $this->loginname; $this->prefs = new user_prefs($myrow); @@ -95,10 +98,13 @@ class current_user return $db; } - function update_prefs($price_dec, $qty_dec, $exrate_dec, $percent_dec, $showgl, $showcodes, - $date_format, $date_sep, $tho_sep, $dec_sep, $theme, $pagesize, $show_hints, $profile) { - update_user_display_prefs($this->username, $price_dec, $qty_dec, $exrate_dec, $percent_dec, $showgl, - $showcodes, $date_format, $date_sep, $tho_sep, $dec_sep, $theme, $pagesize, $show_hints, $profile); + function update_prefs($price_dec, $qty_dec, $exrate_dec, $percent_dec, + $showgl, $showcodes, $date_format, $date_sep, $tho_sep, $dec_sep, + $theme, $pagesize, $show_hints, $profile, $rep_popup, $query_size) { + update_user_display_prefs($this->username, $price_dec, + $qty_dec, $exrate_dec, $percent_dec, $showgl, $showcodes, + $date_format, $date_sep, $tho_sep, $dec_sep, $theme, $pagesize, + $show_hints, $profile, $rep_popup, $query_size); // re-read the prefs $user = get_user($this->username); @@ -115,6 +121,12 @@ function number_format2($number, $decimals=0) $dsep = $decseps[$_SESSION["wa_current_user"]->prefs->dec_sep()]; return number_format($number, $decimals, $dsep, $tsep); } +// +// Current ui mode. +// +function fallback_mode() { + return $_SESSION["wa_current_user"]->ui_mode==0; +} function price_format($number) { return number_format2($number, @@ -172,6 +184,11 @@ function user_company() return $_SESSION["wa_current_user"]->company; } +function user_pos() +{ + return $_SESSION["wa_current_user"]->pos; +} + function user_language() { return $_SESSION["wa_current_user"]->prefs->language(); @@ -252,14 +269,24 @@ function user_print_profile() return $_SESSION["wa_current_user"]->prefs->print_profile(); } +function user_rep_popup() +{ + return $_SESSION["wa_current_user"]->prefs->rep_popup(); +} + +function user_query_size() +{ + return $_SESSION["wa_current_user"]->prefs->query_size(); +} + function set_user_prefs($price_dec, $qty_dec, $exrate_dec, $percent_dec, $showgl, $showcodes, $date_format, $date_sep, $tho_sep, $dec_sep, $theme, $pagesize, $show_hints, - $print_profile) + $print_profile, $rep_popup, $query_size) { $_SESSION["wa_current_user"]->update_prefs($price_dec, $qty_dec, $exrate_dec, $percent_dec, $showgl, $showcodes, $date_format, $date_sep, $tho_sep, $dec_sep, $theme, $pagesize, $show_hints, - $print_profile); + $print_profile, $rep_popup, $query_size); } function add_user_js_data() {