6dd376632f6e42b94c20791d27fee2d856f80a22
[fa-stable.git] / includes / prefs / userprefs.inc
1 <?php
2
3 class user_prefs 
4 {
5
6         var $language;
7
8         var $qty_dec;
9         var $price_dec;
10         var     $exrate_dec;
11         var     $percent_dec;
12
13         var     $show_gl_info;
14         var     $show_codes;
15
16         var $date_format;
17         var $date_sep;
18         var $tho_sep;
19         var $dec_sep;
20         var $theme;
21         var $print_profile;
22         var $pagesize; // for printing
23         var $show_hints;
24
25         function user_prefs(&$user) 
26         {
27
28                 $this->language = $user["language"];
29                 language::set_language($this->language);
30
31                 $this->qty_dec = $user["qty_dec"];
32                 $this->price_dec = $user["prices_dec"];
33                 $this->exrate_dec = $user["rates_dec"];
34                 $this->percent_dec = $user["percent_dec"];
35
36                 $this->show_gl_info = $user["show_gl"];
37                 $this->show_codes = $user["show_codes"];
38                 $this->date_format = $user["date_format"];
39                 $this->date_sep = $user["date_sep"];
40                 $this->tho_sep = $user["tho_sep"];
41                 $this->dec_sep = $user["dec_sep"];
42                 $this->theme = $user["theme"];
43                 $this->pagesize = $user["page_size"];
44                 $this->show_hints = $user["show_hints"];
45                 $this->print_profile = $user["print_profile"];
46         }
47
48         function language() 
49         {
50                 return $this->language;
51         }
52
53         function qty_dec() 
54         {
55                 return $this->qty_dec;
56         }
57
58         function price_dec() 
59         {
60                 return $this->price_dec;
61         }
62
63         function exrate_dec() 
64         {
65                 return $this->exrate_dec;
66         }
67
68         function percent_dec() 
69         {
70                 return $this->percent_dec;
71         }
72
73         function show_gl_info() 
74         {
75                 return $this->show_gl_info;
76         }
77
78         function show_codes() 
79         {
80                 return $this->show_codes;
81         }
82
83         function date_format() 
84         {
85                 return $this->date_format;
86         }
87
88         function date_sep() 
89         {
90                 return $this->date_sep;
91         }
92
93         function date_display() 
94         {
95                 global $dateseps;
96                 $sep = $dateseps[$this->date_sep];
97                 if ($this->date_format == 0)
98                         return "m".$sep."d".$sep."Y";
99                 elseif ($this->date_format == 1)
100                         return "d".$sep."m".$sep."Y";
101                 else
102                         return "Y".$sep."m".$sep."d";
103         }
104
105         function tho_sep() 
106         {
107                 return $this->tho_sep;
108         }
109
110         function dec_sep() 
111         {
112                 return $this->dec_sep;
113         }
114
115         function get_theme() 
116         {
117                 return $this->theme;
118         }
119
120         function get_pagesize() 
121         {
122                 return $this->pagesize;
123         }
124
125         function show_hints() 
126         {
127                 return $this->show_hints;
128         }
129
130         function print_profile() 
131         {
132                 return $this->print_profile;
133         }
134
135         function set_dec($price_dec, $qty_dec, $exrate_dec, $percent_dec, $showgl, $showcodes) 
136         {
137                 $this->price_dec = $price_dec;
138                 $this->qty_dec = $qty_dec;
139                 $this->exrate_dec = $exrate_dec;
140                 $this->percent_dec = $percent_dec;
141                 $this->show_gl_info = $showgl;
142                 $this->show_codes = $showcodes;
143         }
144
145         function set_format($date_format, $date_sep, $tho_sep, $dec_sep, $theme, $pagesize) 
146         {
147                 $this->date_format = $date_format;
148                 $this->date_sep = $date_sep;
149                 $this->tho_sep = $tho_sep;
150                 $this->dec_sep = $dec_sep;
151                 $this->theme = $theme;
152                 $this->pagesize = $pagesize;
153         }
154
155 }
156
157 ?>