1 <% include('/elements/header.html', 'Preferences for '. $FS::CurrentUser::CurrentUser->username ) %>
3 <FORM METHOD="POST" NAME="pref_form" ACTION="pref-process.html">
5 <% include('/elements/error.html') %>
7 % if ( FS::Auth->auth_class->can('change_password') ) {
9 <% mt('Change password (leave blank for no change)') |h %>
10 <% ntable("#cccccc",2) %>
13 <TH ALIGN="right">Current password: </TH>
14 <TD><INPUT TYPE="password" NAME="_password"></TD>
18 <TH ALIGN="right">New password: </TH>
19 <TD><INPUT TYPE="password" NAME="new_password"></TD>
23 <TH ALIGN="right">Re-enter new password: </TH>
24 <TD><INPUT TYPE="password" NAME="new_password2"></TD>
33 <% ntable("#cccccc",2) %>
36 <TH ALIGN="right">Locale: </TH>
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'))
43 <OPTION VALUE="<% $locale %>" <%$selected%>><% $info{name} %> (<% $info{country} %>)
50 <TH ALIGN="right">Menu location: </TH>
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>
55 <TD><IMG NAME="menu_example" SRC="../images/menu-<% $menu_position %>-example.png"></TD>
59 <TH ALIGN="right">Enable mobile-friendly menu: </TH>
61 <INPUT TYPE="checkbox" NAME="mobile_menu" VALUE="Y"
62 <% $curuser->option('mobile_menu') ? 'CHECKED' : '' %>>
67 <TH ALIGN="right">Default customer view: </TH>
69 <SELECT NAME="default_customer_view">
70 % foreach my $view ( keys %customer_views ) {
72 % $customer_views{$view} eq $curuser->option('default_customer_view')
75 <OPTION VALUE="<%$customer_views{$view}%>" <%$selected%>><%$view%></OPTION>
82 <TH ALIGN="right">Hide package changes: </TH>
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',
91 curr_value => ($cgi->param('hide_package_changes')
92 || $curuser->option('hide_package_changes')),
97 % my $history_order = $curuser->option('history_order') || 'oldest';
99 <TH ALIGN="right">Customer history sort order: </TH>
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',
113 <TH ALIGN="right">Spreadsheet download format: </TH>
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)
121 <OPTION VALUE="XLSX"<% $xlsx ? 'SELECTED' : ''%>>XLSX (Excel 2007+)
127 % if ( FS::Conf->new->exists('enable_fuzzy_on_exact') ) {
129 <INPUT TYPE="hidden" NAME="enable_fuzzy_on_exact" VALUE="<% $curuser->option('enable_fuzzy_on_exact') ? 1 : 0 %>">
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' : '' %>>
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' : '' %>>
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' : '' %>>
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' : '' %>>
164 <TH ALIGN="right">How many recently-modified customers displayed on dashboard</TH>
165 <TD ALIGN="left" COLSPAN=2>
166 <INPUT TYPE="text" NAME="dashboard_customers" VALUE="<% $curuser->option('dashboard_customers') %>"></TD>
175 <% ntable("#cccccc",2) %>
178 <TH>Email Address(es) (comma separated) </TH>
180 <TD><INPUT TYPE="text" NAME="email_address" VALUE="<% $email_address %>">
189 <% ntable("#cccccc",2) %>
192 <TH>Show customer package timestamps: </TH>
193 <TD><INPUT TYPE="checkbox" NAME="cust_pkg-display_times" VALUE="1" <% $curuser->option('cust_pkg-display_times') ? 'CHECKED' : '' %>></TD>
196 <TH>Show internal package numbers: </TH>
197 <TD><INPUT TYPE="checkbox" NAME="show_pkgnum" VALUE="1" <% $curuser->option('show_pkgnum') ? 'CHECKED' : '' %>></TD>
200 <TH>Show config item counts: </TH>
201 <TD><INPUT TYPE="checkbox" NAME="show_confitem_counts" VALUE="1" <% $curuser->option('show_confitem_counts') ? 'CHECKED' : '' %>></TD>
204 <TH>Show export data on service view (when available): </TH>
205 <TD><INPUT TYPE="checkbox" NAME="export_getsettings" VALUE="1" <% $curuser->option('export_getsettings') ? 'CHECKED' : '' %>></TD>
208 <TH>Show database profiling (when available): </TH>
209 <TD><INPUT TYPE="checkbox" NAME="show_db_profile" VALUE="1" <% $curuser->option('show_db_profile') ? 'CHECKED' : '' %>></TD>
212 <TH>Save database profiling logs (when available): </TH>
213 <TD><INPUT TYPE="checkbox" NAME="save_db_profile" VALUE="1" <% $curuser->option('save_db_profile') ? 'CHECKED' : '' %>></TD>
216 <TH>Save temporary invoice typesetting files: </TH>
217 <TD><INPUT TYPE="checkbox" NAME="save_tmp_typesetting" VALUE="1" <% $curuser->option('save_tmp_typesetting') ? 'CHECKED' : '' %>></TD>
224 <% ntable("#cccccc",2) %>
227 <TH ALIGN="right">SNOM IP address</TH>
228 <TD><INPUT TYPE="text" NAME="snom-ip" VALUE="<% $curuser->option('snom-ip') %>"></TD>
232 <TH ALIGN="right">SNOM HTTP username (if necessary)</TH>
233 <TD><INPUT TYPE="text" NAME="snom-username" VALUE="<% $curuser->option('snom-username') %>"></TD>
237 <TH ALIGN="right">SNOM HTTP password (if necessary)</TH>
238 <TD><INPUT TYPE="password" NAME="snom-password" VALUE="<% $curuser->option('snom-password') %>"></TD>
246 Vonage integration (see <a href="https://secure.click2callu.com/">Click2Call</a>)
247 <% ntable("#cccccc",2) %>
250 <TH ALIGN="right">Vonage phone number</TH>
251 <TD><INPUT TYPE="text" NAME="vonage-fromnumber" VALUE="<% $curuser->option('vonage-fromnumber') %>"></TD>
255 <TH ALIGN="right">Vonage username</TH>
256 <TD><INPUT TYPE="text" NAME="vonage-username" VALUE="<% $curuser->option('vonage-username') %>"></TD>
260 <TH ALIGN="right">Vonage password</TH>
261 <TD><INPUT TYPE="password" NAME="vonage-password" VALUE="<% $curuser->option('vonage-password') %>"></TD>
268 % foreach my $prop (qw( height width availHeight availWidth colorDepth )) {
269 <INPUT TYPE="hidden" NAME="<% $prop %>" VALUE="">
270 <SCRIPT TYPE="text/javascript">
271 document.pref_form.<% $prop %>.value = screen.<% $prop %>;
275 <INPUT TYPE="submit" VALUE="Update preferences">
277 <% include('/elements/footer.html') %>
280 my $curuser = $FS::CurrentUser::CurrentUser;
282 #false laziness w/view/cust_main.cgi and Conf.pm (cust_main-default_view)
284 tie my %customer_views, 'Tie::IxHash',
285 'Basics' => 'basics',
286 'Notes' => 'notes', #notes and files?
287 'Tickets' => 'tickets',
288 'Packages' => 'packages',
289 'Payment History' => 'payment_history',
291 $customer_views{'Change History'} = 'change_history'
292 if $curuser->access_right('View customer history');
293 $customer_views{'Jumbo'} = 'jumbo';
295 # XSS via your own preferences? seems unlikely, but nice try anyway...
296 ( $curuser->option('menu_position') || 'top' )
297 =~ /^(\w+)$/ or die "illegal menu_position";
298 my $menu_position = $1;
299 ( $curuser->option('email_address') )
300 =~ /^([,\w\@.]*)$/ or die "illegal email_address"; #too late
301 my $email_address = $1;