[freeside-commits] freeside/fs_selfservice/FS-SelfService/cgi myaccount.html, 1.9, 1.10 selfservice.cgi, 1.25, 1.26 view_support_details.html, NONE, 1.1
Jeff Finucane,420,,
jeff at wavetail.420.am
Mon Sep 24 08:47:54 PDT 2007
Update of /home/cvs/cvsroot/freeside/fs_selfservice/FS-SelfService/cgi
In directory wavetail:/tmp/cvs-serv21882/fs_selfservice/FS-SelfService/cgi
Modified Files:
myaccount.html selfservice.cgi
Added Files:
view_support_details.html
Log Message:
self-service support usage improvements (1733)
Index: selfservice.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/fs_selfservice/FS-SelfService/cgi/selfservice.cgi,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- selfservice.cgi 11 Jul 2007 11:10:18 -0000 1.25
+++ selfservice.cgi 24 Sep 2007 15:47:51 -0000 1.26
@@ -15,7 +15,8 @@
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 @@
#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_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,
Index: myaccount.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/fs_selfservice/FS-SelfService/cgi/myaccount.html,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- myaccount.html 19 Sep 2007 00:27:43 -0000 1.9
+++ myaccount.html 24 Sep 2007 15:47:51 -0000 1.10
@@ -37,10 +37,29 @@
%>
<%=
- 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 .= '';
}
%>
--- NEW FILE: view_support_details.html ---
<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 %o %Y', $beginning) %> -
<%= Date::Format::time2str('%b %o %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 %b %o %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>
More information about the freeside-commits
mailing list