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 ***********************************************************************/
33 var $pagesize; // for printing
35 var $query_size; // table pager page length
36 var $graphic_links; // use graphic links
37 var $sticky_date; // save date on subsequent document entry
38 var $startup_tab; // default start-up menu tab
39 var $transaction_days; // transaction days in inquiries
40 var $save_report_selections; // save report selections days 0...
41 var $use_date_picker; // use date picker for all date fields
42 var $def_print_destination; // default print destination. 0 = PDF/Printer, 1 = Excel
43 var $def_print_orientation; // default print orientation. 0 = Portrait. 1 = Landscape
45 function __construct($user=null)
48 // set default values, used before login
49 global $dflt_lang, $SysPrefs;
51 $this->date_sep = $SysPrefs->dflt_date_sep;
52 $this->date_format = $SysPrefs->dflt_date_fmt;
56 $this->language = $dflt_lang;
57 $this->theme = 'default';
58 $this->transaction_days = -30;
59 $this->save_report_selections = 0;
60 $this->use_date_picker = 1;
61 $this->def_print_destination = 0;
62 $this->def_print_orientation = 0;
66 $this->language = $user["language"];
67 $_SESSION['language']->set_language($this->language);
69 $this->qty_dec = $user["qty_dec"];
70 $this->price_dec = $user["prices_dec"];
71 $this->exrate_dec = $user["rates_dec"];
72 $this->percent_dec = $user["percent_dec"];
74 $this->show_gl_info = $user["show_gl"];
75 $this->show_codes = $user["show_codes"];
76 $this->date_format = $user["date_format"];
77 $this->date_sep = $user["date_sep"];
78 $this->tho_sep = $user["tho_sep"];
79 $this->dec_sep = $user["dec_sep"];
80 $this->theme = $user["theme"];
81 $this->pagesize = $user["page_size"];
82 $this->show_hints = $user["show_hints"];
83 $this->print_profile = $user["print_profile"];
84 $this->rep_popup = $user["rep_popup"];
85 $this->query_size = $user["query_size"];
86 $this->graphic_links = $user["graphic_links"];
87 if (isset($user["sticky_doc_date"]))
89 $this->sticky_date = $user["sticky_doc_date"];
90 $this->startup_tab = $user['startup_tab'];
94 $this->sticky_date = 0;
95 $this->startup_tab = "orders";
97 $this->transaction_days = @$user['transaction_days'];
98 $this->save_report_selections = @$user['save_report_selections'];
99 $this->use_date_picker = @$user['use_date_picker'];
100 $this->def_print_destination = @$user['def_print_destination'];
101 $this->def_print_orientation = @$user['def_print_orientation'];
103 if (!file_exists("$path_to_root/themes/$this->theme"))
104 $this->theme = "default";
111 'language' => $this->language,
112 'qty_dec' => $this->qty_dec,
113 'prices_dec' => $this->price_dec,
114 'rates_dec' => $this->exrate_dec,
115 'percent_dec' => $this->percent_dec,
116 'show_gl' => $this->show_gl_info,
117 'show_codes' => $this->show_codes,
118 'date_format' =>$this->date_format,
119 'date_sep' => $this->date_sep,
120 'tho_sep' => $this->tho_sep,
121 'dec_sep' => $this->dec_sep,
122 'theme' => $this->theme,
123 'page_size' => $this->pagesize,
124 'show_hints' => $this->show_hints,
125 'print_profile' => $this->print_profile,
126 'rep_popup' => $this->rep_popup,
127 'query_size' => $this->query_size,
128 'graphic_links' => $this->graphic_links,
129 'sticky_doc_date' => $this->sticky_date,
130 'startup_tab' => $this->startup_tab,
131 'save_report_selections' => $this->save_report_selections,
132 'use_date_picker' => $this->use_date_picker,
133 'def_print_destination' => $this->def_print_destination,
134 'def_print_orientation' => $this->def_print_orientation);
139 return $this->language;
144 return $this->qty_dec;
149 return $this->price_dec;
152 function exrate_dec()
154 return $this->exrate_dec;
157 function percent_dec()
159 return $this->percent_dec;
162 function show_gl_info()
164 return $this->show_gl_info;
167 function show_codes()
169 return $this->show_codes;
172 function date_format()
174 return $this->date_format;
179 return $this->date_sep;
182 function date_display()
185 $sep = $SysPrefs->dateseps[$this->date_sep];
186 if ($this->date_format == 0)
187 return "m".$sep."d".$sep."Y";
188 elseif ($this->date_format == 1)
189 return "d".$sep."m".$sep."Y";
190 elseif ($this->date_format == 2)
191 return "Y".$sep."m".$sep."d";
192 elseif ($this->date_format == 3)
193 return "M".$sep."j".$sep."Y";
194 elseif ($this->date_format == 4)
195 return "j".$sep."M".$sep."Y";
197 return "Y".$sep."M".$sep."j";
202 return $this->tho_sep;
207 return $this->dec_sep;
215 function get_pagesize()
217 return $this->pagesize;
220 function show_hints()
222 return $this->show_hints;
225 function print_profile()
227 return $this->print_profile;
232 return $this->rep_popup;
235 function query_size()
237 return $this->query_size;
240 function graphic_links()
242 return $this->graphic_links;
245 function sticky_date()
247 return $this->sticky_date;
250 function start_up_tab()
252 return $this->startup_tab;
255 function transaction_days()
257 return $this->transaction_days;
260 function save_report_selections()
262 return $this->save_report_selections;
265 function use_date_picker()
267 return $this->use_date_picker;
270 function def_print_destination()
272 return $this->def_print_destination;
275 function def_print_orientation()
277 return $this->def_print_orientation;
280 function set_dec($price_dec, $qty_dec, $exrate_dec, $percent_dec, $showgl, $showcodes)
282 $this->price_dec = $price_dec;
283 $this->qty_dec = $qty_dec;
284 $this->exrate_dec = $exrate_dec;
285 $this->percent_dec = $percent_dec;
286 $this->show_gl_info = $showgl;
287 $this->show_codes = $showcodes;
290 function set_format($date_format, $date_sep, $tho_sep, $dec_sep, $theme, $pagesize)
292 $this->date_format = $date_format;
293 $this->date_sep = $date_sep;
294 $this->tho_sep = $tho_sep;
295 $this->dec_sep = $dec_sep;
296 $this->theme = $theme;
297 $this->pagesize = $pagesize;