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