summaryrefslogtreecommitdiff
path: root/fs_selfservice
diff options
context:
space:
mode:
Diffstat (limited to 'fs_selfservice')
-rw-r--r--fs_selfservice/FS-SelfService/SelfService.pm4
-rw-r--r--fs_selfservice/FS-SelfService/cgi/myaccount_menu.html8
-rwxr-xr-xfs_selfservice/FS-SelfService/cgi/selfservice.cgi1
-rwxr-xr-xfs_selfservice/FS-SelfService/cgi/signup.html5
-rw-r--r--fs_selfservice/FS-SelfService/cgi/small_custview.html8
-rw-r--r--fs_selfservice/FS-SelfService/cgi/view_cdr_details.html3
-rw-r--r--fs_selfservice/FS-SelfService/cgi/view_usage.html96
7 files changed, 105 insertions, 20 deletions
diff --git a/fs_selfservice/FS-SelfService/SelfService.pm b/fs_selfservice/FS-SelfService/SelfService.pm
index c22e4269e..651a8f5cf 100644
--- a/fs_selfservice/FS-SelfService/SelfService.pm
+++ b/fs_selfservice/FS-SelfService/SelfService.pm
@@ -57,6 +57,10 @@ $socket .= '.'.$tag if defined $tag && length($tag);
'svc_status_html' => 'MyAccount/svc_status_html',
'svc_status_hash' => 'MyAccount/svc_status_hash',
'set_svc_status_hash' => 'MyAccount/set_svc_status_hash',
+ 'set_svc_status_listadd' => 'MyAccount/set_svc_status_listadd',
+ 'set_svc_status_listdel' => 'MyAccount/set_svc_status_listdel',
+ 'set_svc_status_vacationadd'=> 'MyAccount/set_svc_status_vacationadd',
+ 'set_svc_status_vacationdel'=> 'MyAccount/set_svc_status_vacationdel',
'acct_forward_info' => 'MyAccount/acct_forward_info',
'process_acct_forward' => 'MyAccount/process_acct_forward',
'list_dsl_devices' => 'MyAccount/list_dsl_devices',
diff --git a/fs_selfservice/FS-SelfService/cgi/myaccount_menu.html b/fs_selfservice/FS-SelfService/cgi/myaccount_menu.html
index c7d2bb2aa..4a31b1258 100644
--- a/fs_selfservice/FS-SelfService/cgi/myaccount_menu.html
+++ b/fs_selfservice/FS-SelfService/cgi/myaccount_menu.html
@@ -88,11 +88,13 @@ push @menu,
{ title=>'Logout', url=>'logout', size=>'+1', },
;
+my %menu_disable = map { $_=>1 } @menu_disable;
foreach my $item ( @menu ) {
- next if $menu_skipblanks && $item->{'title'} =~ /^\s*$/;
- next if $menu_skipheadings && ! $item->{'url'};
-
+ next if ( $menu_skipblanks && $item->{'title'} =~ /^\s*$/ )
+ || ( $menu_skipheadings && ! $item->{'url'} )
+ || $menu_disable{$item->{'title'}};
+
$OUT .= '<TR><TD';
if ( $menu_body_image ) {
if ( exists $item->{'url'} && $action eq $item->{'url'} ) {
diff --git a/fs_selfservice/FS-SelfService/cgi/selfservice.cgi b/fs_selfservice/FS-SelfService/cgi/selfservice.cgi
index de0ab1a76..f7fe308cf 100755
--- a/fs_selfservice/FS-SelfService/cgi/selfservice.cgi
+++ b/fs_selfservice/FS-SelfService/cgi/selfservice.cgi
@@ -873,6 +873,7 @@ sub view_cdr_details {
'svcnum' => $cgi->param('svcnum'),
'beginning' => $cgi->param('beginning') || '',
'ending' => $cgi->param('ending') || '',
+ 'inbound' => $cgi->param('inbound') || 0,
);
}
diff --git a/fs_selfservice/FS-SelfService/cgi/signup.html b/fs_selfservice/FS-SelfService/cgi/signup.html
index a3db74cfd..447f39af0 100755
--- a/fs_selfservice/FS-SelfService/cgi/signup.html
+++ b/fs_selfservice/FS-SelfService/cgi/signup.html
@@ -30,10 +30,10 @@
' Signup form</FONT><BR><BR>';
%>
-<FONT SIZE="+1" COLOR="#ff0000"><%= $error %></FONT>
+<FONT SIZE="+1" COLOR="#ff0000"><%= encode_entities($error) %></FONT>
<FORM NAME="OneTrueForm" ACTION="<%= $self_url %>" METHOD=POST onSubmit="document.OneTrueForm.signup.disabled=true">
-<INPUT TYPE="hidden" NAME="prepaid_shortform" VALUE="<%= $prepaid_shortform %>">
+<INPUT TYPE="hidden" NAME="prepaid_shortform" VALUE="<%= encode_entities($prepaid_shortform) %>">
<INPUT TYPE="hidden" NAME="session" VALUE="<%= $session_id %>">
<INPUT TYPE="hidden" NAME="action" VALUE="process_signup">
<INPUT TYPE="hidden" NAME="agentnum" VALUE="<%= $agentnum %>">
@@ -149,6 +149,7 @@ $OUT .= qq!
else {
@payby = ('PREPAY');
}
+'';
%>
<BR>Billing information<TABLE BGCOLOR="<%= $box_bgcolor || '#c0c0c0' %>" BORDER=0 CELLSPACING=0 WIDTH="100%">
diff --git a/fs_selfservice/FS-SelfService/cgi/small_custview.html b/fs_selfservice/FS-SelfService/cgi/small_custview.html
index 8d6e07368..470fe7151 100644
--- a/fs_selfservice/FS-SelfService/cgi/small_custview.html
+++ b/fs_selfservice/FS-SelfService/cgi/small_custview.html
@@ -10,10 +10,10 @@ Customer #<B><%= $custnum %></B>
? '<I><FONT SIZE="-1">Billing Address</FONT></I><BR>'
: ''
%>
- <%= $first %> <%= $last %><BR>
- <%= $company ? $company.'<BR>' : '' %>
- <%= $address1 %><BR>
- <%= $address2 ? $address2.'<BR>' : '' %>
+ <%= encode_entities($first) %> <%= encode_entities($last) %><BR>
+ <%= $company ? encode_entities($company).'<BR>' : '' %>
+ <%= encode_entities($address1) %><BR>
+ <%= $address2 ? encode_entities($address2).'<BR>' : '' %>
<%= $city %>, <%= $state %> <%= $zip %><BR>
<%= $country && $country ne ($countrydefault||'US')
? $country.'<BR>'
diff --git a/fs_selfservice/FS-SelfService/cgi/view_cdr_details.html b/fs_selfservice/FS-SelfService/cgi/view_cdr_details.html
index b0205ec89..0ee8e9635 100644
--- a/fs_selfservice/FS-SelfService/cgi/view_cdr_details.html
+++ b/fs_selfservice/FS-SelfService/cgi/view_cdr_details.html
@@ -1,5 +1,6 @@
<%= $url = "$selfurl?session=$session_id;action="; ''; %>
-<%= include('header', 'Call usage for '.
+<%= include('header', ($inbound ? 'Received calls' : 'Dialed calls' ) .
+ ' for '.
Date::Format::time2str('%b&nbsp;%o&nbsp;%Y', $beginning).
' - '.
Date::Format::time2str('%b&nbsp;%o&nbsp;%Y', $ending)
diff --git a/fs_selfservice/FS-SelfService/cgi/view_usage.html b/fs_selfservice/FS-SelfService/cgi/view_usage.html
index fd5426a75..35d128998 100644
--- a/fs_selfservice/FS-SelfService/cgi/view_usage.html
+++ b/fs_selfservice/FS-SelfService/cgi/view_usage.html
@@ -1,7 +1,20 @@
<%= $url = "$selfurl?session=$session_id;action=";
- @svc_acct = grep { $_->{svcdb} eq 'svc_acct' } @svcs;
- @svc_phone = grep { $_->{svcdb} eq 'svc_phone' } @svcs;
- @svc_port = grep { $_->{svcdb} eq 'svc_port' } @svcs;
+ %by_pkg_label = (); # not used yet, but I'm sure it will be...
+ @svc_acct = ();
+ @svc_phone = ();
+ @svc_port = ();
+
+ foreach (@svcs) {
+ $by_pkg_label{ $_->{pkg_label} } ||= [];
+ push @{ $by_pkg_label{ $_->{pkg_label} } }, $_;
+ if ( $_->{svcdb} eq 'svc_acct' ) {
+ push @svc_acct, $_;
+ } elsif ( $_->{svcdb} eq 'svc_phone' ) {
+ push @svc_phone, $_;
+ } elsif ( $_->{svcdb} eq 'svc_port' ) {
+ push @svc_port, $_;
+ }
+ }
'';
%>
<%= include('header', 'Account usage') %>
@@ -62,11 +75,22 @@
<%= scalar(@svc_acct) ? '</TABLE><BR><BR>' : '' %>
<%= if ( @svc_phone ) {
+ %any = ();
+ for my $dir (qw(outbound inbound)) {
+ $any{$dir} = grep { $_->{$dir} } @svc_phone;
+ }
$OUT.= '<FONT SIZE="4">Call usage</FONT><BR><BR>
- <TABLE BGCOLOR="#cccccc">
+ <TABLE BGCOLOR="#cccccc" STYLE="display:inline-block">
<TR>
- <TH ALIGN="left">Number</TH>'; #"Account" ?
- #what else?
+ <TH ALIGN="left">Number</TH>';
+ if ( $any{outbound} ) {
+ $OUT .= '
+ <TH>Dialed</TH>';
+ }
+ if ( $any{inbound} ) {
+ $OUT .= '
+ <TH>Received</TH>';
+ }
$OUT .= '</TR>';
} else {
$OUT .= '';
@@ -76,13 +100,65 @@
<%= foreach my $svc_phone ( @svc_phone ) {
my $link = "${url}view_cdr_details;".
"svcnum=$svc_phone->{'svcnum'};beginning=0;ending=0";
- $OUT .= '<TR><TD>';
- $OUT .= qq!<A HREF="$link">!. $svc_phone->{'label'}. ': '. $svc_phone->{'value'}.'</A>';
- $OUT .= '</TD></TR>';
+ $OUT .= '<TR><TD>'. $svc_phone->{'label'}. ': '. $svc_phone->{'value'};
+ $OUT .= '</TD>';
+ # usage summary w/ links
+ for my $dir (qw(outbound inbound)) {
+ if ( $dir eq 'inbound' ) {
+ $link .= ';inbound=1';
+ }
+ if ( $svc_phone->{$dir} ) {
+ $OUT .= '<TD ALIGN="right">'.qq!<A HREF="$link">! .
+ sprintf('%d calls (%.0f minutes)',
+ $svc_phone->{$dir}->{'count'},
+ $svc_phone->{$dir}->{'duration'} / 60
+ ) .
+ '</A></TD>';
+ } elsif ( $any{$dir} ) {
+ $OUT .= '<TD></TD>';
+ }
}
+ $OUT .= '</TR>';
+}
+'';
%>
-<%= scalar(@svc_phone) ? '</TABLE><BR><BR>' : '' %>
+<%= if ( @usage_pools ) {
+ $OUT .= '</TABLE>
+ <TABLE BGCOLOR="#cccccc" STYLE="display: inline-block">
+ <TR><TH COLSPAN=4>Remaining minutes</TH></TR>
+ ';
+ my $any_shared = 0;
+ foreach my $usage (@usage_pools) {
+ # false laziness with the back office side
+ my ($description, $remain, $total, $shared) = @$usage;
+ if ( $shared ) {
+ $any_shared = 1;
+ $description .= '*';
+ }
+ my $ratio = 255 * ($remain/$total);
+ $ratio = 255 if $color > 255;
+ my $color =
+ sprintf('STYLE="font-weight: bold; color: #%02x%02x00"',
+ 255 - $ratio, $ratio);
+ $OUT .=
+ qq!<TR>
+ <TD ALIGN="right">$description</TD>
+ <TD $color ALIGN="right">$remain</TD>
+ <TD $color> / </TD>
+ <TD $color>$total</TD>
+ </TR>!;
+ }
+ if ( $any_shared ) {
+ $OUT .= '<TR STYLE="font-size: 80%; font-style: italic">'.
+ '<TD COLSPAN=4>* shared among all your phone plans</TD></TR>';
+ }
+}
+if ( scalar(@svc_phone) or scalar(@usage_pools) ) {
+ $OUT .= '</TABLE><BR><BR>';
+}
+'';
+%>
<%= if ( @svc_port ) {
$OUT.= '<FONT SIZE="4">Bandwidth Graphs</FONT><BR><BR>