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