summaryrefslogtreecommitdiff
path: root/fs_selfservice
diff options
context:
space:
mode:
authorjeff <jeff>2007-09-24 15:47:52 +0000
committerjeff <jeff>2007-09-24 15:47:52 +0000
commit2f3b4161da680cd0fff8c91dbdc50fe5e974610e (patch)
treeb38079387c295996bd50faba7636343ac85aebd5 /fs_selfservice
parent91caf036bc222d20d078e31f1d28c2d6c86805e1 (diff)
self-service support usage improvements (1733)
Diffstat (limited to 'fs_selfservice')
-rw-r--r--fs_selfservice/FS-SelfService/SelfService.pm1
-rw-r--r--fs_selfservice/FS-SelfService/cgi/myaccount.html25
-rw-r--r--fs_selfservice/FS-SelfService/cgi/selfservice.cgi14
-rw-r--r--fs_selfservice/FS-SelfService/cgi/view_support_details.html80
4 files changed, 115 insertions, 5 deletions
diff --git a/fs_selfservice/FS-SelfService/SelfService.pm b/fs_selfservice/FS-SelfService/SelfService.pm
index fe17fae5d..32497d90b 100644
--- a/fs_selfservice/FS-SelfService/SelfService.pm
+++ b/fs_selfservice/FS-SelfService/SelfService.pm
@@ -38,6 +38,7 @@ $socket .= '.'.$tag if defined $tag && length($tag);
'list_pkgs' => 'MyAccount/list_pkgs', #add to ss cgi (added?)
'list_svcs' => 'MyAccount/list_svcs', #add to ss cgi (added?)
'list_svc_usage' => 'MyAccount/list_svc_usage',
+ 'list_support_usage' => 'MyAccount/list_support_usage',
'order_pkg' => 'MyAccount/order_pkg', #add to ss cgi!
'change_pkg' => 'MyAccount/change_pkg',
'order_recharge' => 'MyAccount/order_recharge',
diff --git a/fs_selfservice/FS-SelfService/cgi/myaccount.html b/fs_selfservice/FS-SelfService/cgi/myaccount.html
index 421a866f1..65b98427d 100644
--- a/fs_selfservice/FS-SelfService/cgi/myaccount.html
+++ b/fs_selfservice/FS-SelfService/cgi/myaccount.html
@@ -37,10 +37,29 @@ Hello <%= $name %>!<BR><BR>
%>
<%=
- if ( defined($support_time) ) {
+ if ( @support_services ) {
$OUT .= '<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=2 BGCOLOR="#eeeeee">'.
- '<TR><TH BGCOLOR="#ff6666">Support Time Remaining</TH></TR>'.
- "<TR><TD>$support_time</TD></TR></TABLE><BR>";
+ '<TR><TH BGCOLOR="#ff6666" COLSPAN="3">Support Time Remaining</TH>'.
+ '</TR><TR><TH ALIGN="left">#</TH><TH>Package</TH>'.
+ '<TH>Time Remaining</TH></TR>';
+ my $col1 = "ffffff";
+ my $col2 = "dddddd";
+ my $col = $col1;
+
+ foreach my $support ( @support_services ) {
+ my $td = qq!<TD BGCOLOR="#$col">!;
+ my $a = qq!<A HREF="${url}view_support_details;svcnum=!.
+ $support->{'svcnum'}. '">';
+ $OUT .=
+ "<TR>$td$a". $support->{'pkgnum'}. "</A></TD>".
+ $td.$a. $support->{'pkg'}. "</A></TD>".
+ $td.$a. $support->{'time'}. "</A></TD>".
+ '</TR>';
+ $col = $col eq $col1 ? $col2 : $col1;
+ }
+ $OUT .= '</TABLE><BR>';
+ } else {
+ $OUT .= '';
}
%>
diff --git a/fs_selfservice/FS-SelfService/cgi/selfservice.cgi b/fs_selfservice/FS-SelfService/cgi/selfservice.cgi
index 591112447..9cf8c4b1e 100644
--- a/fs_selfservice/FS-SelfService/cgi/selfservice.cgi
+++ b/fs_selfservice/FS-SelfService/cgi/selfservice.cgi
@@ -15,7 +15,8 @@ use FS::SelfService qw( login customer_info invoice
list_pkgs order_pkg signup_info order_recharge
part_svc_info provision_acct provision_external
unprovision_svc change_pkg
- list_svcs list_svc_usage myaccount_passwd
+ list_svcs list_svc_usage list_support_usage
+ myaccount_passwd
);
$template_dir = '.';
@@ -67,7 +68,7 @@ $session_id = $cgi->param('session');
#order|pw_list XXX ???
$cgi->param('action') =~
- /^(myaccount|view_invoice|make_payment|make_ach_payment|payment_results|ach_payment_results|recharge_prepay|recharge_results|logout|change_bill|change_ship|customer_order_pkg|process_order_pkg|customer_change_pkg|process_change_pkg|process_order_recharge|provision|provision_svc|process_svc_acct|process_svc_external|delete_svc|view_usage|view_usage_details|change_password|process_change_password)$/
+ /^(myaccount|view_invoice|make_payment|make_ach_payment|payment_results|ach_payment_results|recharge_prepay|recharge_results|logout|change_bill|change_ship|customer_order_pkg|process_order_pkg|customer_change_pkg|process_change_pkg|process_order_recharge|provision|provision_svc|process_svc_acct|process_svc_external|delete_svc|view_usage|view_usage_details|view_support_details|change_password|process_change_password)$/
or die "unknown action ". $cgi->param('action');
my $action = $1;
@@ -490,6 +491,15 @@ sub view_usage_details {
);
}
+sub view_support_details {
+ list_support_usage(
+ 'session_id' => $session_id,
+ 'svcnum' => $cgi->param('svcnum'),
+ 'beginning' => $cgi->param('beginning') || '',
+ 'ending' => $cgi->param('ending') || '',
+ );
+}
+
sub change_password {
list_svcs(
'session_id' => $session_id,
diff --git a/fs_selfservice/FS-SelfService/cgi/view_support_details.html b/fs_selfservice/FS-SelfService/cgi/view_support_details.html
new file mode 100644
index 000000000..b3d5b13f8
--- /dev/null
+++ b/fs_selfservice/FS-SelfService/cgi/view_support_details.html
@@ -0,0 +1,80 @@
+<HTML><HEAD><TITLE>MyAccount</TITLE></HEAD>
+<BODY BGCOLOR="#eeeeee"><FONT SIZE=5>MyAccount</FONT><BR><BR>
+<%= $url = "$selfurl?session=$session_id;action="; ''; %>
+<%= include('myaccount_menu') %>
+<TD VALIGN="top">
+
+<FONT SIZE=4>Support usage details for
+<%= Date::Format::time2str('%b&nbsp;%o&nbsp;%Y', $beginning) %> -
+<%= Date::Format::time2str('%b&nbsp;%o&nbsp;%Y', $ending) %>
+</FONT><BR><BR>
+
+<%= if ( $error ) {
+ $OUT .= qq!<FONT SIZE="+1" COLOR="#ff0000">$error</FONT><BR><BR>!;
+} ''; %>
+
+<TABLE WIDTH="100%">
+ <TR>
+ <TD WIDTH="50%">
+<%= if ($previous < $beginning) {
+ $OUT .= qq!<A HREF="${url}view_support_details;svcnum=$svcnum;beginning=!;
+ $OUT .= qq!$previous;ending=$beginning">Previous period</A>!;
+ }else{
+ '';
+ } %>
+ </TD>
+ <TD WIDTH="50%" ALIGN="right">
+<%= if ($next > $ending) {
+ $OUT .= qq!<A HREF="${url}view_support_details;svcnum=$svcnum;beginning=!;
+ $OUT .= qq!$ending;ending=$next">Next period</A>!;
+ }else{
+ '';
+ }%>
+ </TD>
+ </TR>
+</TABLE>
+<TABLE BGCOLOR="#cccccc">
+ <TR>
+ <TH ALIGN="left">Ticket</TH>
+ <TH ALIGN="right">Subject</TH>
+ <TH ALIGN="right">Staff</TH>
+ <TH ALIGN="left">Date</TH>
+ <TH ALIGN="right">Status</TH>
+ <TH ALIGN="right">Time</TH>
+ </TR>
+<%= my $total = 0;
+ foreach my $usage ( @usage ) {
+ $OUT .= '<TR><TD ALIGN="left">';
+ $OUT .= $usage->{'ticketid'};
+ $OUT .= '</TD><TD ALIGN="right">';
+ $OUT .= $usage->{'subject'};
+ $OUT .= '</TD><TD ALIGN="right">';
+ $OUT .= $usage->{'creator'};
+ $OUT .= '</TD><TD ALIGN="left">';
+ $OUT .= Date::Format::time2str('%T%P %a&nbsp;%b&nbsp;%o&nbsp;%Y', $usage->{'_date'});
+ $OUT .= '</TD><TD ALIGN="right">';
+ $OUT .= $usage->{'status'};
+ $OUT .= '</TD><TD ALIGN="right">';
+ my $duration = $usage->{'support'};
+ $total += $usage->{'support'};
+ my $h = int($duration/3600);
+ my $m = sprintf("%02d", int(($duration % 3600) / 60));
+ my $s = sprintf("%02d", $duration % 60);
+ $OUT .= $usage->{'support'} < 0 ? '-' : '';
+ $OUT .= "$h:$m:$s";
+ $OUT .= '</TD></TR>';
+ }
+ my $h = int($total/3600);
+ my $m = sprintf("%02d", int(($total % 3600) / 60));
+ my $s = sprintf("%02d", $total % 60);
+ $OUT .= qq!<TR><TD COLSPAN="5"></TD><TD ALIGN="right"><HR></TD></TR>!;
+ $OUT .= qq!<TR><TD COLSPAN="5"></TD><TD ALIGN="right">$h:$m:$s</TD></TR>!;
+ %>
+
+</TABLE>
+<BR>
+
+</TD></TR></TABLE>
+<HR>
+<FONT SIZE="-2">powered by <a href="http://www.sisd.com/freeside">freeside</a></FONT>
+</BODY></HTML>