2 /**********************************************************************
3 Copyright (C) FrontAccounting, LLC.
4 Released under the terms of the GNU Affero General Public License,
5 AGPL, as published by the Free Software Foundation, either version
6 3 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/agpl-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)
40 $this->language = $user["language"];
41 language::set_language($this->language);
43 $this->qty_dec = $user["qty_dec"];
44 $this->price_dec = $user["prices_dec"];
45 $this->exrate_dec = $user["rates_dec"];
46 $this->percent_dec = $user["percent_dec"];
48 $this->show_gl_info = $user["show_gl"];
49 $this->show_codes = $user["show_codes"];
50 $this->date_format = $user["date_format"];
51 $this->date_sep = $user["date_sep"];
52 $this->tho_sep = $user["tho_sep"];
53 $this->dec_sep = $user["dec_sep"];
54 $this->theme = $user["theme"];
55 $this->pagesize = $user["page_size"];
56 $this->show_hints = $user["show_hints"];
57 $this->print_profile = $user["print_profile"];
58 $this->rep_popup = $user["rep_popup"];
59 $this->query_size = $user["query_size"];
60 $this->graphic_links = $user["graphic_links"];
65 return $this->language;
70 return $this->qty_dec;
75 return $this->price_dec;
80 return $this->exrate_dec;
83 function percent_dec()
85 return $this->percent_dec;
88 function show_gl_info()
90 return $this->show_gl_info;
95 return $this->show_codes;
98 function date_format()
100 return $this->date_format;
105 return $this->date_sep;
108 function date_display()
111 $sep = $dateseps[$this->date_sep];
112 if ($this->date_format == 0)
113 return "m".$sep."d".$sep."Y";
114 elseif ($this->date_format == 1)
115 return "d".$sep."m".$sep."Y";
117 return "Y".$sep."m".$sep."d";
122 return $this->tho_sep;
127 return $this->dec_sep;
135 function get_pagesize()
137 return $this->pagesize;
140 function show_hints()
142 return $this->show_hints;
145 function print_profile()
147 return $this->print_profile;
152 return $this->rep_popup;
155 function query_size()
157 return $this->query_size;
160 function graphic_links()
162 return $this->graphic_links;
165 function set_dec($price_dec, $qty_dec, $exrate_dec, $percent_dec, $showgl, $showcodes)
167 $this->price_dec = $price_dec;
168 $this->qty_dec = $qty_dec;
169 $this->exrate_dec = $exrate_dec;
170 $this->percent_dec = $percent_dec;
171 $this->show_gl_info = $showgl;
172 $this->show_codes = $showcodes;
175 function set_format($date_format, $date_sep, $tho_sep, $dec_sep, $theme, $pagesize)
177 $this->date_format = $date_format;
178 $this->date_sep = $date_sep;
179 $this->tho_sep = $tho_sep;
180 $this->dec_sep = $dec_sep;
181 $this->theme = $theme;
182 $this->pagesize = $pagesize;