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