c7083e9d08be470f0b35a6bdc02d8bf971c285bd
[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 customer package timestamps: </TH>
87     <TD><INPUT TYPE="checkbox" NAME="cust_pkg-display_times" VALUE="1" <% $curuser->option('cust_pkg-display_times') ? 'CHECKED' : '' %>></TD>
88   </TR>
89   <TR>
90     <TH>Show internal package numbers: </TH>
91     <TD><INPUT TYPE="checkbox" NAME="show_pkgnum" VALUE="1" <% $curuser->option('show_pkgnum') ? 'CHECKED' : '' %>></TD>
92   </TR>
93   <TR>
94     <TH>Show config item counts: </TH>
95     <TD><INPUT TYPE="checkbox" NAME="show_confitem_counts" VALUE="1" <% $curuser->option('show_confitem_counts') ? 'CHECKED' : '' %>></TD>
96   </TR>
97   <TR>
98     <TH>Show export data on service view (when available): </TH>
99     <TD><INPUT TYPE="checkbox" NAME="export_getsettings" VALUE="1" <% $curuser->option('export_getsettings') ? 'CHECKED' : '' %>></TD>
100   </TR>
101   <TR>
102     <TH>Show database profiling (when available): </TH>
103     <TD><INPUT TYPE="checkbox" NAME="show_db_profile" VALUE="1" <% $curuser->option('show_db_profile') ? 'CHECKED' : '' %>></TD>
104   </TR>
105   <TR>
106     <TH>Save database profiling logs (when available): </TH>
107     <TD><INPUT TYPE="checkbox" NAME="save_db_profile" VALUE="1" <% $curuser->option('save_db_profile') ? 'CHECKED' : '' %>></TD>
108   </TR>
109
110 </TABLE>
111 <BR>
112
113 SNOM integration
114 <% ntable("#cccccc",2) %>
115
116   <TR>
117     <TH ALIGN="right">SNOM IP address</TH>
118     <TD><INPUT TYPE="text" NAME="snom-ip" VALUE="<% $curuser->option('snom-ip') %>"></TD>
119   </TR>
120
121   <TR>
122     <TH ALIGN="right">SNOM HTTP username (if necessary)</TH>
123     <TD><INPUT TYPE="text" NAME="snom-username" VALUE="<% $curuser->option('snom-username') %>"></TD>
124   </TR>
125
126   <TR>
127     <TH ALIGN="right">SNOM HTTP password (if necessary)</TH>
128     <TD><INPUT TYPE="password" NAME="snom-password" VALUE="<% $curuser->option('snom-password') %>"></TD>
129   </TR>
130
131 </TABLE>
132 <BR>
133
134 OR<BR><BR>
135
136 Vonage integration (see <a href="https://secure.click2callu.com/">Click2Call</a>)
137 <% ntable("#cccccc",2) %>
138
139   <TR>
140     <TH ALIGN="right">Vonage phone number</TH>
141     <TD><INPUT TYPE="text" NAME="vonage-fromnumber" VALUE="<% $curuser->option('vonage-fromnumber') %>"></TD>
142   </TR>
143
144   <TR>
145     <TH ALIGN="right">Vonage username</TH>
146     <TD><INPUT TYPE="text" NAME="vonage-username" VALUE="<% $curuser->option('vonage-username') %>"></TD>
147   </TR>
148
149   <TR>
150     <TH ALIGN="right">Vonage password</TH>
151     <TD><INPUT TYPE="password" NAME="vonage-password" VALUE="<% $curuser->option('vonage-password') %>"></TD>
152   </TR>
153
154 </TABLE>
155 <BR>
156
157
158 % foreach my $prop (qw( height width availHeight availWidth colorDepth )) {
159   <INPUT TYPE="hidden" NAME="<% $prop %>" VALUE="">
160   <SCRIPT TYPE="text/javascript">
161   document.pref_form.<% $prop %>.value = screen.<% $prop %>;
162   </script>
163 % }
164
165 <INPUT TYPE="submit" VALUE="Update preferences">
166
167 <% include('/elements/footer.html') %>
168 <%init>
169
170 my $curuser = $FS::CurrentUser::CurrentUser;
171
172 #false laziness w/view/cust_main.cgi and Conf.pm (cust_main-default_view)
173
174 tie my %customer_views, 'Tie::IxHash',
175   'Basics'          => 'basics',
176   'Notes'           => 'notes', #notes and files?
177   'Tickets'         => 'tickets',
178   'Packages'        => 'packages',
179   'Payment History' => 'payment_history',
180 ;
181 $customer_views{'Change History'} = 'change_history'
182   if $curuser->access_right('View customer history');
183 $customer_views{'Jumbo'} = 'jumbo';
184
185 # XSS via your own preferences?  seems unlikely, but nice try anyway...
186 ( $curuser->option('menu_position') || 'top' )
187   =~ /^(\w+)$/ or die "illegal menu_position";
188 my $menu_position = $1;
189 ( $curuser->option('email_address') )
190   =~ /^([,\w\@.]*)$/ or die "illegal email_address";  #too late
191 my $email_address = $1;
192
193 </%init>