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