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