1 <& /elements/header.html, mt('Preferences for [_1]', $FS::CurrentUser::CurrentUser->username) &>
3 <FORM METHOD="POST" NAME="pref_form" ACTION="pref-process.html">
5 <& /elements/error.html &>
7 % if ( FS::Auth->auth_class->can('change_password') ) {
9 <FONT CLASS="fsinnerbox-title"><% emt('Change password (leave blank for no change)') %></FONT>
10 <TABLE CLASS="fsinnerbox">
13 <TH ALIGN="right"><% emt("Current password:") %> </TH>
14 <TD><INPUT TYPE="password" NAME="_password"></TD>
18 <TH ALIGN="right"><% emt("New password:") %> </TH>
19 <TD><INPUT TYPE="password" NAME="new_password"></TD>
23 <TH ALIGN="right"><% emt("Re-enter new password:") %> </TH>
24 <TD><INPUT TYPE="password" NAME="new_password2"></TD>
32 <FONT CLASS="fsinnerbox-title"><% emt("Interface") %></FONT>
33 <TABLE CLASS="fsinnerbox">
36 <TH ALIGN="right"><% emt("Locale:") %> </TH>
38 <SELECT NAME="locale">
39 % foreach my $locale ( @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" STYLE="vertical-align:top"><% emt("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' : ''%>> <% emt("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' : ''%>> <% emt("Top") %> <BR>
55 <TD><IMG NAME="menu_example" SRC="../images/menu-<% $menu_position %>-example.png"></TD>
59 <TH ALIGN="right"><% emt("Enable mobile-friendly menu:") %> </TH>
61 <INPUT TYPE="checkbox" NAME="mobile_menu" VALUE="Y"
62 <% $curuser->option('mobile_menu') ? 'CHECKED' : '' %>>
67 <TH ALIGN="right"><% emt("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%>><% emt($view) %></OPTION>
81 % my $history_order = $curuser->option('history_order') || 'oldest';
83 <TH ALIGN="right"><% emt("Customer history sort order:") %> </TH>
85 <& /elements/select.html,
86 field => 'history_order',
87 curr_value => $history_order,
88 options => [ 'oldest', 'newest' ],
89 labels => { 'oldest' => mt('Oldest first'),
90 'newest' => mt('Newest first'),
97 <TH ALIGN="right"><% emt("Spreadsheet download format:") %> </TH>
99 <SELECT NAME="spreadsheet_format">
100 % my $xls = $curuser->option('spreadsheet_format') eq 'XLS';
101 % my $xlsx = $curuser->option('spreadsheet_format') eq 'XLSX';
102 <OPTION VALUE=""></OPTION>
103 <OPTION VALUE="XLS"<% $xls ? 'SELECTED' : '' %>>XLS (Excel 97/2000/XP)
105 <OPTION VALUE="XLSX"<% $xlsx ? 'SELECTED' : ''%>>XLSX (Excel 2007+)
112 <TH ALIGN="right" COLSPAN=1><% emt("Disable HTML editor for customer notes:") %> </TH>
113 <TD ALIGN="left" COLSPAN=2>
114 <INPUT TYPE="checkbox" NAME="disable_html_editor" VALUE="1" <% $curuser->option('disable_html_editor') ? 'CHECKED' : '' %>>
119 <TH ALIGN="right" COLSPAN=1><% emt("Disable submission on Enter key - one-time charges:") %> </TH>
120 <TD ALIGN="left" COLSPAN=2>
121 <INPUT TYPE="checkbox" NAME="disable_enter_submit_onetimecharge" VALUE="1" <% $curuser->option('disable_enter_submit_onetimecharge') ? 'CHECKED' : '' %>>
126 <TH ALIGN="right"><% emt("Don't copy MAC address delimiters to clipboard") %></TH>
127 <TD ALIGN="left" COLSPAN=2>
128 <INPUT TYPE="checkbox" NAME="enable_mask_clipboard_hack" VALUE="1" <% $curuser->option('enable_mask_clipboard_hack') ? 'CHECKED' : '' %>>
133 <TH ALIGN="right"><% emt("Scale documents to fit on a letter-size page") %></TH>
135 <INPUT TYPE="checkbox" NAME="printtofit" VALUE="Y" <% $curuser->option('printtofit') ? 'CHECKED' : '' %>>
140 <TH ALIGN="right"><% emt("How many recently-modified customers displayed on dashboard") %></TH>
141 <TD ALIGN="left" COLSPAN=2>
142 <INPUT TYPE="text" NAME="dashboard_customers" VALUE="<% $curuser->option('dashboard_customers') %>"></TD>
147 <TH ALIGN="right"><% emt("How many recent outbound emails to show in customer view") %></TH>
148 <TD ALIGN="left" COLSPAN=2>
149 <INPUT TYPE="text" NAME="customer_view_emails" VALUE="<% $curuser->option('customer_view_emails') %>"></TD>
157 <FONT CLASS="fsinnerbox-title"><% emt("Email Address") %></FONT>
158 <TABLE CLASS="fsinnerbox">
161 <TH><% emt("Email Address(es) (comma separated) ") %></TH>
163 <TD><INPUT TYPE="text" NAME="email_address" VALUE="<% $email_address %>">
171 <FONT CLASS="fsinnerbox-title"><% emt("Development") %></FONT>
172 <TABLE CLASS="fsinnerbox">
175 <TH><% emt("Show customer package timestamps:") %> </TH>
176 <TD><INPUT TYPE="checkbox" NAME="cust_pkg-display_times" VALUE="1" <% $curuser->option('cust_pkg-display_times') ? 'CHECKED' : '' %>></TD>
179 <TH><% emt("Show internal package numbers:") %> </TH>
180 <TD><INPUT TYPE="checkbox" NAME="show_pkgnum" VALUE="1" <% $curuser->option('show_pkgnum') ? 'CHECKED' : '' %>></TD>
183 <TH><% emt("Show config item counts:") %> </TH>
184 <TD><INPUT TYPE="checkbox" NAME="show_confitem_counts" VALUE="1" <% $curuser->option('show_confitem_counts') ? 'CHECKED' : '' %>></TD>
187 <TH><% emt("Show export data on service view (when available):") %> </TH>
188 <TD><INPUT TYPE="checkbox" NAME="export_getsettings" VALUE="1" <% $curuser->option('export_getsettings') ? 'CHECKED' : '' %>></TD>
191 <TH><% emt("Show database profiling (when available):") %> </TH>
192 <TD><INPUT TYPE="checkbox" NAME="show_db_profile" VALUE="1" <% $curuser->option('show_db_profile') ? 'CHECKED' : '' %>></TD>
195 <TH><% emt("Save database profiling logs (when available):") %> </TH>
196 <TD><INPUT TYPE="checkbox" NAME="save_db_profile" VALUE="1" <% $curuser->option('save_db_profile') ? 'CHECKED' : '' %>></TD>
199 <TH><% emt("Save temporary invoice typesetting files:") %> </TH>
200 <TD><INPUT TYPE="checkbox" NAME="save_tmp_typesetting" VALUE="1" <% $curuser->option('save_tmp_typesetting') ? 'CHECKED' : '' %>></TD>
206 % if ( $curuser->access_right('Employee preference telephony integration') ) {
208 <% emt("SNOM integration") %>
209 <% ntable("#cccccc",2) %>
212 <TH ALIGN="right"><% emt("SNOM IP address") %></TH>
213 <TD><INPUT TYPE="text" NAME="snom-ip" VALUE="<% $curuser->option('snom-ip') %>"></TD>
217 <TH ALIGN="right"><% emt("SNOM HTTP username (if necessary)") %></TH>
218 <TD><INPUT TYPE="text" NAME="snom-username" VALUE="<% $curuser->option('snom-username') %>"></TD>
222 <TH ALIGN="right"><% emt("SNOM HTTP password (if necessary)") %></TH>
223 <TD><INPUT TYPE="password" NAME="snom-password" VALUE="<% $curuser->option('snom-password') %>"></TD>
229 <% emt("OR")%><BR><BR>
231 <% emt("Vonage integration (see") %> <a href="https://secure.click2callu.com/"><% emt("Click2Call") %></a>)
232 <% ntable("#cccccc",2) %>
235 <TH ALIGN="right"><% emt("Vonage phone number") %></TH>
236 <TD><INPUT TYPE="text" NAME="vonage-fromnumber" VALUE="<% $curuser->option('vonage-fromnumber') %>"></TD>
240 <TH ALIGN="right"><% emt("Vonage username") %></TH>
241 <TD><INPUT TYPE="text" NAME="vonage-username" VALUE="<% $curuser->option('vonage-username') %>"></TD>
245 <TH ALIGN="right"><% emt("Vonage password") %></TH>
246 <TD><INPUT TYPE="password" NAME="vonage-password" VALUE="<% $curuser->option('vonage-password') %>"></TD>
254 % foreach my $prop (qw( height width availHeight availWidth colorDepth )) {
255 <INPUT TYPE="hidden" NAME="<% $prop %>" VALUE="">
256 <SCRIPT TYPE="text/javascript">
257 document.pref_form.<% $prop %>.value = screen.<% $prop %>;
261 <INPUT TYPE="submit" VALUE="<% emt("Update preferences") %>">
263 <&/elements/footer.html &>
266 my $curuser = $FS::CurrentUser::CurrentUser;
268 #false laziness w/view/cust_main.cgi and Conf.pm (cust_main-default_view)
270 tie my %customer_views, 'Tie::IxHash',
271 'Basics' => 'basics',
272 'Notes' => 'notes', #notes and files?
273 'Tickets' => 'tickets',
274 'Appointments' => 'appointments',
275 'Quotations' => 'quotations',
276 'Packages' => 'packages',
277 'Payment History' => 'payment_history',
279 $customer_views{'Change History'} = 'change_history'
280 if $curuser->access_right('View customer history');
282 # XSS via your own preferences? seems unlikely, but nice try anyway...
283 ( $curuser->option('menu_position') || 'top' )
284 =~ /^(\w+)$/ or die "illegal menu_position";
285 my $menu_position = $1;
286 ( $curuser->option('email_address') )
287 =~ /^([,\w\@.\-]*)$/ or die "illegal email_address"; #too late
288 my $email_address = $1;
290 my $conf = new FS::Conf;
292 my @locales = $conf->config('available-locales');
296 @locales = FS::Locales->locales ;