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