4036432aab5522cee439cca995e67db410f29fb7
[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" BGCOLOR="<%= $menu_bgcolor || $box_bgcolor || '#c0c0c0' %>">
4
5 <TABLE CELLSPACING=0 BORDER=0 HEIGHT="100%">
6
7 <%= 
8
9 if ( $menu_top_image ) {
10   $OUT .= '<TR><TD STYLE="padding:0px"><IMG SRC="image.cgi?menu_top_image"></TD></TR>';
11 }
12
13 my @menu = (
14   { title=>' ' },
15   { title=>'Overview', url=>'myaccount', size=>'+1', },
16   { title=>' ' },
17   { title=>'Purchase', size=>'+1', },
18 );
19
20 unless ( $access_pkgnum ) {
21   push @menu,
22     { title=>'Purchase additional package',
23       url=>'customer_order_pkg', 'indent'=>2 };
24 }
25
26 if ( 1 ) { #XXXFIXME "enable selfservice prepay features" flag or something, eventually per-pkg or something really fancy
27
28   #XXXFIXME still a bit sloppy for multi-gateway of differing namespace
29   my $i = 0;
30   while($i < scalar(@cust_paybys)) { last if $cust_paybys[$i] =~ /^CARD/; $i++ }
31   if ( $cust_paybys[$i] && $cust_paybys[$i] =~ /^CARD/ ) {
32     push @menu, { title  => 'Recharge my account with a credit card',
33                   url    => $hide_payment_fields[$i]
34                               ? 'make_thirdparty_payment&payby_method=CC'
35                               : 'make_payment',
36                   indent => 2,
37                  }
38   }
39
40   $i = 0;
41   while($i < scalar(@cust_paybys)) { last if $cust_paybys[$i] =~ /^CHEK/; $i++ }
42   if ( $cust_paybys[$i] && $cust_paybys[$i] =~ /^CHEK/ ) {
43     push @menu, { title  => 'Recharge my account with a check',
44                   url    => $hide_payment_fields[$i]
45                               ? 'make_thirdparty_payment&payby_method=ECHECK'
46                               : 'make_ach_payment',
47                   indent => 2,
48                 }
49   }
50
51   push @menu, { title  => 'Recharge my account with a prepaid card',
52                 url    => 'recharge_prepay',
53                 indent => 2,
54               }
55     if grep(/^PREP/, @cust_paybys);
56
57 }
58
59 push @menu,
60   { title=>' ' },
61   { title=>'View my usage', url=>'view_usage', size=>'+1', },
62   { title=>'Create a ticket', url=>'tktcreate', size=>'+1', },
63 ;
64
65 unless ( $access_pkgnum ) {
66   push @menu,
67     { title=>'Setup my services', url=>'provision', size=>'+1', },
68   ;
69 }
70
71 push @menu,
72   { title=>' ' };
73
74 push @menu,
75   { title=>'Change my information', size=>'+1', };
76
77 unless ( $access_pkgnum ) {
78   push @menu,
79     { title=>'Change billing address',      url=>'change_bill',     indent=>2 },
80     { title=>'Change service address',      url=>'change_ship',     indent=>2 },
81     { title=>'Change payment information',  url=>'change_pay',      indent=>2 },
82   ;
83 }
84
85 push @menu,
86   { title=>'Change password(s)',          url=>'change_password', indent=>2 },
87   { title=>' ' },
88   { title=>'Logout',   url=>'logout', size=>'+1', },
89 ;
90
91 foreach my $item ( @menu ) {
92
93   next if $menu_skipblanks && $item->{'title'} =~ /^\s*$/;
94   next if $menu_skipheadings && ! $item->{'url'};
95
96   $OUT .= '<TR><TD'; 
97   if ( $menu_body_image ) {
98     if ( exists $item->{'url'} && $action eq $item->{'url'} ) {
99       $OUT .= #' BGCOLOR="'. ( $body_bgcolor || '#eeeeee' ). '" '.
100               ' STYLE="background: url(image.cgi?menu_body_image) 0 bottom; '.
101               '        color:#3366CC"; '. #XXX config
102               ' " ';
103     } else {
104       $OUT .= ' STYLE="background: url(image.cgi?menu_body_image) 0 bottom" ';
105     }
106   } else {
107     if ( exists $item->{'url'} && $action eq $item->{'url'} ) {
108       $OUT .= ' BGCOLOR="'. ( $body_bgcolor || '#eeeeee' ). '" '.
109               ' STYLE="border-top: 1px solid black;'.
110                      ' border-left: 1px solid black;'.
111                      ' border-bottom: 1px solid black"';
112     } else {
113       $OUT .= ' STYLE="border-right: 1px solid black"';
114     }
115   }
116   $OUT.='>';
117
118   if ( $menu_skipheadings ) {
119     $OUT .= '&nbsp;&nbsp;';
120   } else {
121     $OUT .= '&nbsp;' x $item->{'indent'}
122       if exists $item->{'indent'};
123   }
124
125   $OUT .= '<A HREF="'. $url. $item->{'url'}. '">'
126     if exists $item->{'url'} && $action ne $item->{'url'};
127
128   $OUT .= '<FONT SIZE="'. ( $menu_fontsize || $item->{'size'} ). '">'
129     if $menu_fontsize || exists($item->{'size'});
130
131   $item->{'title'} =~ s/ /&nbsp;/g;
132   $OUT .= $item->{'title'};
133
134   $OUT .= '</FONT>'
135     if exists $item->{'size'};
136
137   $OUT .= '</A>'
138     if exists $item->{'url'} && $action ne $item->{'url'};
139
140   $OUT .= '</TD></TR>';
141
142 }
143
144 if ( $menu_bottom_image ) {
145   $OUT .= '<TR><TD STYLE="padding:0px"><IMG SRC="image.cgi?menu_bottom_image"></TD></TR>';
146 } else {
147   $OUT .= '<TR><TD STYLE="border-right: 1px solid black" HEIGHT="100%"><BR><BR><BR><BR></TD></TR>';
148 }
149
150 %>
151
152 </TABLE>
153
154 </TD>