1 <% include('/elements/header.html', 'Preferences for '. getotaker ) %>
3 % my $js_form_validate = { 'pref_form' => { 'name' => 'pref_form' } };
5 <FORM METHOD="POST" NAME="pref_form" ACTION="pref-process.html">
7 <% include('/elements/error.html') %>
11 <& /elements/alert.html &>
13 % if ( FS::Auth->auth_class->can('change_password') ) {
15 <% mt('Change password (leave blank for no change)') |h %>
16 <% ntable("#cccccc",2) %>
19 <TH ALIGN="right">Current password: </TH>
20 <TD><INPUT TYPE="password" NAME="_password"></TD>
24 <TH ALIGN="right">New password: </TH>
25 <TD><INPUT TYPE="password" NAME="new_password"></TD>
29 <TH ALIGN="right">Re-enter new password: </TH>
30 <TD><INPUT TYPE="password" NAME="new_password2"></TD>
38 <% ntable("#cccccc",2) %>
41 <TH ALIGN="right">Locale: </TH>
43 <SELECT NAME="locale">
44 % foreach my $locale ( FS::Locales->locales ) {
45 % my %info = FS::Locales->locale_info($locale);
46 % my $selected = ($locale eq $curuser->option('locale'))
48 <OPTION VALUE="<% $locale %>" <%$selected%>><% $info{name} %> (<% $info{country} %>)
55 <TH ALIGN="right">Menu location: </TH>
57 <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>
58 <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>
60 <TD><IMG NAME="menu_example" SRC="../images/menu-<% $menu_position %>-example.png"></TD>
64 <TH ALIGN="right">Enable mobile-friendly menu: </TH>
66 <INPUT TYPE="checkbox" NAME="mobile_menu" VALUE="Y"
67 <% $curuser->option('mobile_menu') ? 'CHECKED' : '' %>>
72 <TH ALIGN="right">Default customer view: </TH>
74 <SELECT NAME="default_customer_view">
75 % foreach my $view ( keys %customer_views ) {
77 % $customer_views{$view} eq $curuser->option('default_customer_view')
80 <OPTION VALUE="<%$customer_views{$view}%>" <%$selected%>><%$view%></OPTION>
86 % my $history_order = $curuser->option('history_order') || 'oldest';
88 <TH ALIGN="right">Customer history sort order: </TH>
90 <& /elements/select.html,
91 field => 'history_order',
92 curr_value => $history_order,
93 options => [ 'oldest', 'newest' ],
94 labels => { 'oldest' => 'Oldest first',
95 'newest' => 'Newest first',
102 <TH ALIGN="right">Spreadsheet download format: </TH>
104 <SELECT NAME="spreadsheet_format">
105 % my $xls = $curuser->option('spreadsheet_format') eq 'XLS';
106 % my $xlsx = $curuser->option('spreadsheet_format') eq 'XLSX';
107 <OPTION VALUE=""></OPTION>
108 <OPTION VALUE="XLS"<% $xls ? 'SELECTED' : '' %>>XLS (Excel 97/2000/XP)
110 <OPTION VALUE="XLSX"<% $xlsx ? 'SELECTED' : ''%>>XLSX (Excel 2007+)
116 % if ( FS::Conf->new->exists('enable_fuzzy_on_exact') ) {
118 <INPUT TYPE="hidden" NAME="enable_fuzzy_on_exact" VALUE="<% $curuser->option('enable_fuzzy_on_exact') ? 1 : 0 %>">
123 <TH ALIGN="right" COLSPAN=1>Enable approximate customer searching <BR>even when an exact match is found: </TH>
124 <TD ALIGN="left" COLSPAN=2>
125 <INPUT TYPE="checkbox" NAME="enable_fuzzy_on_exact" VALUE="1" <% $curuser->option('enable_fuzzy_on_exact') ? 'CHECKED' : '' %>>
132 <TH ALIGN="right" COLSPAN=1>Disable HTML editor for customer notes: </TH>
133 <TD ALIGN="left" COLSPAN=2>
134 <INPUT TYPE="checkbox" NAME="disable_html_editor" VALUE="1" <% $curuser->option('disable_html_editor') ? 'CHECKED' : '' %>>
139 <TH ALIGN="right" COLSPAN=1>Disable submission on [Enter] key - one-time charges: </TH>
140 <TD ALIGN="left" COLSPAN=2>
141 <INPUT TYPE="checkbox" NAME="disable_enter_submit_onetimecharge" VALUE="1" <% $curuser->option('disable_enter_submit_onetimecharge') ? 'CHECKED' : '' %>>
146 <TH ALIGN="right">Don't copy MAC address delimiters to clipboard</TH>
147 <TD ALIGN="left" COLSPAN=2>
148 <INPUT TYPE="checkbox" NAME="enable_mask_clipboard_hack" VALUE="1" <% $curuser->option('enable_mask_clipboard_hack') ? 'CHECKED' : '' %>>
153 <TH ALIGN="right">When printing, scale HTML documents to fit on a letter-size page</TH>
155 <INPUT TYPE="checkbox" NAME="printtofit" VALUE="Y" <% $curuser->option('printtofit') ? 'CHECKED' : '' %>>
160 <TH ALIGN="right"><% emt("How many recently-modified customers displayed on dashboard") %></TH>
161 <TD ALIGN="left" COLSPAN=2>
162 <INPUT TYPE="text" NAME="dashboard_customers" VALUE="<% $curuser->option('dashboard_customers') %>"></TD>
166 % my $validate_field_cve = 'customer_view_emails';
167 % $js_form_validate->{pref_form}->{validate_fields}{$validate_field_cve} = 'digits: true';
168 % $js_form_validate->{pref_form}->{error_message}{$validate_field_cve} = 'Please only enter numbers here.';
171 <TH ALIGN="right">How many recent outbound emails to show in customer view</TH>
172 <TD ALIGN="left" COLSPAN=2>
173 <INPUT TYPE="text" ID="<% $validate_field_cve %>" NAME="<% $validate_field_cve %>" VALUE="<% $curuser->option('customer_view_emails') %>"></TD>
182 <% ntable("#cccccc",2) %>
185 <TH>Email Address(es) (comma separated) </TH>
187 <TD><INPUT TYPE="text" NAME="email_address" VALUE="<% $email_address %>">
196 <% ntable("#cccccc",2) %>
199 <TH>Show customer package timestamps: </TH>
200 <TD><INPUT TYPE="checkbox" NAME="cust_pkg-display_times" VALUE="1" <% $curuser->option('cust_pkg-display_times') ? 'CHECKED' : '' %>></TD>
203 <TH>Show internal package numbers: </TH>
204 <TD><INPUT TYPE="checkbox" NAME="show_pkgnum" VALUE="1" <% $curuser->option('show_pkgnum') ? 'CHECKED' : '' %>></TD>
207 <TH>Show config item counts: </TH>
208 <TD><INPUT TYPE="checkbox" NAME="show_confitem_counts" VALUE="1" <% $curuser->option('show_confitem_counts') ? 'CHECKED' : '' %>></TD>
211 <TH>Show export data on service view (when available): </TH>
212 <TD><INPUT TYPE="checkbox" NAME="export_getsettings" VALUE="1" <% $curuser->option('export_getsettings') ? 'CHECKED' : '' %>></TD>
215 <TH>Show database profiling (when available): </TH>
216 <TD><INPUT TYPE="checkbox" NAME="show_db_profile" VALUE="1" <% $curuser->option('show_db_profile') ? 'CHECKED' : '' %>></TD>
219 <TH>Save database profiling logs (when available): </TH>
220 <TD><INPUT TYPE="checkbox" NAME="save_db_profile" VALUE="1" <% $curuser->option('save_db_profile') ? 'CHECKED' : '' %>></TD>
223 <TH>Save temporary invoice typesetting files: </TH>
224 <TD><INPUT TYPE="checkbox" NAME="save_tmp_typesetting" VALUE="1" <% $curuser->option('save_tmp_typesetting') ? 'CHECKED' : '' %>></TD>
230 % if ( $curuser->access_right('Employee preference telephony integration') ) {
233 <% ntable("#cccccc",2) %>
236 <TH ALIGN="right">SNOM IP address</TH>
237 <TD><INPUT TYPE="text" NAME="snom-ip" VALUE="<% $curuser->option('snom-ip') %>"></TD>
241 <TH ALIGN="right">SNOM HTTP username (if necessary)</TH>
242 <TD><INPUT TYPE="text" NAME="snom-username" VALUE="<% $curuser->option('snom-username') %>"></TD>
246 <TH ALIGN="right">SNOM HTTP password (if necessary)</TH>
247 <TD><INPUT TYPE="password" NAME="snom-password" VALUE="<% $curuser->option('snom-password') %>"></TD>
255 Vonage integration (see <a href="https://secure.click2callu.com/">Click2Call</a>)
256 <% ntable("#cccccc",2) %>
259 <TH ALIGN="right">Vonage phone number</TH>
260 <TD><INPUT TYPE="text" NAME="vonage-fromnumber" VALUE="<% $curuser->option('vonage-fromnumber') %>"></TD>
264 <TH ALIGN="right">Vonage username</TH>
265 <TD><INPUT TYPE="text" NAME="vonage-username" VALUE="<% $curuser->option('vonage-username') %>"></TD>
269 <TH ALIGN="right">Vonage password</TH>
270 <TD><INPUT TYPE="password" NAME="vonage-password" VALUE="<% $curuser->option('vonage-password') %>"></TD>
278 % foreach my $prop (qw( height width availHeight availWidth colorDepth )) {
279 <INPUT TYPE="hidden" NAME="<% $prop %>" VALUE="">
280 <SCRIPT TYPE="text/javascript">
281 document.pref_form.<% $prop %>.value = screen.<% $prop %>;
285 <INPUT TYPE="submit" VALUE="Update preferences">
288 % 'formvalidation' => $js_form_validate,
290 <% include("/elements/footer.html", %footerdata) %>
294 my $curuser = $FS::CurrentUser::CurrentUser;
296 #false laziness w/view/cust_main.cgi and Conf.pm (cust_main-default_view)
298 tie my %customer_views, 'Tie::IxHash',
299 'Basics' => 'basics',
300 'Notes' => 'notes', #notes and files?
301 'Tickets' => 'tickets',
302 'Packages' => 'packages',
303 'Payment History' => 'payment_history',
305 $customer_views{'Change History'} = 'change_history'
306 if $curuser->access_right('View customer history');
307 $customer_views{'Jumbo'} = 'jumbo';
309 # XSS via your own preferences? seems unlikely, but nice try anyway...
310 ( $curuser->option('menu_position') || 'top' )
311 =~ /^(\w+)$/ or die "illegal menu_position";
312 my $menu_position = $1;
313 ( $curuser->option('email_address') )
314 =~ /^([,\w\@.\-]*)$/ or die "illegal email_address"; #too late
315 my $email_address = $1;