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