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
36 var $sticky_date; // save date on subsequent document entry
37 var $startup_tab; // default start-up menu tab
39 function user_prefs($user=null)
42 // set default values, used before login
48 $this->language = $dflt_lang;
49 $this->theme = 'default';
52 $this->language = $user["language"];
53 $_SESSION['language']->set_language($this->language);
55 $this->qty_dec = $user["qty_dec"];
56 $this->price_dec = $user["prices_dec"];
57 $this->exrate_dec = $user["rates_dec"];
58 $this->percent_dec = $user["percent_dec"];
60 $this->show_gl_info = $user["show_gl"];
61 $this->show_codes = $user["show_codes"];
62 $this->date_format = $user["date_format"];
63 $this->date_sep = $user["date_sep"];
64 $this->tho_sep = $user["tho_sep"];
65 $this->dec_sep = $user["dec_sep"];
66 $this->theme = $user["theme"];
67 $this->pagesize = $user["page_size"];
68 $this->show_hints = $user["show_hints"];
69 $this->print_profile = $user["print_profile"];
70 $this->rep_popup = $user["rep_popup"];
71 $this->query_size = $user["query_size"];
72 $this->graphic_links = $user["graphic_links"];
73 $this->sticky_date = $user["sticky_doc_date"];
74 $this->startup_tab = $user['startup_tab'];
80 return $this->language;
85 return $this->qty_dec;
90 return $this->price_dec;
95 return $this->exrate_dec;
98 function percent_dec()
100 return $this->percent_dec;
103 function show_gl_info()
105 return $this->show_gl_info;
108 function show_codes()
110 return $this->show_codes;
113 function date_format()
115 return $this->date_format;
120 return $this->date_sep;
123 function date_display()
126 $sep = $dateseps[$this->date_sep];
127 if ($this->date_format == 0)
128 return "m".$sep."d".$sep."Y";
129 elseif ($this->date_format == 1)
130 return "d".$sep."m".$sep."Y";
132 return "Y".$sep."m".$sep."d";
137 return $this->tho_sep;
142 return $this->dec_sep;
150 function get_pagesize()
152 return $this->pagesize;
155 function show_hints()
157 return $this->show_hints;
160 function print_profile()
162 return $this->print_profile;
167 return $this->rep_popup;
170 function query_size()
172 return $this->query_size;
175 function graphic_links()
177 return $this->graphic_links;
180 function sticky_date()
182 return $this->sticky_date;
185 function start_up_tab()
187 return $this->startup_tab;
190 function set_dec($price_dec, $qty_dec, $exrate_dec, $percent_dec, $showgl, $showcodes)
192 $this->price_dec = $price_dec;
193 $this->qty_dec = $qty_dec;
194 $this->exrate_dec = $exrate_dec;
195 $this->percent_dec = $percent_dec;
196 $this->show_gl_info = $showgl;
197 $this->show_codes = $showcodes;
200 function set_format($date_format, $date_sep, $tho_sep, $dec_sep, $theme, $pagesize)
202 $this->date_format = $date_format;
203 $this->date_sep = $date_sep;
204 $this->tho_sep = $tho_sep;
205 $this->dec_sep = $dec_sep;
206 $this->theme = $theme;
207 $this->pagesize = $pagesize;