merge webpay support in with autoselection of old realtime_bop and realtime_refund_bop
[freeside.git] / fs_selfservice / FS-SelfService / cgi / myaccount_menu.html
1 <%= $url = "$selfurl?session=$session_id;action="; ''; %>
2 <TABLE BORDER=0><TR>
3 <TD VALIGN="top" HEIGHT="100%" BGCOLOR="#dddddd">
4
5 <TABLE CELLSPACING=0 BORDER=0 HEIGHT="100%">
6
7 <%= 
8
9 my @menu = (
10 { title=>' ' },
11 { title=>'Overview', url=>'myaccount', size=>'+1', },
12 { title=>' ' },
13
14 { title=>'Purchase', size=>'+1', },
15   { title=>'Purchase additional package',
16     url=>'customer_order_pkg', 'indent'=>2 },
17 );
18
19 if ( 1 ) { #XXXFIXME "enable selfservice prepay features" flag or something, eventually per-pkg or something really fancy
20
21   #XXXFIXME still a bit sloppy for multi-gateway of differing namespace
22   my $i = 0;
23   while($i < scalar(@cust_paybys)) { last if $cust_paybys[$i] =~ /^CARD/; $i++ }
24   if ( $cust_paybys[$i] =~ /^CARD/ ) {
25     push @menu, { title  => 'Recharge my account with a credit card',
26                   url    => $hide_payment_fields[$i]
27                               ? 'make_thirdparty_payment&payby_method=CC'
28                               : 'make_payment',
29                   indent => 2,
30                  }
31   }
32
33   $i = 0;
34   while($i < scalar(@cust_paybys)) { last if $cust_paybys[$i] =~ /^CHEK/; $i++ }
35   if ( $cust_paybys[$i] =~ /^CHEK/ ) {
36     push @menu, { title  => 'Recharge my account with a check',
37                   url    => $hide_payment_field[$i]
38                               ? 'make_thirdparty_payment&payby_method=ECHECK'
39                               : 'make_ach_payment',
40                   indent => 2,
41                 }
42   }
43
44   push @menu, { title  => 'Recharge my account with a prepaid card',
45                 url    => 'recharge_prepay',
46                 indent => 2,
47               }
48     if grep(/^PREP/, @cust_paybys);
49
50 }
51
52 push @menu, (
53
54 { title=>' ' },
55
56 { title=>'View my usage', url=>'view_usage', size=>'+1', },
57 { title=>'Setup my services', url=>'provision', size=>'+1', },
58
59 { title=>' ' },
60
61 { title=>'Change my information', size=>'+1', },
62   { title=>'Change billing address',      url=>'change_bill',     indent=>2 },
63   { title=>'Change service address',      url=>'change_ship',     indent=>2 },
64   { title=>'Change payment information',  url=>'change_pay',      indent=>2 },
65   { title=>'Change password(s)',          url=>'change_password', indent=>2 },
66
67 { title=>' ' },
68
69 { title=>'Logout',   url=>'logout', size=>'+1', },
70
71 );
72
73 foreach my $item ( @menu ) {
74
75   $OUT .= '<TR><TD'; 
76   if ( exists $item->{'url'} && $action eq $item->{'url'} ) {
77     $OUT .= ' BGCOLOR="#eeeeee" '.
78             ' STYLE="border-top: 1px solid black;'.
79                    ' border-left: 1px solid black;'.
80                    ' border-bottom: 1px solid black"';
81   } else {
82     $OUT .= ' STYLE="border-right: 1px solid black"';
83   }
84   $OUT.='>';
85
86   $OUT .= '<FONT SIZE="'. $item->{'size'}. '">'
87     if exists $item->{'size'};
88
89   $OUT .= '&nbsp;' x $item->{'indent'}
90     if exists $item->{'indent'};
91
92   $OUT .= '<A HREF="'. $url. $item->{'url'}. '">'
93     if exists $item->{'url'} && $action ne $item->{'url'};
94
95   $item->{'title'} =~ s/ /&nbsp;/g;
96   $OUT .= $item->{'title'};
97
98   $OUT .= '</FONT>'
99     if exists $item->{'size'};
100
101   $OUT .= '</A>'
102     if exists $item->{'url'} && $action ne $item->{'url'};
103
104   $OUT .= '</TD></TR>';
105
106 }
107
108 %>
109
110 <TR><TD STYLE="border-right: 1px solid black" HEIGHT="100%"><BR><BR><BR><BR></TD></TR>
111
112 </TABLE>
113
114 </TD>