collapse display of location-changed packages, #25130, #27305
[freeside.git] / httemplate / pref / pref.html
1 <% include('/elements/header.html', 'Preferences for '. getotaker ) %>
2
3 <FORM METHOD="POST" NAME="pref_form" ACTION="pref-process.html">
4
5 <% include('/elements/error.html') %>
6
7
8 <% mt('Change password (leave blank for no change)') |h %>
9 <% ntable("#cccccc",2) %>
10
11   <TR>
12     <TH ALIGN="right">Current password: </TH>
13     <TD><INPUT TYPE="password" NAME="_password"></TD>
14   </TR>
15
16   <TR>
17     <TH ALIGN="right">New password: </TH>
18     <TD><INPUT TYPE="password" NAME="new_password"></TD>
19   </TR>
20
21   <TR>
22    <TH ALIGN="right">Re-enter new password: </TH>
23    <TD><INPUT TYPE="password" NAME="new_password2"></TD>
24   </TR>
25
26 </TABLE>
27 <BR>
28
29
30 Interface
31 <% ntable("#cccccc",2) %>
32
33   <TR>
34     <TH ALIGN="right">Locale: </TH>
35     <TD COLSPAN=2>
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'))
40 %                          ? 'SELECTED' : '';
41           <OPTION VALUE="<% $locale %>" <%$selected%>><% $info{name} %> (<% $info{country} %>)
42 %       }
43       </SELECT>
44     </TD>
45   </TR>
46
47   <TR>
48     <TH ALIGN="right">Menu location: </TH>
49     <TD>
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>
52     </TD>
53     <TD><IMG NAME="menu_example" SRC="../images/menu-<% $menu_position %>-example.png"></TD>
54   </TR>
55
56   <TR>
57     <TH ALIGN="right">Enable mobile-friendly menu: </TH>
58     <TD COLSPAN=2>
59       <INPUT TYPE="checkbox" NAME="mobile_menu" VALUE="Y"
60 <% $curuser->option('mobile_menu') ? 'CHECKED' : '' %>>
61     </TD>
62   </TR>
63  
64   <TR>
65     <TH ALIGN="right">Default customer view: </TH>
66     <TD COLSPAN=2>
67       <SELECT NAME="default_customer_view">
68 %       foreach my $view ( keys %customer_views ) {
69 %         my $selected =
70 %           $customer_views{$view} eq $curuser->option('default_customer_view')
71 %             ? 'SELECTED'
72 %             : '';
73           <OPTION VALUE="<%$customer_views{$view}%>" <%$selected%>><%$view%></OPTION>
74 %       }
75       </SELECT>
76     </TD>
77   </TR>
78
79   <TR>
80     <TH ALIGN="right">Hide package changes: </TH>
81     <TD>
82     <& /elements/select.html,
83       field   => 'hide_package_changes',
84       options => [ '', 'location', 'all' ],
85       labels  => { ''         => 'never',
86                    'location' => 'location changes',
87                    'all'      => 'all package changes',
88                  },
89       curr_value => ($cgi->param('hide_package_changes') 
90                       || $curuser->option('hide_package_changes')),
91     &>
92     </TD>
93   </TR>
94
95 % my $history_order = $curuser->option('history_order') || 'oldest';
96   <TR>
97     <TH ALIGN="right">Customer history sort order: </TH>
98     <TD COLSPAN=2>
99       <& /elements/select.html,
100         field       => 'history_order',
101         curr_value  => $history_order,
102         options     => [ 'oldest', 'newest' ],
103         labels      => { 'oldest' => 'Oldest first',
104                          'newest' => 'Newest first',
105                        },
106       &>
107     </TD>
108   </TR>
109   
110   <TR>
111     <TH ALIGN="right">Spreadsheet download format: </TH>
112     <TD COLSPAN=2>
113       <SELECT NAME="spreadsheet_format">
114 %       my $xls =  $curuser->option('spreadsheet_format') eq 'XLS';
115 %       my $xlsx = $curuser->option('spreadsheet_format') eq 'XLSX';
116         <OPTION VALUE=""></OPTION>
117         <OPTION VALUE="XLS"<%  $xls ? 'SELECTED' : '' %>>XLS (Excel 97/2000/XP)
118         </OPTION>
119         <OPTION VALUE="XLSX"<% $xlsx ? 'SELECTED' : ''%>>XLSX (Excel 2007+)
120         </OPTION>
121       </SELECT>
122     </TD>
123   </TR>
124
125 % if ( FS::Conf->new->exists('enable_fuzzy_on_exact') ) {
126
127   <INPUT TYPE="hidden" NAME="enable_fuzzy_on_exact" VALUE="<% $curuser->option('enable_fuzzy_on_exact') ? 1 : 0 %>">
128
129 % } else {
130
131  <TR>
132     <TH ALIGN="right" COLSPAN=1>Enable approximate customer searching <BR>even when an exact match is found: </TH>
133     <TD ALIGN="left" COLSPAN=2>
134       <INPUT TYPE="checkbox" NAME="enable_fuzzy_on_exact" VALUE="1" <% $curuser->option('enable_fuzzy_on_exact') ? 'CHECKED' : '' %>>
135     </TD>
136   </TR>
137
138 % }
139
140   <TR>
141     <TH ALIGN="right" COLSPAN=1>Disable HTML editor for customer notes: </TH>
142     <TD ALIGN="left" COLSPAN=2>
143       <INPUT TYPE="checkbox" NAME="disable_html_editor" VALUE="1" <% $curuser->option('disable_html_editor') ? 'CHECKED' : '' %>>
144     </TD>
145   </TR>
146
147   <TR>
148     <TH ALIGN="right" COLSPAN=1>Disable submission on [Enter] key - one-time charges: </TH>
149     <TD ALIGN="left" COLSPAN=2>
150       <INPUT TYPE="checkbox" NAME="disable_enter_submit_onetimecharge" VALUE="1" <% $curuser->option('disable_enter_submit_onetimecharge') ? 'CHECKED' : '' %>>
151     </TD>
152   </TR>
153
154   <TR>
155     <TH ALIGN="right">Don't copy MAC address delimiters to clipboard</TH>
156     <TD ALIGN="left" COLSPAN=2>
157       <INPUT TYPE="checkbox" NAME="enable_mask_clipboard_hack" VALUE="1" <% $curuser->option('enable_mask_clipboard_hack') ? 'CHECKED' : '' %>>
158     </TD>
159   </TR>
160
161 </TABLE>
162 <BR>
163
164
165 Email Address
166 <% ntable("#cccccc",2) %>
167
168   <TR>
169     <TH>Email Address(es) (comma separated) </TH>
170     <TD>
171    <TD><INPUT TYPE="text" NAME="email_address" VALUE="<% $email_address %>">
172     </TD>
173   </TR>
174
175 </TABLE>
176 <BR>
177
178
179 Development
180 <% ntable("#cccccc",2) %>
181
182   <TR>
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>
185   </TR>
186   <TR>
187     <TH>Show internal package numbers: </TH>
188     <TD><INPUT TYPE="checkbox" NAME="show_pkgnum" VALUE="1" <% $curuser->option('show_pkgnum') ? 'CHECKED' : '' %>></TD>
189   </TR>
190   <TR>
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>
193   </TR>
194   <TR>
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>
197   </TR>
198   <TR>
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>
201   </TR>
202   <TR>
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>
205   </TR>
206   <TR>
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>
209   </TR>
210
211 </TABLE>
212 <BR>
213
214 SNOM integration
215 <% ntable("#cccccc",2) %>
216
217   <TR>
218     <TH ALIGN="right">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">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">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 OR<BR><BR>
236
237 Vonage integration (see <a href="https://secure.click2callu.com/">Click2Call</a>)
238 <% ntable("#cccccc",2) %>
239
240   <TR>
241     <TH ALIGN="right">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">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">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 % foreach my $prop (qw( height width availHeight availWidth colorDepth )) {
260   <INPUT TYPE="hidden" NAME="<% $prop %>" VALUE="">
261   <SCRIPT TYPE="text/javascript">
262   document.pref_form.<% $prop %>.value = screen.<% $prop %>;
263   </script>
264 % }
265
266 <INPUT TYPE="submit" VALUE="Update preferences">
267
268 <% include('/elements/footer.html') %>
269 <%init>
270
271 my $curuser = $FS::CurrentUser::CurrentUser;
272
273 #false laziness w/view/cust_main.cgi and Conf.pm (cust_main-default_view)
274
275 tie my %customer_views, 'Tie::IxHash',
276   'Basics'          => 'basics',
277   'Notes'           => 'notes', #notes and files?
278   'Tickets'         => 'tickets',
279   'Packages'        => 'packages',
280   'Payment History' => 'payment_history',
281 ;
282 $customer_views{'Change History'} = 'change_history'
283   if $curuser->access_right('View customer history');
284 $customer_views{'Jumbo'} = 'jumbo';
285
286 # XSS via your own preferences?  seems unlikely, but nice try anyway...
287 ( $curuser->option('menu_position') || 'top' )
288   =~ /^(\w+)$/ or die "illegal menu_position";
289 my $menu_position = $1;
290 ( $curuser->option('email_address') )
291   =~ /^([,\w\@.]*)$/ or die "illegal email_address";  #too late
292 my $email_address = $1;
293
294 </%init>