886046b8950cef2c9625b4e803b6a8b9d797a26f
[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 % if ( FS::Conf->new->exists('enable_fuzzy_on_exact') ) {
110
111   <INPUT TYPE="hidden" NAME="enable_fuzzy_on_exact" VALUE="<% $curuser->option('enable_fuzzy_on_exact') ? 1 : 0 %>">
112
113 % } else {
114
115  <TR>
116     <TH ALIGN="right" COLSPAN=1>Enable approximate customer searching <BR>even when an exact match is found: </TH>
117     <TD ALIGN="left" COLSPAN=2>
118       <INPUT TYPE="checkbox" NAME="enable_fuzzy_on_exact" VALUE="1" <% $curuser->option('enable_fuzzy_on_exact') ? 'CHECKED' : '' %>>
119     </TD>
120   </TR>
121
122 % }
123
124   <TR>
125     <TH ALIGN="right" COLSPAN=1>Disable HTML editor for customer notes: </TH>
126     <TD ALIGN="left" COLSPAN=2>
127       <INPUT TYPE="checkbox" NAME="disable_html_editor" VALUE="1" <% $curuser->option('disable_html_editor') ? 'CHECKED' : '' %>>
128     </TD>
129   </TR>
130
131   <TR>
132     <TH ALIGN="right" COLSPAN=1>Disable submission on [Enter] key - one-time charges: </TH>
133     <TD ALIGN="left" COLSPAN=2>
134       <INPUT TYPE="checkbox" NAME="disable_enter_submit_onetimecharge" VALUE="1" <% $curuser->option('disable_enter_submit_onetimecharge') ? 'CHECKED' : '' %>>
135     </TD>
136   </TR>
137
138   <TR>
139     <TH ALIGN="right">Don't copy MAC address delimiters to clipboard</TH>
140     <TD ALIGN="left" COLSPAN=2>
141       <INPUT TYPE="checkbox" NAME="enable_mask_clipboard_hack" VALUE="1" <% $curuser->option('enable_mask_clipboard_hack') ? 'CHECKED' : '' %>>
142     </TD>
143   </TR>
144
145 </TABLE>
146 <BR>
147
148
149 Email Address
150 <% ntable("#cccccc",2) %>
151
152   <TR>
153     <TH>Email Address(es) (comma separated) </TH>
154     <TD>
155    <TD><INPUT TYPE="text" NAME="email_address" VALUE="<% $email_address %>">
156     </TD>
157   </TR>
158
159 </TABLE>
160 <BR>
161
162
163 Development
164 <% ntable("#cccccc",2) %>
165
166   <TR>
167     <TH>Show customer package timestamps: </TH>
168     <TD><INPUT TYPE="checkbox" NAME="cust_pkg-display_times" VALUE="1" <% $curuser->option('cust_pkg-display_times') ? 'CHECKED' : '' %>></TD>
169   </TR>
170   <TR>
171     <TH>Show internal package numbers: </TH>
172     <TD><INPUT TYPE="checkbox" NAME="show_pkgnum" VALUE="1" <% $curuser->option('show_pkgnum') ? 'CHECKED' : '' %>></TD>
173   </TR>
174   <TR>
175     <TH>Show config item counts: </TH>
176     <TD><INPUT TYPE="checkbox" NAME="show_confitem_counts" VALUE="1" <% $curuser->option('show_confitem_counts') ? 'CHECKED' : '' %>></TD>
177   </TR>
178   <TR>
179     <TH>Show export data on service view (when available): </TH>
180     <TD><INPUT TYPE="checkbox" NAME="export_getsettings" VALUE="1" <% $curuser->option('export_getsettings') ? 'CHECKED' : '' %>></TD>
181   </TR>
182   <TR>
183     <TH>Show database profiling (when available): </TH>
184     <TD><INPUT TYPE="checkbox" NAME="show_db_profile" VALUE="1" <% $curuser->option('show_db_profile') ? 'CHECKED' : '' %>></TD>
185   </TR>
186   <TR>
187     <TH>Save database profiling logs (when available): </TH>
188     <TD><INPUT TYPE="checkbox" NAME="save_db_profile" VALUE="1" <% $curuser->option('save_db_profile') ? 'CHECKED' : '' %>></TD>
189   </TR>
190   <TR>
191     <TH>Save temporary invoice typesetting files: </TH>
192     <TD><INPUT TYPE="checkbox" NAME="save_tmp_typesetting" VALUE="1" <% $curuser->option('save_tmp_typesetting') ? 'CHECKED' : '' %>></TD>
193   </TR>
194
195 </TABLE>
196 <BR>
197
198 SNOM integration
199 <% ntable("#cccccc",2) %>
200
201   <TR>
202     <TH ALIGN="right">SNOM IP address</TH>
203     <TD><INPUT TYPE="text" NAME="snom-ip" VALUE="<% $curuser->option('snom-ip') %>"></TD>
204   </TR>
205
206   <TR>
207     <TH ALIGN="right">SNOM HTTP username (if necessary)</TH>
208     <TD><INPUT TYPE="text" NAME="snom-username" VALUE="<% $curuser->option('snom-username') %>"></TD>
209   </TR>
210
211   <TR>
212     <TH ALIGN="right">SNOM HTTP password (if necessary)</TH>
213     <TD><INPUT TYPE="password" NAME="snom-password" VALUE="<% $curuser->option('snom-password') %>"></TD>
214   </TR>
215
216 </TABLE>
217 <BR>
218
219 OR<BR><BR>
220
221 Vonage integration (see <a href="https://secure.click2callu.com/">Click2Call</a>)
222 <% ntable("#cccccc",2) %>
223
224   <TR>
225     <TH ALIGN="right">Vonage phone number</TH>
226     <TD><INPUT TYPE="text" NAME="vonage-fromnumber" VALUE="<% $curuser->option('vonage-fromnumber') %>"></TD>
227   </TR>
228
229   <TR>
230     <TH ALIGN="right">Vonage username</TH>
231     <TD><INPUT TYPE="text" NAME="vonage-username" VALUE="<% $curuser->option('vonage-username') %>"></TD>
232   </TR>
233
234   <TR>
235     <TH ALIGN="right">Vonage password</TH>
236     <TD><INPUT TYPE="password" NAME="vonage-password" VALUE="<% $curuser->option('vonage-password') %>"></TD>
237   </TR>
238
239 </TABLE>
240 <BR>
241
242
243 % foreach my $prop (qw( height width availHeight availWidth colorDepth )) {
244   <INPUT TYPE="hidden" NAME="<% $prop %>" VALUE="">
245   <SCRIPT TYPE="text/javascript">
246   document.pref_form.<% $prop %>.value = screen.<% $prop %>;
247   </script>
248 % }
249
250 <INPUT TYPE="submit" VALUE="Update preferences">
251
252 <% include('/elements/footer.html') %>
253 <%init>
254
255 my $curuser = $FS::CurrentUser::CurrentUser;
256
257 #false laziness w/view/cust_main.cgi and Conf.pm (cust_main-default_view)
258
259 tie my %customer_views, 'Tie::IxHash',
260   'Basics'          => 'basics',
261   'Notes'           => 'notes', #notes and files?
262   'Tickets'         => 'tickets',
263   'Packages'        => 'packages',
264   'Payment History' => 'payment_history',
265 ;
266 $customer_views{'Change History'} = 'change_history'
267   if $curuser->access_right('View customer history');
268 $customer_views{'Jumbo'} = 'jumbo';
269
270 # XSS via your own preferences?  seems unlikely, but nice try anyway...
271 ( $curuser->option('menu_position') || 'top' )
272   =~ /^(\w+)$/ or die "illegal menu_position";
273 my $menu_position = $1;
274 ( $curuser->option('email_address') )
275   =~ /^([,\w\@.]*)$/ or die "illegal email_address";  #too late
276 my $email_address = $1;
277
278 </%init>