RT#8224: allow user to disable HTML editor
[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">Menu location: </TH>
35     <TD>
36       <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>
37       <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>
38     </TD>
39     <TD><IMG NAME="menu_example" SRC="../images/menu-<% $menu_position %>-example.png"></TD>
40   </TR>
41
42   <TR>
43     <TH ALIGN="right">Default customer view: </TH>
44     <TD COLSPAN=2>
45       <SELECT NAME="default_customer_view">
46 %       foreach my $view ( keys %customer_views ) {
47 %         my $selected =
48 %           $customer_views{$view} eq $curuser->option('default_customer_view')
49 %             ? 'SELECTED'
50 %             : '';
51           <OPTION VALUE="<%$customer_views{$view}%>" <%$selected%>><%$view%></OPTION>
52 %       }
53       </SELECT>
54     </TD>
55   </TR>
56   
57   <TR>
58     <TH ALIGN="right" COLSPAN=1>Disable HTML editor for customer notes: </TH>
59     <TD ALIGN="left" COLSPAN=2>
60       <INPUT TYPE="checkbox" NAME="disable_html_editor" VALUE="1" <% $curuser->option('disable_html_editor') ? 'CHECKED' : '' %>>
61     </TD>
62   </TR>
63
64 </TABLE>
65 <BR>
66
67
68 Email Address
69 <% ntable("#cccccc",2) %>
70
71   <TR>
72     <TH>Email Address(es) (comma separated) </TH>
73     <TD>
74    <TD><INPUT TYPE="text" NAME="email_address" VALUE="<% $email_address %>">
75     </TD>
76   </TR>
77
78 </TABLE>
79 <BR>
80
81
82 Development
83 <% ntable("#cccccc",2) %>
84
85   <TR>
86     <TH>Show internal package numbers: </TH>
87     <TD><INPUT TYPE="checkbox" NAME="show_pkgnum" VALUE="1" <% $curuser->option('show_pkgnum') ? 'CHECKED' : '' %>></TD>
88   </TR>
89   <TR>
90     <TH>Show config item counts: </TH>
91     <TD><INPUT TYPE="checkbox" NAME="show_confitem_counts" VALUE="1" <% $curuser->option('show_confitem_counts') ? 'CHECKED' : '' %>></TD>
92   </TR>
93   <TR>
94     <TH>Show export data on service view (when available): </TH>
95     <TD><INPUT TYPE="checkbox" NAME="export_getsettings" VALUE="1" <% $curuser->option('export_getsettings') ? 'CHECKED' : '' %>></TD>
96   </TR>
97   <TR>
98     <TH>Show database profiling (when available): </TH>
99     <TD><INPUT TYPE="checkbox" NAME="show_db_profile" VALUE="1" <% $curuser->option('show_db_profile') ? 'CHECKED' : '' %>></TD>
100   </TR>
101   <TR>
102     <TH>Save database profiling logs (when available): </TH>
103     <TD><INPUT TYPE="checkbox" NAME="save_db_profile" VALUE="1" <% $curuser->option('save_db_profile') ? 'CHECKED' : '' %>></TD>
104   </TR>
105
106 </TABLE>
107 <BR>
108
109 SNOM integration
110 <% ntable("#cccccc",2) %>
111
112   <TR>
113     <TH ALIGN="right">SNOM IP address</TH>
114     <TD><INPUT TYPE="text" NAME="snom-ip" VALUE="<% $curuser->option('snom-ip') %>"></TD>
115   </TR>
116
117   <TR>
118     <TH ALIGN="right">SNOM HTTP username (if necessary)</TH>
119     <TD><INPUT TYPE="text" NAME="snom-username" VALUE="<% $curuser->option('snom-username') %>"></TD>
120   </TR>
121
122   <TR>
123     <TH ALIGN="right">SNOM HTTP password (if necessary)</TH>
124     <TD><INPUT TYPE="password" NAME="snom-password" VALUE="<% $curuser->option('snom-password') %>"></TD>
125   </TR>
126
127 </TABLE>
128 <BR>
129
130 OR<BR><BR>
131
132 Vonage integration (see <a href="https://secure.click2callu.com/">Click2Call</a>)
133 <% ntable("#cccccc",2) %>
134
135   <TR>
136     <TH ALIGN="right">Vonage phone number</TH>
137     <TD><INPUT TYPE="text" NAME="vonage-fromnumber" VALUE="<% $curuser->option('vonage-fromnumber') %>"></TD>
138   </TR>
139
140   <TR>
141     <TH ALIGN="right">Vonage username</TH>
142     <TD><INPUT TYPE="text" NAME="vonage-username" VALUE="<% $curuser->option('vonage-username') %>"></TD>
143   </TR>
144
145   <TR>
146     <TH ALIGN="right">Vonage password</TH>
147     <TD><INPUT TYPE="password" NAME="vonage-password" VALUE="<% $curuser->option('vonage-password') %>"></TD>
148   </TR>
149
150 </TABLE>
151 <BR>
152
153
154 % foreach my $prop (qw( height width availHeight availWidth colorDepth )) {
155   <INPUT TYPE="hidden" NAME="<% $prop %>" VALUE="">
156   <SCRIPT TYPE="text/javascript">
157   document.pref_form.<% $prop %>.value = screen.<% $prop %>;
158   </script>
159 % }
160
161 <INPUT TYPE="submit" VALUE="Update preferences">
162
163 <% include('/elements/footer.html') %>
164 <%init>
165
166 my $curuser = $FS::CurrentUser::CurrentUser;
167
168 #false laziness w/view/cust_main.cgi and Conf.pm (cust_main-default_view)
169
170 tie my %customer_views, 'Tie::IxHash',
171   'Basics'          => 'basics',
172   'Notes'           => 'notes', #notes and files?
173   'Tickets'         => 'tickets',
174   'Packages'        => 'packages',
175   'Payment History' => 'payment_history',
176 ;
177 $customer_views{'Change History'} = 'change_history'
178   if $curuser->access_right('View customer history');
179 $customer_views{'Jumbo'} = 'jumbo';
180
181 # XSS via your own preferences?  seems unlikely, but nice try anyway...
182 ( $curuser->option('menu_position') || 'top' )
183   =~ /^(\w+)$/ or die "illegal menu_position";
184 my $menu_position = $1;
185 ( $curuser->option('email_address') )
186   =~ /^([,\w\@.]*)$/ or die "illegal email_address";  #too late
187 my $email_address = $1;
188
189 </%init>