5babb018118debf0b68bd826ed1feda2aa8a3a19
[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 <% mt('Change password (leave blank for no change)') |h %>
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 % my $history_order = $curuser->option('history_order') || 'oldest';
80   <TR>
81     <TH ALIGN="right">Customer history sort order: </TH>
82     <TD COLSPAN=2>
83       <& /elements/select.html,
84         field       => 'history_order',
85         curr_value  => $history_order,
86         options     => [ 'oldest', 'newest' ],
87         labels      => { 'oldest' => 'Oldest first',
88                          'newest' => 'Newest first',
89                        },
90       &>
91     </TD>
92   </TR>
93   
94   <TR>
95     <TH ALIGN="right">Spreadsheet download format: </TH>
96     <TD COLSPAN=2>
97       <SELECT NAME="spreadsheet_format">
98 %       my $xls =  $curuser->option('spreadsheet_format') eq 'XLS';
99 %       my $xlsx = $curuser->option('spreadsheet_format') eq 'XLSX';
100         <OPTION VALUE=""></OPTION>
101         <OPTION VALUE="XLS"<%  $xls ? 'SELECTED' : '' %>>XLS (Excel 97/2000/XP)
102         </OPTION>
103         <OPTION VALUE="XLSX"<% $xlsx ? 'SELECTED' : ''%>>XLSX (Excel 2007+)
104         </OPTION>
105       </SELECT>
106     </TD>
107   </TR>
108
109  <TR>
110     <TH ALIGN="right" COLSPAN=1>Enable approximate customer searching <BR>even when an exact match is found: </TH>
111     <TD ALIGN="left" COLSPAN=2>
112       <INPUT TYPE="checkbox" NAME="enable_fuzzy_on_exact" VALUE="1" <% $curuser->option('enable_fuzzy_on_exact') ? 'CHECKED' : '' %>>
113     </TD>
114   </TR>
115
116   <TR>
117     <TH ALIGN="right" COLSPAN=1>Disable HTML editor for customer notes: </TH>
118     <TD ALIGN="left" COLSPAN=2>
119       <INPUT TYPE="checkbox" NAME="disable_html_editor" VALUE="1" <% $curuser->option('disable_html_editor') ? 'CHECKED' : '' %>>
120     </TD>
121   </TR>
122
123   <TR>
124     <TH ALIGN="right" COLSPAN=1>Disable submission on [Enter] key - one-time charges: </TH>
125     <TD ALIGN="left" COLSPAN=2>
126       <INPUT TYPE="checkbox" NAME="disable_enter_submit_onetimecharge" VALUE="1" <% $curuser->option('disable_enter_submit_onetimecharge') ? 'CHECKED' : '' %>>
127     </TD>
128   </TR>
129
130 </TABLE>
131 <BR>
132
133
134 Email Address
135 <% ntable("#cccccc",2) %>
136
137   <TR>
138     <TH>Email Address(es) (comma separated) </TH>
139     <TD>
140    <TD><INPUT TYPE="text" NAME="email_address" VALUE="<% $email_address %>">
141     </TD>
142   </TR>
143
144 </TABLE>
145 <BR>
146
147
148 Development
149 <% ntable("#cccccc",2) %>
150
151   <TR>
152     <TH>Show customer package timestamps: </TH>
153     <TD><INPUT TYPE="checkbox" NAME="cust_pkg-display_times" VALUE="1" <% $curuser->option('cust_pkg-display_times') ? 'CHECKED' : '' %>></TD>
154   </TR>
155   <TR>
156     <TH>Show internal package numbers: </TH>
157     <TD><INPUT TYPE="checkbox" NAME="show_pkgnum" VALUE="1" <% $curuser->option('show_pkgnum') ? 'CHECKED' : '' %>></TD>
158   </TR>
159   <TR>
160     <TH>Show config item counts: </TH>
161     <TD><INPUT TYPE="checkbox" NAME="show_confitem_counts" VALUE="1" <% $curuser->option('show_confitem_counts') ? 'CHECKED' : '' %>></TD>
162   </TR>
163   <TR>
164     <TH>Show export data on service view (when available): </TH>
165     <TD><INPUT TYPE="checkbox" NAME="export_getsettings" VALUE="1" <% $curuser->option('export_getsettings') ? 'CHECKED' : '' %>></TD>
166   </TR>
167   <TR>
168     <TH>Show database profiling (when available): </TH>
169     <TD><INPUT TYPE="checkbox" NAME="show_db_profile" VALUE="1" <% $curuser->option('show_db_profile') ? 'CHECKED' : '' %>></TD>
170   </TR>
171   <TR>
172     <TH>Save database profiling logs (when available): </TH>
173     <TD><INPUT TYPE="checkbox" NAME="save_db_profile" VALUE="1" <% $curuser->option('save_db_profile') ? 'CHECKED' : '' %>></TD>
174   </TR>
175   <TR>
176     <TH>Save temporary invoice typesetting files: </TH>
177     <TD><INPUT TYPE="checkbox" NAME="save_tmp_typesetting" VALUE="1" <% $curuser->option('save_tmp_typesetting') ? 'CHECKED' : '' %>></TD>
178   </TR>
179
180 </TABLE>
181 <BR>
182
183 SNOM integration
184 <% ntable("#cccccc",2) %>
185
186   <TR>
187     <TH ALIGN="right">SNOM IP address</TH>
188     <TD><INPUT TYPE="text" NAME="snom-ip" VALUE="<% $curuser->option('snom-ip') %>"></TD>
189   </TR>
190
191   <TR>
192     <TH ALIGN="right">SNOM HTTP username (if necessary)</TH>
193     <TD><INPUT TYPE="text" NAME="snom-username" VALUE="<% $curuser->option('snom-username') %>"></TD>
194   </TR>
195
196   <TR>
197     <TH ALIGN="right">SNOM HTTP password (if necessary)</TH>
198     <TD><INPUT TYPE="password" NAME="snom-password" VALUE="<% $curuser->option('snom-password') %>"></TD>
199   </TR>
200
201 </TABLE>
202 <BR>
203
204 OR<BR><BR>
205
206 Vonage integration (see <a href="https://secure.click2callu.com/">Click2Call</a>)
207 <% ntable("#cccccc",2) %>
208
209   <TR>
210     <TH ALIGN="right">Vonage phone number</TH>
211     <TD><INPUT TYPE="text" NAME="vonage-fromnumber" VALUE="<% $curuser->option('vonage-fromnumber') %>"></TD>
212   </TR>
213
214   <TR>
215     <TH ALIGN="right">Vonage username</TH>
216     <TD><INPUT TYPE="text" NAME="vonage-username" VALUE="<% $curuser->option('vonage-username') %>"></TD>
217   </TR>
218
219   <TR>
220     <TH ALIGN="right">Vonage password</TH>
221     <TD><INPUT TYPE="password" NAME="vonage-password" VALUE="<% $curuser->option('vonage-password') %>"></TD>
222   </TR>
223
224 </TABLE>
225 <BR>
226
227
228 % foreach my $prop (qw( height width availHeight availWidth colorDepth )) {
229   <INPUT TYPE="hidden" NAME="<% $prop %>" VALUE="">
230   <SCRIPT TYPE="text/javascript">
231   document.pref_form.<% $prop %>.value = screen.<% $prop %>;
232   </script>
233 % }
234
235 <INPUT TYPE="submit" VALUE="Update preferences">
236
237 <% include('/elements/footer.html') %>
238 <%init>
239
240 my $curuser = $FS::CurrentUser::CurrentUser;
241
242 #false laziness w/view/cust_main.cgi and Conf.pm (cust_main-default_view)
243
244 tie my %customer_views, 'Tie::IxHash',
245   'Basics'          => 'basics',
246   'Notes'           => 'notes', #notes and files?
247   'Tickets'         => 'tickets',
248   'Packages'        => 'packages',
249   'Payment History' => 'payment_history',
250 ;
251 $customer_views{'Change History'} = 'change_history'
252   if $curuser->access_right('View customer history');
253 $customer_views{'Jumbo'} = 'jumbo';
254
255 # XSS via your own preferences?  seems unlikely, but nice try anyway...
256 ( $curuser->option('menu_position') || 'top' )
257   =~ /^(\w+)$/ or die "illegal menu_position";
258 my $menu_position = $1;
259 ( $curuser->option('email_address') )
260   =~ /^([,\w\@.]*)$/ or die "illegal email_address";  #too late
261 my $email_address = $1;
262
263 </%init>