invoice_sections_with_taxes per-agent, RT#79636
[freeside.git] / httemplate / pref / pref.html
1 <& /elements/header.html, mt('Preferences for [_1]', $FS::CurrentUser::CurrentUser->username) &>
2
3 % my $js_form_validate = { 'pref_form' => { 'name' => 'pref_form' } };
4
5 <FORM METHOD="POST" NAME="pref_form" ACTION="pref-process.html">
6
7 <& /elements/error.html &>
8
9 % if ( FS::Auth->auth_class->can('change_password') ) {
10
11     <FONT CLASS="fsinnerbox-title"><% emt('Change password (leave blank for no change)') %></FONT>
12     <TABLE CLASS="fsinnerbox">
13
14       <TR>
15         <TH ALIGN="right"><% emt("Current password:") %> </TH>
16         <TD><INPUT TYPE="password" NAME="_password"></TD>
17       </TR>
18
19       <TR>
20         <TH ALIGN="right"><% emt("New password:") %> </TH>
21         <TD><INPUT TYPE="password" NAME="new_password"></TD>
22       </TR>
23
24       <TR>
25        <TH ALIGN="right"><% emt("Re-enter new password:") %> </TH>
26        <TD><INPUT TYPE="password" NAME="new_password2"></TD>
27       </TR>
28
29     </TABLE>
30     <BR>
31
32 % }
33
34 <FONT CLASS="fsinnerbox-title"><% emt("Interface") %></FONT>
35 <TABLE CLASS="fsinnerbox">
36
37   <TR>
38     <TH ALIGN="right"><% emt("Locale:") %> </TH>
39     <TD COLSPAN=2>
40       <SELECT NAME="locale">
41 %       foreach my $locale ( @locales ) {
42 %         my %info = FS::Locales->locale_info($locale);
43 %         my $selected = ($locale eq $curuser->option('locale'))
44 %                          ? 'SELECTED' : '';
45           <OPTION VALUE="<% $locale %>" <%$selected%>><% $info{name} %> (<% $info{country} %>)
46 %       }
47       </SELECT>
48     </TD>
49   </TR>
50
51   <TR>
52     <TH ALIGN="right" STYLE="vertical-align:top"><% emt("Menu location:") %> </TH>
53     <TD>
54       <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>
55       <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>
56     </TD>
57     <TD><IMG NAME="menu_example" SRC="../images/menu-<% $menu_position %>-example.png"></TD>
58   </TR>
59
60   <TR>
61     <TH ALIGN="right"><% emt("Enable mobile-friendly menu:") %> </TH>
62     <TD COLSPAN=2>
63       <INPUT TYPE="checkbox" NAME="mobile_menu" VALUE="Y"
64 <% $curuser->option('mobile_menu') ? 'CHECKED' : '' %>>
65     </TD>
66   </TR>
67  
68   <TR>
69     <TH ALIGN="right"><% emt("Default customer view:") %> </TH>
70     <TD COLSPAN=2>
71       <SELECT NAME="default_customer_view">
72 %       foreach my $view ( keys %customer_views ) {
73 %         my $selected =
74 %           $customer_views{$view} eq $curuser->option('default_customer_view')
75 %             ? 'SELECTED'
76 %             : '';
77           <OPTION VALUE="<%$customer_views{$view}%>" <%$selected%>><% emt($view) %></OPTION>
78 %       }
79       </SELECT>
80     </TD>
81   </TR>
82
83 % my $history_order = $curuser->option('history_order') || 'oldest';
84   <TR>
85     <TH ALIGN="right"><% emt("Customer history sort order:") %> </TH>
86     <TD COLSPAN=2>
87       <& /elements/select.html,
88         field       => 'history_order',
89         curr_value  => $history_order,
90         options     => [ 'oldest', 'newest' ],
91         labels      => { 'oldest' => mt('Oldest first'),
92                          'newest' => mt('Newest first'),
93                        },
94       &>
95     </TD>
96   </TR>
97   
98   <TR>
99     <TH ALIGN="right"><% emt("Spreadsheet download format:") %> </TH>
100     <TD COLSPAN=2>
101       <SELECT NAME="spreadsheet_format">
102 %       my $xls =  $curuser->option('spreadsheet_format') eq 'XLS';
103 %       my $xlsx = $curuser->option('spreadsheet_format') eq 'XLSX';
104         <OPTION VALUE=""></OPTION>
105         <OPTION VALUE="XLS"<%  $xls ? 'SELECTED' : '' %>>XLS (Excel 97/2000/XP)
106         </OPTION>
107         <OPTION VALUE="XLSX"<% $xlsx ? 'SELECTED' : ''%>>XLSX (Excel 2007+)
108         </OPTION>
109       </SELECT>
110     </TD>
111   </TR>
112
113   <TR>
114     <TH ALIGN="right" COLSPAN=1><% emt("Disable HTML editor for customer notes:") %> </TH>
115     <TD ALIGN="left" COLSPAN=2>
116       <INPUT TYPE="checkbox" NAME="disable_html_editor" VALUE="1" <% $curuser->option('disable_html_editor') ? 'CHECKED' : '' %>>
117     </TD>
118   </TR>
119
120   <TR>
121     <TH ALIGN="right" COLSPAN=1><% emt("Disable submission on Enter key - one-time charges:") %> </TH>
122     <TD ALIGN="left" COLSPAN=2>
123       <INPUT TYPE="checkbox" NAME="disable_enter_submit_onetimecharge" VALUE="1" <% $curuser->option('disable_enter_submit_onetimecharge') ? 'CHECKED' : '' %>>
124     </TD>
125   </TR>
126
127   <TR>
128     <TH ALIGN="right"><% emt("Don't copy MAC address delimiters to clipboard") %></TH>
129     <TD ALIGN="left" COLSPAN=2>
130       <INPUT TYPE="checkbox" NAME="enable_mask_clipboard_hack" VALUE="1" <% $curuser->option('enable_mask_clipboard_hack') ? 'CHECKED' : '' %>>
131     </TD>
132   </TR>
133
134   <TR>
135     <TH ALIGN="right"><% emt("When printing, scale HTML documents to fit on a letter-size page") %></TH>
136     <TD ALIGN="left">
137       <INPUT TYPE="checkbox" NAME="printtofit" VALUE="Y" <% $curuser->option('printtofit') ? 'CHECKED' : '' %>>
138     </TD>
139   </TR>
140
141   <TR>
142     <TH ALIGN="right"><% emt("How many recently-modified customers displayed on dashboard") %></TH>
143     <TD ALIGN="left" COLSPAN=2>
144       <INPUT TYPE="text" NAME="dashboard_customers" VALUE="<% $curuser->option('dashboard_customers') %>"></TD>
145     </TD>
146   </TR>
147
148 % my $validate_field_cve = 'customer_view_emails';
149 % $js_form_validate->{pref_form}->{validate_fields}{$validate_field_cve} = 'digits: true';
150 % $js_form_validate->{pref_form}->{error_message}{$validate_field_cve} = 'Please only enter numbers here.';
151
152   <TR>
153     <TH ALIGN="right"><% emt("How many recent outbound emails to show in customer view") %></TH>
154     <TD ALIGN="left" COLSPAN=2>
155       <INPUT TYPE="text" ID="<% $validate_field_cve %>" NAME="<% $validate_field_cve %>" VALUE="<% $curuser->option('customer_view_emails') %>"></TD>
156     </TD>
157   </TR>
158
159 </TABLE>
160 <BR>
161
162
163 <FONT CLASS="fsinnerbox-title"><% emt("Email Address") %></FONT>
164 <TABLE CLASS="fsinnerbox">
165
166   <TR>
167     <TH><% emt("Email Address(es) (comma separated) ") %></TH>
168     <TD>
169    <TD><INPUT TYPE="text" NAME="email_address" VALUE="<% $email_address %>">
170     </TD>
171   </TR>
172
173 </TABLE>
174 <BR>
175
176
177 <FONT CLASS="fsinnerbox-title"><% emt("Development") %></FONT>
178 <TABLE CLASS="fsinnerbox">
179
180   <TR>
181     <TH><% emt("Show customer package timestamps:") %> </TH>
182     <TD><INPUT TYPE="checkbox" NAME="cust_pkg-display_times" VALUE="1" <% $curuser->option('cust_pkg-display_times') ? 'CHECKED' : '' %>></TD>
183   </TR>
184   <TR>
185     <TH><% emt("Show internal package numbers:") %> </TH>
186     <TD><INPUT TYPE="checkbox" NAME="show_pkgnum" VALUE="1" <% $curuser->option('show_pkgnum') ? 'CHECKED' : '' %>></TD>
187   </TR>
188   <TR>
189     <TH><% emt("Show config item counts:") %> </TH>
190     <TD><INPUT TYPE="checkbox" NAME="show_confitem_counts" VALUE="1" <% $curuser->option('show_confitem_counts') ? 'CHECKED' : '' %>></TD>
191   </TR>
192   <TR>
193     <TH><% emt("Show export data on service view (when available):") %> </TH>
194     <TD><INPUT TYPE="checkbox" NAME="export_getsettings" VALUE="1" <% $curuser->option('export_getsettings') ? 'CHECKED' : '' %>></TD>
195   </TR>
196   <TR>
197     <TH><% emt("Show database profiling (when available):") %> </TH>
198     <TD><INPUT TYPE="checkbox" NAME="show_db_profile" VALUE="1" <% $curuser->option('show_db_profile') ? 'CHECKED' : '' %>></TD>
199   </TR>
200   <TR>
201     <TH><% emt("Save database profiling logs (when available):") %> </TH>
202     <TD><INPUT TYPE="checkbox" NAME="save_db_profile" VALUE="1" <% $curuser->option('save_db_profile') ? 'CHECKED' : '' %>></TD>
203   </TR>
204   <TR>
205     <TH><% emt("Save temporary invoice typesetting files:") %> </TH>
206     <TD><INPUT TYPE="checkbox" NAME="save_tmp_typesetting" VALUE="1" <% $curuser->option('save_tmp_typesetting') ? 'CHECKED' : '' %>></TD>
207   </TR>
208
209 </TABLE>
210 <BR>
211
212 % if ( $curuser->access_right('Employee preference telephony integration') ) {
213
214 <% emt("SNOM integration") %>
215 <% ntable("#cccccc",2) %>
216
217   <TR>
218     <TH ALIGN="right"><% emt("SNOM IP address") %></TH>
219     <TD><INPUT TYPE="text" NAME="snom-ip" VALUE="<% $curuser->option('snom-ip') %>"></TD>
220   </TR>
221
222   <TR>
223     <TH ALIGN="right"><% emt("SNOM HTTP username (if necessary)") %></TH>
224     <TD><INPUT TYPE="text" NAME="snom-username" VALUE="<% $curuser->option('snom-username') %>"></TD>
225   </TR>
226
227   <TR>
228     <TH ALIGN="right"><% emt("SNOM HTTP password (if necessary)") %></TH>
229     <TD><INPUT TYPE="password" NAME="snom-password" VALUE="<% $curuser->option('snom-password') %>"></TD>
230   </TR>
231
232 </TABLE>
233 <BR>
234
235 <% emt("OR")%><BR><BR>
236
237 <% emt("Vonage integration (see") %> <a href="https://secure.click2callu.com/"><% emt("Click2Call") %></a>)
238 <% ntable("#cccccc",2) %>
239
240   <TR>
241     <TH ALIGN="right"><% emt("Vonage phone number") %></TH>
242     <TD><INPUT TYPE="text" NAME="vonage-fromnumber" VALUE="<% $curuser->option('vonage-fromnumber') %>"></TD>
243   </TR>
244
245   <TR>
246     <TH ALIGN="right"><% emt("Vonage username") %></TH>
247     <TD><INPUT TYPE="text" NAME="vonage-username" VALUE="<% $curuser->option('vonage-username') %>"></TD>
248   </TR>
249
250   <TR>
251     <TH ALIGN="right"><% emt("Vonage password") %></TH>
252     <TD><INPUT TYPE="password" NAME="vonage-password" VALUE="<% $curuser->option('vonage-password') %>"></TD>
253   </TR>
254
255 </TABLE>
256 <BR>
257
258 % }
259
260 % foreach my $prop (qw( height width availHeight availWidth colorDepth )) {
261   <INPUT TYPE="hidden" NAME="<% $prop %>" VALUE="">
262   <SCRIPT TYPE="text/javascript">
263   document.pref_form.<% $prop %>.value = screen.<% $prop %>;
264   </script>
265 % }
266
267 <INPUT TYPE="submit" VALUE="<% emt("Update preferences") %>">
268
269 % my %footerdata = (
270 %   'formvalidation' => $js_form_validate,
271 % );
272 <% include("/elements/footer.html", %footerdata) %>
273
274 <%init>
275
276 my $curuser = $FS::CurrentUser::CurrentUser;
277
278 #false laziness w/view/cust_main.cgi and Conf.pm (cust_main-default_view)
279
280 tie my %customer_views, 'Tie::IxHash',
281   'Basics'          => 'basics',
282   'Notes'           => 'notes', #notes and files?
283   'Tickets'         => 'tickets',
284   'Appointments'    => 'appointments',
285   'Quotations'      => 'quotations',
286   'Packages'        => 'packages',
287   'Payment History' => 'payment_history',
288 ;
289 $customer_views{'Change History'} = 'change_history'
290   if $curuser->access_right('View customer history');
291
292 # XSS via your own preferences?  seems unlikely, but nice try anyway...
293 ( $curuser->option('menu_position') || 'top' )
294   =~ /^(\w+)$/ or die "illegal menu_position";
295 my $menu_position = $1;
296 ( $curuser->option('email_address') )
297   =~ /^([,\w\@.\-]*)$/ or die "illegal email_address";  #too late
298 my $email_address = $1;
299
300 my $conf = new FS::Conf;
301
302 my @locales = $conf->config('available-locales');
303
304 if ( ! @locales ) {
305
306         @locales = FS::Locales->locales ;
307
308 }
309
310 </%init>