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
38 var $transaction_days; // transaction days in inquiries
39 var $save_report_selection; // save report selections days 0...
40 var $use_date_picker; // use date picker for all date fields
41 var $def_print_destination; // default print destination. 0 = PDF/Printer, 1 = Excel
42 var $def_print_orientation; // default print orientation. 0 = Portrait. 1 = Landscape
44 function __construct($user=null)
47 // set default values, used before login
48 global $dflt_lang, $SysPrefs;
50 $this->date_sep = $SysPrefs->dflt_date_sep;
51 $this->date_format = $SysPrefs->dflt_date_fmt;
55 $this->language = $dflt_lang;
56 $this->theme = 'default';
57 $this->transaction_days = -30;
58 $this->save_report_selections = 0;
59 $this->use_date_picker = 1;
60 $this->def_print_destination = 0;
61 $this->def_print_orientation = 0;
65 $this->language = $user["language"];
66 $_SESSION['language']->set_language($this->language);
68 $this->qty_dec = $user["qty_dec"];
69 $this->price_dec = $user["prices_dec"];
70 $this->exrate_dec = $user["rates_dec"];
71 $this->percent_dec = $user["percent_dec"];
73 $this->show_gl_info = $user["show_gl"];
74 $this->show_codes = $user["show_codes"];
75 $this->date_format = $user["date_format"];
76 $this->date_sep = $user["date_sep"];
77 $this->tho_sep = $user["tho_sep"];
78 $this->dec_sep = $user["dec_sep"];
79 $this->theme = $user["theme"];
80 $this->pagesize = $user["page_size"];
81 $this->show_hints = $user["show_hints"];
82 $this->print_profile = $user["print_profile"];
83 $this->rep_popup = $user["rep_popup"];
84 $this->query_size = $user["query_size"];
85 $this->graphic_links = $user["graphic_links"];
86 if (isset($user["sticky_doc_date"]))
88 $this->sticky_date = $user["sticky_doc_date"];
89 $this->startup_tab = $user['startup_tab'];
93 $this->sticky_date = 0;
94 $this->startup_tab = "orders";
96 $this->transaction_days = @$user['transaction_days'];
97 $this->save_report_selections = @$user['save_report_selections'];
98 $this->use_date_picker = @$user['use_date_picker'];
99 $this->def_print_destination = @$user['def_print_destination'];
100 $this->def_print_orientation = @$user['def_print_orientation'];
102 if (!file_exists("$path_to_root/themes/$this->theme"))
103 $this->theme = "default";
110 'language' => $this->language,
111 'qty_dec' => $this->qty_dec,
112 'prices_dec' => $this->price_dec,
113 'rates_dec' => $this->exrate_dec,
114 'percent_dec' => $this->percent_dec,
115 'show_gl' => $this->show_gl_info,
116 'show_codes' => $this->show_codes,
117 'date_format' =>$this->date_format,
118 'date_sep' => $this->date_sep,
119 'tho_sep' => $this->tho_sep,
120 'dec_sep' => $this->dec_sep,
121 'theme' => $this->theme,
122 'page_size' => $this->pagesize,
123 'show_hints' => $this->show_hints,
124 'print_profile' => $this->print_profile,
125 'rep_popup' => $this->rep_popup,
126 'query_size' => $this->query_size,
127 'graphic_links' => $this->graphic_links,
128 'sticky_doc_date' => $this->sticky_date,
129 'startup_tab' => $this->startup_tab,
130 'save_report_selections' => $this->save_report_selections,
131 'use_date_picker' => $this->use_date_picker,
132 'def_print_destination' => $this->def_print_destination,
133 'def_print_orientation' => $this->def_print_orientation);
138 return $this->language;
143 return $this->qty_dec;
148 return $this->price_dec;
151 function exrate_dec()
153 return $this->exrate_dec;
156 function percent_dec()
158 return $this->percent_dec;
161 function show_gl_info()
163 return $this->show_gl_info;
166 function show_codes()
168 return $this->show_codes;
171 function date_format()
173 return $this->date_format;
178 return $this->date_sep;
181 function date_display()
184 $sep = $SysPrefs->dateseps[$this->date_sep];
185 if ($this->date_format == 0)
186 return "m".$sep."d".$sep."Y";
187 elseif ($this->date_format == 1)
188 return "d".$sep."m".$sep."Y";
189 elseif ($this->date_format == 2)
190 return "Y".$sep."m".$sep."d";
191 elseif ($this->date_format == 3)
192 return "M".$sep."j".$sep."Y";
193 elseif ($this->date_format == 4)
194 return "j".$sep."M".$sep."Y";
196 return "Y".$sep."M".$sep."j";
201 return $this->tho_sep;
206 return $this->dec_sep;
214 function get_pagesize()
216 return $this->pagesize;
219 function show_hints()
221 return $this->show_hints;
224 function print_profile()
226 return $this->print_profile;
231 return $this->rep_popup;
234 function query_size()
236 return $this->query_size;
239 function graphic_links()
241 return $this->graphic_links;
244 function sticky_date()
246 return $this->sticky_date;
249 function start_up_tab()
251 return $this->startup_tab;
254 function transaction_days()
256 return $this->transaction_days;
259 function save_report_selections()
261 return $this->save_report_selections;
264 function use_date_picker()
266 return $this->use_date_picker;
269 function def_print_destination()
271 return $this->def_print_destination;
274 function def_print_orientation()
276 return $this->def_print_orientation;
279 function set_dec($price_dec, $qty_dec, $exrate_dec, $percent_dec, $showgl, $showcodes)
281 $this->price_dec = $price_dec;
282 $this->qty_dec = $qty_dec;
283 $this->exrate_dec = $exrate_dec;
284 $this->percent_dec = $percent_dec;
285 $this->show_gl_info = $showgl;
286 $this->show_codes = $showcodes;
289 function set_format($date_format, $date_sep, $tho_sep, $dec_sep, $theme, $pagesize)
291 $this->date_format = $date_format;
292 $this->date_sep = $date_sep;
293 $this->tho_sep = $tho_sep;
294 $this->dec_sep = $dec_sep;
295 $this->theme = $theme;
296 $this->pagesize = $pagesize;