[freeside-commits] freeside/fs_selfservice/FS-SelfService/cgi ws_list.html, NONE, 1.1.2.2 selfservice.cgi, 1.46.2.2, 1.46.2.3 provision.html, 1.6, 1.6.4.1
Erik Levinson
levinse at wavetail.420.am
Wed Dec 15 07:09:51 PST 2010
Update of /home/cvs/cvsroot/freeside/fs_selfservice/FS-SelfService/cgi
In directory wavetail.420.am:/tmp/cvs-serv29039/fs_selfservice/FS-SelfService/cgi
Modified Files:
Tag: FREESIDE_2_1_BRANCH
selfservice.cgi provision.html
Added Files:
Tag: FREESIDE_2_1_BRANCH
ws_list.html
Log Message:
self-service improvements, RT10883
Index: selfservice.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/fs_selfservice/FS-SelfService/cgi/selfservice.cgi,v
retrieving revision 1.46.2.2
retrieving revision 1.46.2.3
diff -u -w -d -r1.46.2.2 -r1.46.2.3
--- selfservice.cgi 14 Dec 2010 23:27:21 -0000 1.46.2.2
+++ selfservice.cgi 15 Dec 2010 15:09:48 -0000 1.46.2.3
@@ -615,6 +615,8 @@
sub provision {
my $result = list_pkgs( 'session_id' => $session_id );
die $result->{'error'} if exists $result->{'error'} && $result->{'error'};
+ $result->{'pkgpart'} = $cgi->param('pkgpart') if $cgi->param('pkgpart');
+ $result->{'filter'} = $cgi->param('filter') if $cgi->param('filter');
$result;
}
Index: provision.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/fs_selfservice/FS-SelfService/cgi/provision.html,v
retrieving revision 1.6
retrieving revision 1.6.4.1
diff -u -w -d -r1.6 -r1.6.4.1
--- provision.html 21 Jan 2010 08:34:01 -0000 1.6
+++ provision.html 15 Dec 2010 15:09:49 -0000 1.6.4.1
@@ -1,6 +1,11 @@
-<%= $url = "$selfurl?session=$session_id;action="; ''; %>
-<%= include('header', 'Setup my services') %>
+<%= $url = "$selfurl?session=$session_id;action=";
+ $heading1 = "Setup my services";
+ $heading1 = "Package list" if $wholesale_view;
+ $provision_list = "provision_list";
+ $provision_list = "ws_list" if $wholesale_view;
+ ''; %>
+<%= include('header', $heading1) %>
-<%= include('provision_list') %>
+<%= include($provision_list) %>
<%= include('footer') %>
--- NEW FILE: ws_list.html ---
<%=
sub ws_pkglink {
my($cat,$count,$link) = (shift,shift,shift);
return "0 $cat <BR>" unless $count->{$cat};
return qq! <A HREF="${link};filter=$cat">$count->{$cat}</A> $cat <BR> !;
}
sub ws_pkgstatus {
my $pkg = shift;
$status = "unbilled";
$status = "active" if ( $pkg->{setup} && !$pkg->{cancel}
&& !$pkg->{susp} );
$status = "suspended" if ( $pkg->{susp} && !$pkg->{cancel} );
$status = "cancelled" if $pkg->{cancel};
$status;
}
sub pdate {
my($field,$date_format) = (shift,shift);
return "<TD>".Date::Format::time2str($date_format,$field)."</TD>"
if $field > 0;
'<TD></TD>';
}
if ( $pkgpart ) {
$OUT .= qq! <TABLE BORDER="1"><TR><TH>Package</TH><TH>Status</TH> !;
$OUT .= "<TH>Setup</TH><TH>Last Bill</TH><TH>Next Bill</TH><TH>Adjourn</TH>";
$OUT .= "<TH>Suspend</TH><TH>Expire</TH><TH>Contract End</TH>";
$OUT .= "<TH>Cancel</TH></TR>";
foreach my $pkg ( @cust_pkg ) {
my $part_pkg = $pkg->{part_pkg}[0];
$status = ws_pkgstatus($pkg);
if($pkg->{pkgpart} == $pkgpart && ($filter eq $status || !$filter) ) {
$OUT .= "<TR><TD>$part_pkg->{pkg}</TD><TD>$status</TD>";
$OUT .= pdate($pkg->{setup},$date_format);
$OUT .= pdate($pkg->{last_bill},$date_format);
$OUT .= pdate($pkg->{bill},$date_format);
$OUT .= pdate($pkg->{adjourn},$date_format);
$OUT .= pdate($pkg->{susp},$date_format);
$OUT .= pdate($pkg->{expire},$date_format);
$OUT .= pdate($pkg->{contract_end},$date_format);
$OUT .= pdate($pkg->{cancel},$date_format);
$OUT .= "</TR>";
}
}
$OUT .= "</TABLE>";
}
else {
my %pkgparts;
foreach my $pkg ( @cust_pkg ) {
my $status = ws_pkgstatus($pkg);
$pkgparts{$pkg->{pkgpart}}{$status}++;
my $part_pkg = $pkg->{part_pkg}[0];
$pkgparts{$pkg->{pkgpart}}{pkg} = $part_pkg->{pkg};
}
$OUT .= qq! <TABLE BORDER="1"><TR><TH>Package</TH><TH>Status</TH></TR> !;
my($pkgpart,$counts);
while(($pkgpart,$count) = each %pkgparts){
my $link = "${url}provision;pkgpart=$pkgpart";
$OUT .= qq! <TR><TD><A HREF="$link">$count->{pkg}</A></TD><TD> !;
$OUT .= ws_pkglink("unbilled",$count,$link);
$OUT .= ws_pkglink("active",$count,$link);
$OUT .= ws_pkglink("suspended",$count,$link);
$OUT .= ws_pkglink("cancelled",$count,$link);
$OUT .= "</TD></TR>";
}
$OUT .= "</TABLE>";
}
%>
More information about the freeside-commits
mailing list