9537fed34b040ae2f04bc47a56d09aac6fcade23
[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">Spreadsheet download format: </TH>
81     <TD COLSPAN=2>
82       <SELECT NAME="spreadsheet_format">
83 %       my $xls =  $curuser->option('spreadsheet_format') eq 'XLS';
84 %       my $xlsx = $curuser->option('spreadsheet_format') eq 'XLSX';
85         <OPTION VALUE=""></OPTION>
86         <OPTION VALUE="XLS"<%  $xls ? 'SELECTED' : '' %>>XLS (Excel 97/2000/XP)
87         </OPTION>
88         <OPTION VALUE="XLSX"<% $xlsx ? 'SELECTED' : ''%>>XLSX (Excel 2007+)
89         </OPTION>
90       </SELECT>
91     </TD>
92   </TR>
93
94  <TR>
95     <TH ALIGN="right" COLSPAN=1>Enable approximate customer searching even when an exact match is found: </TH>
96     <TD ALIGN="left" COLSPAN=2>
97       <INPUT TYPE="checkbox" NAME="enable_fuzzy_on_exact" VALUE="1" <% $curuser->option('enable_fuzzy_on_exact') ? 'CHECKED' : '' %>>
98     </TD>
99   </TR>
100
101   <TR>
102     <TH ALIGN="right" COLSPAN=1>Disable HTML editor for customer notes: </TH>
103     <TD ALIGN="left" COLSPAN=2>
104       <INPUT TYPE="checkbox" NAME="disable_html_editor" VALUE="1" <% $curuser->option('disable_html_editor') ? 'CHECKED' : '' %>>
105     </TD>
106   </TR>
107
108   <TR>
109     <TH ALIGN="right" COLSPAN=1>Disable submission on [Enter] key - one-time charges: </TH>
110     <TD ALIGN="left" COLSPAN=2>
111       <INPUT TYPE="checkbox" NAME="disable_enter_submit_onetimecharge" VALUE="1" <% $curuser->option('disable_enter_submit_onetimecharge') ? 'CHECKED' : '' %>>
112     </TD>
113   </TR>
114
115 </TABLE>
116 <BR>
117
118
119 Email Address
120 <% ntable("#cccccc",2) %>
121
122   <TR>
123     <TH>Email Address(es) (comma separated) </TH>
124     <TD>
125    <TD><INPUT TYPE="text" NAME="email_address" VALUE="<% $email_address %>">
126     </TD>
127   </TR>
128
129 </TABLE>
130 <BR>
131
132
133 Development
134 <% ntable("#cccccc",2) %>
135
136   <TR>
137     <TH>Show customer package timestamps: </TH>
138     <TD><INPUT TYPE="checkbox" NAME="cust_pkg-display_times" VALUE="1" <% $curuser->option('cust_pkg-display_times') ? 'CHECKED' : '' %>></TD>
139   </TR>
140   <TR>
141     <TH>Show internal package numbers: </TH>
142     <TD><INPUT TYPE="checkbox" NAME="show_pkgnum" VALUE="1" <% $curuser->option('show_pkgnum') ? 'CHECKED' : '' %>></TD>
143   </TR>
144   <TR>
145     <TH>Show config item counts: </TH>
146     <TD><INPUT TYPE="checkbox" NAME="show_confitem_counts" VALUE="1" <% $curuser->option('show_confitem_counts') ? 'CHECKED' : '' %>></TD>
147   </TR>
148   <TR>
149     <TH>Show export data on service view (when available): </TH>
150     <TD><INPUT TYPE="checkbox" NAME="export_getsettings" VALUE="1" <% $curuser->option('export_getsettings') ? 'CHECKED' : '' %>></TD>
151   </TR>
152   <TR>
153     <TH>Show database profiling (when available): </TH>
154     <TD><INPUT TYPE="checkbox" NAME="show_db_profile" VALUE="1" <% $curuser->option('show_db_profile') ? 'CHECKED' : '' %>></TD>
155   </TR>
156   <TR>
157     <TH>Save database profiling logs (when available): </TH>
158     <TD><INPUT TYPE="checkbox" NAME="save_db_profile" VALUE="1" <% $curuser->option('save_db_profile') ? 'CHECKED' : '' %>></TD>
159   </TR>
160   <TR>
161     <TH>Save temporary invoice typesetting files: </TH>
162     <TD><INPUT TYPE="checkbox" NAME="save_tmp_typesetting" VALUE="1" <% $curuser->option('save_tmp_typesetting') ? 'CHECKED' : '' %>></TD>
163   </TR>
164
165 </TABLE>
166 <BR>
167
168 SNOM integration
169 <% ntable("#cccccc",2) %>
170
171   <TR>
172     <TH ALIGN="right">SNOM IP address</TH>
173     <TD><INPUT TYPE="text" NAME="snom-ip" VALUE="<% $curuser->option('snom-ip') %>"></TD>
174   </TR>
175
176   <TR>
177     <TH ALIGN="right">SNOM HTTP username (if necessary)</TH>
178     <TD><INPUT TYPE="text" NAME="snom-username" VALUE="<% $curuser->option('snom-username') %>"></TD>
179   </TR>
180
181   <TR>
182     <TH ALIGN="right">SNOM HTTP password (if necessary)</TH>
183     <TD><INPUT TYPE="password" NAME="snom-password" VALUE="<% $curuser->option('snom-password') %>"></TD>
184   </TR>
185
186 </TABLE>
187 <BR>
188
189 OR<BR><BR>
190
191 Vonage integration (see <a href="https://secure.click2callu.com/">Click2Call</a>)
192 <% ntable("#cccccc",2) %>
193
194   <TR>
195     <TH ALIGN="right">Vonage phone number</TH>
196     <TD><INPUT TYPE="text" NAME="vonage-fromnumber" VALUE="<% $curuser->option('vonage-fromnumber') %>"></TD>
197   </TR>
198
199   <TR>
200     <TH ALIGN="right">Vonage username</TH>
201     <TD><INPUT TYPE="text" NAME="vonage-username" VALUE="<% $curuser->option('vonage-username') %>"></TD>
202   </TR>
203
204   <TR>
205     <TH ALIGN="right">Vonage password</TH>
206     <TD><INPUT TYPE="password" NAME="vonage-password" VALUE="<% $curuser->option('vonage-password') %>"></TD>
207   </TR>
208
209 </TABLE>
210 <BR>
211
212
213 % foreach my $prop (qw( height width availHeight availWidth colorDepth )) {
214   <INPUT TYPE="hidden" NAME="<% $prop %>" VALUE="">
215   <SCRIPT TYPE="text/javascript">
216   document.pref_form.<% $prop %>.value = screen.<% $prop %>;
217   </script>
218 % }
219
220 <INPUT TYPE="submit" VALUE="Update preferences">
221
222 <% include('/elements/footer.html') %>
223 <%init>
224
225 my $curuser = $FS::CurrentUser::CurrentUser;
226
227 #false laziness w/view/cust_main.cgi and Conf.pm (cust_main-default_view)
228
229 tie my %customer_views, 'Tie::IxHash',
230   'Basics'          => 'basics',
231   'Notes'           => 'notes', #notes and files?
232   'Tickets'         => 'tickets',
233   'Packages'        => 'packages',
234   'Payment History' => 'payment_history',
235 ;
236 $customer_views{'Change History'} = 'change_history'
237   if $curuser->access_right('View customer history');
238 $customer_views{'Jumbo'} = 'jumbo';
239
240 # XSS via your own preferences?  seems unlikely, but nice try anyway...
241 ( $curuser->option('menu_position') || 'top' )
242   =~ /^(\w+)$/ or die "illegal menu_position";
243 my $menu_position = $1;
244 ( $curuser->option('email_address') )
245   =~ /^([,\w\@.]*)$/ or die "illegal email_address";  #too late
246 my $email_address = $1;
247
248 </%init>