collapse display of location-changed packages, #25130
[freeside.git] / httemplate / pref / pref.html
1 <% include('/elements/header.html', 'Preferences for '. $FS::CurrentUser::CurrentUser->username ) %>
2
3 <FORM METHOD="POST" NAME="pref_form" ACTION="pref-process.html">
4
5 <% include('/elements/error.html') %>
6
7 % if ( FS::Auth->auth_class->can('change_password') ) {
8
9     <% mt('Change password (leave blank for no change)') |h %>
10     <% ntable("#cccccc",2) %>
11
12       <TR>
13         <TH ALIGN="right">Current password: </TH>
14         <TD><INPUT TYPE="password" NAME="_password"></TD>
15       </TR>
16
17       <TR>
18         <TH ALIGN="right">New password: </TH>
19         <TD><INPUT TYPE="password" NAME="new_password"></TD>
20       </TR>
21
22       <TR>
23        <TH ALIGN="right">Re-enter new password: </TH>
24        <TD><INPUT TYPE="password" NAME="new_password2"></TD>
25       </TR>
26
27     </TABLE>
28     <BR>
29
30 % }
31
32 Interface
33 <% ntable("#cccccc",2) %>
34
35   <TR>
36     <TH ALIGN="right">Locale: </TH>
37     <TD COLSPAN=2>
38       <SELECT NAME="locale">
39 %       foreach my $locale ( FS::Locales->locales ) {
40 %         my %info = FS::Locales->locale_info($locale);
41 %         my $selected = ($locale eq $curuser->option('locale'))
42 %                          ? 'SELECTED' : '';
43           <OPTION VALUE="<% $locale %>" <%$selected%>><% $info{name} %> (<% $info{country} %>)
44 %       }
45       </SELECT>
46     </TD>
47   </TR>
48
49   <TR>
50     <TH ALIGN="right">Menu location: </TH>
51     <TD>
52       <INPUT TYPE="radio" NAME="menu_position" VALUE="left" onClick="document.images['menu_example'].src='../images/menu-left-example.png';" <% $menu_position eq 'left' ? ' CHECKED' : ''%>> Left<BR>
53       <INPUT TYPE="radio" NAME="menu_position" VALUE="top"onClick="document.images['menu_example'].src='../images/menu-top-example.png';" <% $menu_position eq 'top' ? ' CHECKED' : ''%>> Top <BR>
54     </TD>
55     <TD><IMG NAME="menu_example" SRC="../images/menu-<% $menu_position %>-example.png"></TD>
56   </TR>
57
58   <TR>
59     <TH ALIGN="right">Enable mobile-friendly menu: </TH>
60     <TD COLSPAN=2>
61       <INPUT TYPE="checkbox" NAME="mobile_menu" VALUE="Y"
62 <% $curuser->option('mobile_menu') ? 'CHECKED' : '' %>>
63     </TD>
64   </TR>
65  
66   <TR>
67     <TH ALIGN="right">Default customer view: </TH>
68     <TD COLSPAN=2>
69       <SELECT NAME="default_customer_view">
70 %       foreach my $view ( keys %customer_views ) {
71 %         my $selected =
72 %           $customer_views{$view} eq $curuser->option('default_customer_view')
73 %             ? 'SELECTED'
74 %             : '';
75           <OPTION VALUE="<%$customer_views{$view}%>" <%$selected%>><%$view%></OPTION>
76 %       }
77       </SELECT>
78     </TD>
79   </TR>
80
81   <TR>
82     <TH ALIGN="right">Hide package changes: </TH>
83     <TD>
84     <& /elements/select.html,
85       field   => 'hide_package_changes',
86       options => [ '', 'location', 'all' ],
87       labels  => { ''         => 'never',
88                    'location' => 'location changes',
89                    'all'      => 'all package changes',
90                  },
91       curr_value => ($cgi->param('hide_package_changes') 
92                       || $curuser->option('hide_package_changes')),
93     &>
94     </TD>
95   </TR>
96
97 % my $history_order = $curuser->option('history_order') || 'oldest';
98   <TR>
99     <TH ALIGN="right">Customer history sort order: </TH>
100     <TD COLSPAN=2>
101       <& /elements/select.html,
102         field       => 'history_order',
103         curr_value  => $history_order,
104         options     => [ 'oldest', 'newest' ],
105         labels      => { 'oldest' => 'Oldest first',
106                          'newest' => 'Newest first',
107                        },
108       &>
109     </TD>
110   </TR>
111   
112   <TR>
113     <TH ALIGN="right">Spreadsheet download format: </TH>
114     <TD COLSPAN=2>
115       <SELECT NAME="spreadsheet_format">
116 %       my $xls =  $curuser->option('spreadsheet_format') eq 'XLS';
117 %       my $xlsx = $curuser->option('spreadsheet_format') eq 'XLSX';
118         <OPTION VALUE=""></OPTION>
119         <OPTION VALUE="XLS"<%  $xls ? 'SELECTED' : '' %>>XLS (Excel 97/2000/XP)
120         </OPTION>
121         <OPTION VALUE="XLSX"<% $xlsx ? 'SELECTED' : ''%>>XLSX (Excel 2007+)
122         </OPTION>
123       </SELECT>
124     </TD>
125   </TR>
126
127 % if ( FS::Conf->new->exists('enable_fuzzy_on_exact') ) {
128
129   <INPUT TYPE="hidden" NAME="enable_fuzzy_on_exact" VALUE="<% $curuser->option('enable_fuzzy_on_exact') ? 1 : 0 %>">
130
131 % } else {
132
133  <TR>
134     <TH ALIGN="right" COLSPAN=1>Enable approximate customer searching <BR>even when an exact match is found: </TH>
135     <TD ALIGN="left" COLSPAN=2>
136       <INPUT TYPE="checkbox" NAME="enable_fuzzy_on_exact" VALUE="1" <% $curuser->option('enable_fuzzy_on_exact') ? 'CHECKED' : '' %>>
137     </TD>
138   </TR>
139
140 % }
141
142   <TR>
143     <TH ALIGN="right" COLSPAN=1>Disable HTML editor for customer notes: </TH>
144     <TD ALIGN="left" COLSPAN=2>
145       <INPUT TYPE="checkbox" NAME="disable_html_editor" VALUE="1" <% $curuser->option('disable_html_editor') ? 'CHECKED' : '' %>>
146     </TD>
147   </TR>
148
149   <TR>
150     <TH ALIGN="right" COLSPAN=1>Disable submission on [Enter] key - one-time charges: </TH>
151     <TD ALIGN="left" COLSPAN=2>
152       <INPUT TYPE="checkbox" NAME="disable_enter_submit_onetimecharge" VALUE="1" <% $curuser->option('disable_enter_submit_onetimecharge') ? 'CHECKED' : '' %>>
153     </TD>
154   </TR>
155
156   <TR>
157     <TH ALIGN="right">Don't copy MAC address delimiters to clipboard</TH>
158     <TD ALIGN="left" COLSPAN=2>
159       <INPUT TYPE="checkbox" NAME="enable_mask_clipboard_hack" VALUE="1" <% $curuser->option('enable_mask_clipboard_hack') ? 'CHECKED' : '' %>>
160     </TD>
161   </TR>
162
163 </TABLE>
164 <BR>
165
166
167 Email Address
168 <% ntable("#cccccc",2) %>
169
170   <TR>
171     <TH>Email Address(es) (comma separated) </TH>
172     <TD>
173    <TD><INPUT TYPE="text" NAME="email_address" VALUE="<% $email_address %>">
174     </TD>
175   </TR>
176
177 </TABLE>
178 <BR>
179
180
181 Development
182 <% ntable("#cccccc",2) %>
183
184   <TR>
185     <TH>Show customer package timestamps: </TH>
186     <TD><INPUT TYPE="checkbox" NAME="cust_pkg-display_times" VALUE="1" <% $curuser->option('cust_pkg-display_times') ? 'CHECKED' : '' %>></TD>
187   </TR>
188   <TR>
189     <TH>Show internal package numbers: </TH>
190     <TD><INPUT TYPE="checkbox" NAME="show_pkgnum" VALUE="1" <% $curuser->option('show_pkgnum') ? 'CHECKED' : '' %>></TD>
191   </TR>
192   <TR>
193     <TH>Show config item counts: </TH>
194     <TD><INPUT TYPE="checkbox" NAME="show_confitem_counts" VALUE="1" <% $curuser->option('show_confitem_counts') ? 'CHECKED' : '' %>></TD>
195   </TR>
196   <TR>
197     <TH>Show export data on service view (when available): </TH>
198     <TD><INPUT TYPE="checkbox" NAME="export_getsettings" VALUE="1" <% $curuser->option('export_getsettings') ? 'CHECKED' : '' %>></TD>
199   </TR>
200   <TR>
201     <TH>Show database profiling (when available): </TH>
202     <TD><INPUT TYPE="checkbox" NAME="show_db_profile" VALUE="1" <% $curuser->option('show_db_profile') ? 'CHECKED' : '' %>></TD>
203   </TR>
204   <TR>
205     <TH>Save database profiling logs (when available): </TH>
206     <TD><INPUT TYPE="checkbox" NAME="save_db_profile" VALUE="1" <% $curuser->option('save_db_profile') ? 'CHECKED' : '' %>></TD>
207   </TR>
208   <TR>
209     <TH>Save temporary invoice typesetting files: </TH>
210     <TD><INPUT TYPE="checkbox" NAME="save_tmp_typesetting" VALUE="1" <% $curuser->option('save_tmp_typesetting') ? 'CHECKED' : '' %>></TD>
211   </TR>
212
213 </TABLE>
214 <BR>
215
216 SNOM integration
217 <% ntable("#cccccc",2) %>
218
219   <TR>
220     <TH ALIGN="right">SNOM IP address</TH>
221     <TD><INPUT TYPE="text" NAME="snom-ip" VALUE="<% $curuser->option('snom-ip') %>"></TD>
222   </TR>
223
224   <TR>
225     <TH ALIGN="right">SNOM HTTP username (if necessary)</TH>
226     <TD><INPUT TYPE="text" NAME="snom-username" VALUE="<% $curuser->option('snom-username') %>"></TD>
227   </TR>
228
229   <TR>
230     <TH ALIGN="right">SNOM HTTP password (if necessary)</TH>
231     <TD><INPUT TYPE="password" NAME="snom-password" VALUE="<% $curuser->option('snom-password') %>"></TD>
232   </TR>
233
234 </TABLE>
235 <BR>
236
237 OR<BR><BR>
238
239 Vonage integration (see <a href="https://secure.click2callu.com/">Click2Call</a>)
240 <% ntable("#cccccc",2) %>
241
242   <TR>
243     <TH ALIGN="right">Vonage phone number</TH>
244     <TD><INPUT TYPE="text" NAME="vonage-fromnumber" VALUE="<% $curuser->option('vonage-fromnumber') %>"></TD>
245   </TR>
246
247   <TR>
248     <TH ALIGN="right">Vonage username</TH>
249     <TD><INPUT TYPE="text" NAME="vonage-username" VALUE="<% $curuser->option('vonage-username') %>"></TD>
250   </TR>
251
252   <TR>
253     <TH ALIGN="right">Vonage password</TH>
254     <TD><INPUT TYPE="password" NAME="vonage-password" VALUE="<% $curuser->option('vonage-password') %>"></TD>
255   </TR>
256
257 </TABLE>
258 <BR>
259
260
261 % foreach my $prop (qw( height width availHeight availWidth colorDepth )) {
262   <INPUT TYPE="hidden" NAME="<% $prop %>" VALUE="">
263   <SCRIPT TYPE="text/javascript">
264   document.pref_form.<% $prop %>.value = screen.<% $prop %>;
265   </script>
266 % }
267
268 <INPUT TYPE="submit" VALUE="Update preferences">
269
270 <% include('/elements/footer.html') %>
271 <%init>
272
273 my $curuser = $FS::CurrentUser::CurrentUser;
274
275 #false laziness w/view/cust_main.cgi and Conf.pm (cust_main-default_view)
276
277 tie my %customer_views, 'Tie::IxHash',
278   'Basics'          => 'basics',
279   'Notes'           => 'notes', #notes and files?
280   'Tickets'         => 'tickets',
281   'Packages'        => 'packages',
282   'Payment History' => 'payment_history',
283 ;
284 $customer_views{'Change History'} = 'change_history'
285   if $curuser->access_right('View customer history');
286 $customer_views{'Jumbo'} = 'jumbo';
287
288 # XSS via your own preferences?  seems unlikely, but nice try anyway...
289 ( $curuser->option('menu_position') || 'top' )
290   =~ /^(\w+)$/ or die "illegal menu_position";
291 my $menu_position = $1;
292 ( $curuser->option('email_address') )
293   =~ /^([,\w\@.]*)$/ or die "illegal email_address";  #too late
294 my $email_address = $1;
295
296 </%init>