finish up initial work on customer view tabs (ensure links back to customer view...
[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: </TD>
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 </TABLE>
58 <BR>
59
60
61 Email Address
62 <% ntable("#cccccc",2) %>
63
64   <TR>
65     <TH>Email Address(es) (comma separated) </TH>
66     <TD>
67    <TD><INPUT TYPE="text" NAME="email_address" VALUE="<% $email_address %>">
68     </TD>
69   </TR>
70
71 </TABLE>
72 <BR>
73
74
75 Development
76 <% ntable("#cccccc",2) %>
77
78   <TR>
79     <TH>Show internal package numbers: </TH>
80     <TD><INPUT TYPE="checkbox" NAME="show_pkgnum" VALUE="1" <% $curuser->option('show_pkgnum') ? 'CHECKED' : '' %>></TD>
81   </TR>
82   <TR>
83     <TH>Show database profiling (when available): </TH>
84     <TD><INPUT TYPE="checkbox" NAME="show_db_profile" VALUE="1" <% $curuser->option('show_db_profile') ? 'CHECKED' : '' %>></TD>
85   </TR>
86   <TR>
87     <TH>Save database profiling logs (when available): </TH>
88     <TD><INPUT TYPE="checkbox" NAME="save_db_profile" VALUE="1" <% $curuser->option('save_db_profile') ? 'CHECKED' : '' %>></TD>
89   </TR>
90
91 </TABLE>
92 <BR>
93
94
95 Vonage integration (see <a href="https://secure.click2callu.com/">Click2Call</a>)
96 <% ntable("#cccccc",2) %>
97
98   <TR>
99     <TH ALIGN="right">Vonage phone number</TH>
100     <TD><INPUT TYPE="text" NAME="vonage-fromnumber" VALUE="<% $curuser->option('vonage-fromnumber') %>"></TD>
101   </TR>
102
103   <TR>
104     <TH ALIGN="right">Vonage username</TH>
105     <TD><INPUT TYPE="text" NAME="vonage-username" VALUE="<% $curuser->option('vonage-username') %>"></TD>
106   </TR>
107
108   <TR>
109     <TH ALIGN="right">Vonage password</TH>
110     <TD><INPUT TYPE="password" NAME="vonage-password" VALUE="<% $curuser->option('vonage-password') %>"></TD>
111   </TR>
112
113 </TABLE>
114 <BR>
115
116
117 % foreach my $prop (qw( height width availHeight availWidth colorDepth )) {
118   <INPUT TYPE="hidden" NAME="<% $prop %>" VALUE="">
119   <SCRIPT TYPE="text/javascript">
120   document.pref_form.<% $prop %>.value = screen.<% $prop %>;
121   </script>
122 % }
123
124 <INPUT TYPE="submit" VALUE="Update preferences">
125
126 <% include('/elements/footer.html') %>
127 <%once>
128
129   #false laziness w/view/cust_main.cgi and Conf.pm (cust_main-default_view)
130
131   tie my %customer_views, 'Tie::IxHash',
132     'Basics'          => 'basics',
133     'Notes'           => 'notes', #notes and files?
134     'Tickets'         => 'tickets',
135     'Packages'        => 'packages',
136     'Payment History' => 'payment_history',
137     #'Change History'  => '',
138     'Jumbo'           => 'jumbo',
139   ;
140
141 </%once>
142 <%init>
143
144 my $curuser = $FS::CurrentUser::CurrentUser;
145
146 # XSS via your own preferences?  seems unlikely, but nice try anyway...
147 ( $curuser->option('menu_position') || 'top' )
148   =~ /^(\w+)$/ or die "illegal menu_position";
149 my $menu_position = $1;
150 ( $curuser->option('email_address') )
151   =~ /^([,\w\@.]*)$/ or die "illegal email_address";  #too late
152 my $email_address = $1;
153
154 </%init>