X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fbrowse%2Fpart_pkg.cgi;h=d0b572aa42a293cc64fa6af355be93e42da1e19c;hp=e0d25f67dbcac5aaaafa9a2593229dc7d3e6ea22;hb=cf16b23820da69e3c8d0156ae27e21c635bf1ec5;hpb=fee9bc7edcdd27e7a4e47bc313d05c66cd900073 diff --git a/httemplate/browse/part_pkg.cgi b/httemplate/browse/part_pkg.cgi index e0d25f67d..d0b572aa4 100755 --- a/httemplate/browse/part_pkg.cgi +++ b/httemplate/browse/part_pkg.cgi @@ -1,5 +1,5 @@ <% -# +# use strict; use vars qw( $cgi $p $part_pkg ); @@ -18,12 +18,33 @@ $cgi = new CGI; $p = popurl(2); +my %search; +if ( $cgi->param('showdisabled') ) { + %search = (); +} else { + %search = ( 'disabled' => '' ); +} + +my @part_pkg = qsearch('part_pkg', \%search ); +my $total = scalar(@part_pkg); + print header("Package Definition Listing",menubar( 'Main Menu' => $p, -)), "One or more services are grouped together into a package and given", - " pricing information. Customers purchase packages", - " rather than purchase services directly.

", - &table(), <
". + "$total packages "; + +if ( $cgi->param('showdisabled') ) { + $cgi->param('showdisabled', 0); + print qq!( hide disabled packages )!; +} else { + $cgi->param('showdisabled', 1); + print qq!( show disabled packages )!; +} + +my $colspan = $cgi->param('showdisabled') ? 2 : 3; +print &table(), < Package Comment @@ -37,7 +58,7 @@ END foreach $part_pkg ( sort { $a->getfield('pkgpart') <=> $b->getfield('pkgpart') -} qsearch('part_pkg',{}) ) { +} @part_pkg ) { my($hashref)=$part_pkg->hashref; my(@pkg_svc)=grep $_->getfield('quantity'), qsearch('pkg_svc',{'pkgpart'=> $hashref->{pkgpart} }); @@ -54,9 +75,16 @@ foreach $part_pkg ( sort { } print < - - $hashref->{pkgpart} - + $hashref->{pkgpart} +END + + unless ( $cgi->param('showdisabled') ) { + print ""; + print "DISABLED" if $hashref->{disabled}; + print ''; + } + + print <$hashref->{pkg} $hashref->{comment} $hashref->{freq}