From 2f3b4161da680cd0fff8c91dbdc50fe5e974610e Mon Sep 17 00:00:00 2001 From: jeff Date: Mon, 24 Sep 2007 15:47:52 +0000 Subject: self-service support usage improvements (1733) --- fs_selfservice/FS-SelfService/SelfService.pm | 1 + fs_selfservice/FS-SelfService/cgi/myaccount.html | 25 ++++++- fs_selfservice/FS-SelfService/cgi/selfservice.cgi | 14 +++- .../FS-SelfService/cgi/view_support_details.html | 80 ++++++++++++++++++++++ 4 files changed, 115 insertions(+), 5 deletions(-) create mode 100644 fs_selfservice/FS-SelfService/cgi/view_support_details.html (limited to 'fs_selfservice') 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 %>!

%> <%= - if ( defined($support_time) ) { + if ( @support_services ) { $OUT .= ''. - ''. - "
Support Time Remaining
$support_time

"; + 'Support Time Remaining'. + '#Package'. + 'Time Remaining'; + my $col1 = "ffffff"; + my $col2 = "dddddd"; + my $col = $col1; + + foreach my $support ( @support_services ) { + my $td = qq!!; + my $a = qq!'; + $OUT .= + "$td$a". $support->{'pkgnum'}. "". + $td.$a. $support->{'pkg'}. "". + $td.$a. $support->{'time'}. "". + ''; + $col = $col eq $col1 ? $col2 : $col1; + } + $OUT .= '
'; + } 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 @@ +MyAccount +MyAccount

+<%= $url = "$selfurl?session=$session_id;action="; ''; %> +<%= include('myaccount_menu') %> + + +Support usage details for +<%= Date::Format::time2str('%b %o %Y', $beginning) %> - +<%= Date::Format::time2str('%b %o %Y', $ending) %> +

+ +<%= if ( $error ) { + $OUT .= qq!$error

!; +} ''; %> + + + + + + +
+<%= if ($previous < $beginning) { + $OUT .= qq!Previous period!; + }else{ + ''; + } %> + +<%= if ($next > $ending) { + $OUT .= qq!Next period!; + }else{ + ''; + }%> +
+ + + + + + + + + +<%= my $total = 0; + foreach my $usage ( @usage ) { + $OUT .= ''; + } + my $h = int($total/3600); + my $m = sprintf("%02d", int(($total % 3600) / 60)); + my $s = sprintf("%02d", $total % 60); + $OUT .= qq!!; + $OUT .= qq!!; + %> + +
TicketSubjectStaffDateStatusTime
'; + $OUT .= $usage->{'ticketid'}; + $OUT .= ''; + $OUT .= $usage->{'subject'}; + $OUT .= ''; + $OUT .= $usage->{'creator'}; + $OUT .= ''; + $OUT .= Date::Format::time2str('%T%P %a %b %o %Y', $usage->{'_date'}); + $OUT .= ''; + $OUT .= $usage->{'status'}; + $OUT .= ''; + 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 .= '

$h:$m:$s
+
+ + +
+powered by freeside + -- cgit v1.2.1