2 /**********************************************************************
3 Copyright (C) FrontAccounting, LLC.
4 Released under the terms of the GNU General Public License, GPL,
5 as published by the Free Software Foundation, either version 3
6 of the License, or (at your option) any later version.
7 This program is distributed in the hope that it will be useful,
8 but WITHOUT ANY WARRANTY; without even the implied warranty of
9 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10 See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
11 ***********************************************************************/
32 var $pagesize; // for printing
34 var $query_size; // table pager page length
35 var $graphic_links; // use graphic links
37 function user_prefs($user=null)
40 // set default values, used before login
43 $this->language = $dflt_lang;
44 $this->theme = 'default';
47 $this->language = $user["language"];
48 language::set_language($this->language);
50 $this->qty_dec = $user["qty_dec"];
51 $this->price_dec = $user["prices_dec"];
52 $this->exrate_dec = $user["rates_dec"];
53 $this->percent_dec = $user["percent_dec"];
55 $this->show_gl_info = $user["show_gl"];
56 $this->show_codes = $user["show_codes"];
57 $this->date_format = $user["date_format"];
58 $this->date_sep = $user["date_sep"];
59 $this->tho_sep = $user["tho_sep"];
60 $this->dec_sep = $user["dec_sep"];
61 $this->theme = $user["theme"];
62 $this->pagesize = $user["page_size"];
63 $this->show_hints = $user["show_hints"];
64 $this->print_profile = $user["print_profile"];
65 $this->rep_popup = $user["rep_popup"];
66 $this->query_size = $user["query_size"];
67 $this->graphic_links = $user["graphic_links"];
73 return $this->language;
78 return $this->qty_dec;
83 return $this->price_dec;
88 return $this->exrate_dec;
91 function percent_dec()
93 return $this->percent_dec;
96 function show_gl_info()
98 return $this->show_gl_info;
101 function show_codes()
103 return $this->show_codes;
106 function date_format()
108 return $this->date_format;
113 return $this->date_sep;
116 function date_display()
119 $sep = $dateseps[$this->date_sep];
120 if ($this->date_format == 0)
121 return "m".$sep."d".$sep."Y";
122 elseif ($this->date_format == 1)
123 return "d".$sep."m".$sep."Y";
125 return "Y".$sep."m".$sep."d";
130 return $this->tho_sep;
135 return $this->dec_sep;
143 function get_pagesize()
145 return $this->pagesize;
148 function show_hints()
150 return $this->show_hints;
153 function print_profile()
155 return $this->print_profile;
160 return $this->rep_popup;
163 function query_size()
165 return $this->query_size;
168 function graphic_links()
170 return $this->graphic_links;
173 function set_dec($price_dec, $qty_dec, $exrate_dec, $percent_dec, $showgl, $showcodes)
175 $this->price_dec = $price_dec;
176 $this->qty_dec = $qty_dec;
177 $this->exrate_dec = $exrate_dec;
178 $this->percent_dec = $percent_dec;
179 $this->show_gl_info = $showgl;
180 $this->show_codes = $showcodes;
183 function set_format($date_format, $date_sep, $tho_sep, $dec_sep, $theme, $pagesize)
185 $this->date_format = $date_format;
186 $this->date_sep = $date_sep;
187 $this->tho_sep = $tho_sep;
188 $this->dec_sep = $dec_sep;
189 $this->theme = $theme;
190 $this->pagesize = $pagesize;