1 <% include('/elements/header.html', 'Preferences for '. getotaker ) %>
3 <FORM METHOD="POST" NAME="pref_form" ACTION="pref-process.html">
5 <% include('/elements/error.html') %>
8 <% mt('Change password (leave blank for no change)') |h %>
9 <% ntable("#cccccc",2) %>
12 <TH ALIGN="right">Current password: </TH>
13 <TD><INPUT TYPE="password" NAME="_password"></TD>
17 <TH ALIGN="right">New password: </TH>
18 <TD><INPUT TYPE="password" NAME="new_password"></TD>
22 <TH ALIGN="right">Re-enter new password: </TH>
23 <TD><INPUT TYPE="password" NAME="new_password2"></TD>
31 <% ntable("#cccccc",2) %>
34 <TH ALIGN="right">Locale: </TH>
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'))
41 <OPTION VALUE="<% $locale %>" <%$selected%>><% $info{name} %> (<% $info{country} %>)
48 <TH ALIGN="right">Menu location: </TH>
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>
53 <TD><IMG NAME="menu_example" SRC="../images/menu-<% $menu_position %>-example.png"></TD>
57 <TH ALIGN="right">Enable mobile-friendly menu: </TH>
59 <INPUT TYPE="checkbox" NAME="mobile_menu" VALUE="Y"
60 <% $curuser->option('mobile_menu') ? 'CHECKED' : '' %>>
65 <TH ALIGN="right">Default customer view: </TH>
67 <SELECT NAME="default_customer_view">
68 % foreach my $view ( keys %customer_views ) {
70 % $customer_views{$view} eq $curuser->option('default_customer_view')
73 <OPTION VALUE="<%$customer_views{$view}%>" <%$selected%>><%$view%></OPTION>
79 % my $history_order = $curuser->option('history_order') || 'oldest';
81 <TH ALIGN="right">Customer history sort order: </TH>
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',
95 <TH ALIGN="right">Spreadsheet download format: </TH>
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)
103 <OPTION VALUE="XLSX"<% $xlsx ? 'SELECTED' : ''%>>XLSX (Excel 2007+)
109 % if ( FS::Conf->new->exists('enable_fuzzy_on_exact') ) {
111 <INPUT TYPE="hidden" NAME="enable_fuzzy_on_exact" VALUE="<% $curuser->option('enable_fuzzy_on_exact') ? 1 : 0 %>">
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' : '' %>>
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' : '' %>>
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' : '' %>>
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' : '' %>>
146 <TH ALIGN="right">How many recently-modified customers displayed on dashboard</TH>
147 <TD ALIGN="left" COLSPAN=2>
148 <INPUT TYPE="text" NAME="dashboard_customers" VALUE="<% $curuser->option('dashboard_customers') %>"></TD>
153 <TH ALIGN="right">How many recent outbound emails to show in customer view</TH>
154 <TD ALIGN="left" COLSPAN=2>
155 <INPUT TYPE="text" NAME="customer_view_emails" VALUE="<% $curuser->option('customer_view_emails') %>"></TD>
166 <% ntable("#cccccc",2) %>
169 <TH>Email Address(es) (comma separated) </TH>
171 <TD><INPUT TYPE="text" NAME="email_address" VALUE="<% $email_address %>">
180 <% ntable("#cccccc",2) %>
183 <TH>Show customer package timestamps: </TH>
184 <TD><INPUT TYPE="checkbox" NAME="cust_pkg-display_times" VALUE="1" <% $curuser->option('cust_pkg-display_times') ? 'CHECKED' : '' %>></TD>
187 <TH>Show internal package numbers: </TH>
188 <TD><INPUT TYPE="checkbox" NAME="show_pkgnum" VALUE="1" <% $curuser->option('show_pkgnum') ? 'CHECKED' : '' %>></TD>
191 <TH>Show config item counts: </TH>
192 <TD><INPUT TYPE="checkbox" NAME="show_confitem_counts" VALUE="1" <% $curuser->option('show_confitem_counts') ? 'CHECKED' : '' %>></TD>
195 <TH>Show export data on service view (when available): </TH>
196 <TD><INPUT TYPE="checkbox" NAME="export_getsettings" VALUE="1" <% $curuser->option('export_getsettings') ? 'CHECKED' : '' %>></TD>
199 <TH>Show database profiling (when available): </TH>
200 <TD><INPUT TYPE="checkbox" NAME="show_db_profile" VALUE="1" <% $curuser->option('show_db_profile') ? 'CHECKED' : '' %>></TD>
203 <TH>Save database profiling logs (when available): </TH>
204 <TD><INPUT TYPE="checkbox" NAME="save_db_profile" VALUE="1" <% $curuser->option('save_db_profile') ? 'CHECKED' : '' %>></TD>
207 <TH>Save temporary invoice typesetting files: </TH>
208 <TD><INPUT TYPE="checkbox" NAME="save_tmp_typesetting" VALUE="1" <% $curuser->option('save_tmp_typesetting') ? 'CHECKED' : '' %>></TD>
214 % if ( $curuser->access_right('Employee preference telephony integration') ) {
217 <% ntable("#cccccc",2) %>
220 <TH ALIGN="right">SNOM IP address</TH>
221 <TD><INPUT TYPE="text" NAME="snom-ip" VALUE="<% $curuser->option('snom-ip') %>"></TD>
225 <TH ALIGN="right">SNOM HTTP username (if necessary)</TH>
226 <TD><INPUT TYPE="text" NAME="snom-username" VALUE="<% $curuser->option('snom-username') %>"></TD>
230 <TH ALIGN="right">SNOM HTTP password (if necessary)</TH>
231 <TD><INPUT TYPE="password" NAME="snom-password" VALUE="<% $curuser->option('snom-password') %>"></TD>
239 Vonage integration (see <a href="https://secure.click2callu.com/">Click2Call</a>)
240 <% ntable("#cccccc",2) %>
243 <TH ALIGN="right">Vonage phone number</TH>
244 <TD><INPUT TYPE="text" NAME="vonage-fromnumber" VALUE="<% $curuser->option('vonage-fromnumber') %>"></TD>
248 <TH ALIGN="right">Vonage username</TH>
249 <TD><INPUT TYPE="text" NAME="vonage-username" VALUE="<% $curuser->option('vonage-username') %>"></TD>
253 <TH ALIGN="right">Vonage password</TH>
254 <TD><INPUT TYPE="password" NAME="vonage-password" VALUE="<% $curuser->option('vonage-password') %>"></TD>
262 % foreach my $prop (qw( height width availHeight availWidth colorDepth )) {
263 <INPUT TYPE="hidden" NAME="<% $prop %>" VALUE="">
264 <SCRIPT TYPE="text/javascript">
265 document.pref_form.<% $prop %>.value = screen.<% $prop %>;
269 <INPUT TYPE="submit" VALUE="Update preferences">
271 <% include('/elements/footer.html') %>
274 my $curuser = $FS::CurrentUser::CurrentUser;
276 #false laziness w/view/cust_main.cgi and Conf.pm (cust_main-default_view)
278 tie my %customer_views, 'Tie::IxHash',
279 'Basics' => 'basics',
280 'Notes' => 'notes', #notes and files?
281 'Tickets' => 'tickets',
282 'Packages' => 'packages',
283 'Payment History' => 'payment_history',
285 $customer_views{'Change History'} = 'change_history'
286 if $curuser->access_right('View customer history');
287 $customer_views{'Jumbo'} = 'jumbo';
289 # XSS via your own preferences? seems unlikely, but nice try anyway...
290 ( $curuser->option('menu_position') || 'top' )
291 =~ /^(\w+)$/ or die "illegal menu_position";
292 my $menu_position = $1;
293 ( $curuser->option('email_address') )
294 =~ /^([,\w\@.\-]*)$/ or die "illegal email_address"; #too late
295 my $email_address = $1;