50d6e8d233dc658ca6641a4059ca26f1a8f0bb45
[freeside.git] / httemplate / pref / pref.html
1 <% include('/elements/header.html', 'Preferences for '. $FS::CurrentUser::CurrentUser->username ) %>
2
3 <FORM METHOD="POST" NAME="pref_form" ACTION="pref-process.html">
4
5 <% include('/elements/error.html') %>
6
7 % if ( FS::Auth->auth_class->can('change_password') ) {
8
9     <% mt('Change password (leave blank for no change)') |h %>
10     <% ntable("#cccccc",2) %>
11
12       <TR>
13         <TH ALIGN="right">Current password: </TH>
14         <TD><INPUT TYPE="password" NAME="_password"></TD>
15       </TR>
16
17       <TR>
18         <TH ALIGN="right">New password: </TH>
19         <TD><INPUT TYPE="password" NAME="new_password"></TD>
20       </TR>
21
22       <TR>
23        <TH ALIGN="right">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 Interface
33 <% ntable("#cccccc",2) %>
34
35   <TR>
36     <TH ALIGN="right">Locale: </TH>
37     <TD COLSPAN=2>
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'))
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">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' : ''%>> 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>
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">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">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%>><%$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">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' => 'Oldest first',
90                          'newest' => 'Newest first',
91                        },
92       &>
93     </TD>
94   </TR>
95   
96   <TR>
97     <TH ALIGN="right">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>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>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">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">How many recently-modified customers displayed on dashboard</TH>
134     <TD ALIGN="left" COLSPAN=2>
135       <INPUT TYPE="text" NAME="dashboard_customers" VALUE="<% $curuser->option('dashboard_customers') %>"></TD>
136     </TD>
137   </TR>
138
139   <TR>
140     <TH ALIGN="right">How many recent outbound emails to show in customer view</TH>
141     <TD ALIGN="left" COLSPAN=2>
142       <INPUT TYPE="text" NAME="customer_view_emails" VALUE="<% $curuser->option('customer_view_emails') %>"></TD>
143     </TD>
144   </TR>
145
146
147
148 </TABLE>
149 <BR>
150
151
152 Email Address
153 <% ntable("#cccccc",2) %>
154
155   <TR>
156     <TH>Email Address(es) (comma separated) </TH>
157     <TD>
158    <TD><INPUT TYPE="text" NAME="email_address" VALUE="<% $email_address %>">
159     </TD>
160   </TR>
161
162 </TABLE>
163 <BR>
164
165
166 Development
167 <% ntable("#cccccc",2) %>
168
169   <TR>
170     <TH>Show customer package timestamps: </TH>
171     <TD><INPUT TYPE="checkbox" NAME="cust_pkg-display_times" VALUE="1" <% $curuser->option('cust_pkg-display_times') ? 'CHECKED' : '' %>></TD>
172   </TR>
173   <TR>
174     <TH>Show internal package numbers: </TH>
175     <TD><INPUT TYPE="checkbox" NAME="show_pkgnum" VALUE="1" <% $curuser->option('show_pkgnum') ? 'CHECKED' : '' %>></TD>
176   </TR>
177   <TR>
178     <TH>Show config item counts: </TH>
179     <TD><INPUT TYPE="checkbox" NAME="show_confitem_counts" VALUE="1" <% $curuser->option('show_confitem_counts') ? 'CHECKED' : '' %>></TD>
180   </TR>
181   <TR>
182     <TH>Show export data on service view (when available): </TH>
183     <TD><INPUT TYPE="checkbox" NAME="export_getsettings" VALUE="1" <% $curuser->option('export_getsettings') ? 'CHECKED' : '' %>></TD>
184   </TR>
185   <TR>
186     <TH>Show database profiling (when available): </TH>
187     <TD><INPUT TYPE="checkbox" NAME="show_db_profile" VALUE="1" <% $curuser->option('show_db_profile') ? 'CHECKED' : '' %>></TD>
188   </TR>
189   <TR>
190     <TH>Save database profiling logs (when available): </TH>
191     <TD><INPUT TYPE="checkbox" NAME="save_db_profile" VALUE="1" <% $curuser->option('save_db_profile') ? 'CHECKED' : '' %>></TD>
192   </TR>
193   <TR>
194     <TH>Save temporary invoice typesetting files: </TH>
195     <TD><INPUT TYPE="checkbox" NAME="save_tmp_typesetting" VALUE="1" <% $curuser->option('save_tmp_typesetting') ? 'CHECKED' : '' %>></TD>
196   </TR>
197
198 </TABLE>
199 <BR>
200
201 % if ( $curuser->access_right('Employee preference telephony integration') ) {
202
203 SNOM integration
204 <% ntable("#cccccc",2) %>
205
206   <TR>
207     <TH ALIGN="right">SNOM IP address</TH>
208     <TD><INPUT TYPE="text" NAME="snom-ip" VALUE="<% $curuser->option('snom-ip') %>"></TD>
209   </TR>
210
211   <TR>
212     <TH ALIGN="right">SNOM HTTP username (if necessary)</TH>
213     <TD><INPUT TYPE="text" NAME="snom-username" VALUE="<% $curuser->option('snom-username') %>"></TD>
214   </TR>
215
216   <TR>
217     <TH ALIGN="right">SNOM HTTP password (if necessary)</TH>
218     <TD><INPUT TYPE="password" NAME="snom-password" VALUE="<% $curuser->option('snom-password') %>"></TD>
219   </TR>
220
221 </TABLE>
222 <BR>
223
224 OR<BR><BR>
225
226 Vonage integration (see <a href="https://secure.click2callu.com/">Click2Call</a>)
227 <% ntable("#cccccc",2) %>
228
229   <TR>
230     <TH ALIGN="right">Vonage phone number</TH>
231     <TD><INPUT TYPE="text" NAME="vonage-fromnumber" VALUE="<% $curuser->option('vonage-fromnumber') %>"></TD>
232   </TR>
233
234   <TR>
235     <TH ALIGN="right">Vonage username</TH>
236     <TD><INPUT TYPE="text" NAME="vonage-username" VALUE="<% $curuser->option('vonage-username') %>"></TD>
237   </TR>
238
239   <TR>
240     <TH ALIGN="right">Vonage password</TH>
241     <TD><INPUT TYPE="password" NAME="vonage-password" VALUE="<% $curuser->option('vonage-password') %>"></TD>
242   </TR>
243
244 </TABLE>
245 <BR>
246
247 % }
248
249 % foreach my $prop (qw( height width availHeight availWidth colorDepth )) {
250   <INPUT TYPE="hidden" NAME="<% $prop %>" VALUE="">
251   <SCRIPT TYPE="text/javascript">
252   document.pref_form.<% $prop %>.value = screen.<% $prop %>;
253   </script>
254 % }
255
256 <INPUT TYPE="submit" VALUE="Update preferences">
257
258 <% include('/elements/footer.html') %>
259 <%init>
260
261 my $curuser = $FS::CurrentUser::CurrentUser;
262
263 #false laziness w/view/cust_main.cgi and Conf.pm (cust_main-default_view)
264
265 tie my %customer_views, 'Tie::IxHash',
266   'Basics'          => 'basics',
267   'Notes'           => 'notes', #notes and files?
268   'Tickets'         => 'tickets',
269   'Appointments'    => 'appointments',
270   'Quotations'      => 'quotations',
271   'Packages'        => 'packages',
272   'Payment History' => 'payment_history',
273 ;
274 $customer_views{'Change History'} = 'change_history'
275   if $curuser->access_right('View customer history');
276
277 # XSS via your own preferences?  seems unlikely, but nice try anyway...
278 ( $curuser->option('menu_position') || 'top' )
279   =~ /^(\w+)$/ or die "illegal menu_position";
280 my $menu_position = $1;
281 ( $curuser->option('email_address') )
282   =~ /^([,\w\@.\-]*)$/ or die "illegal email_address";  #too late
283 my $email_address = $1;
284
285 </%init>