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