X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fbrowse%2Fpart_pkg.cgi;h=0af64e73716344b56de79964ada73ce4d6322055;hp=9a699d5efc111b72afc598e022cd7d505c4290d1;hb=a4c96748eb6eab29a70f3a944c6520283a635c78;hpb=91387f8f489e561deaf1de052d80ef800a4970a3 diff --git a/httemplate/browse/part_pkg.cgi b/httemplate/browse/part_pkg.cgi index 9a699d5ef..0af64e737 100755 --- a/httemplate/browse/part_pkg.cgi +++ b/httemplate/browse/part_pkg.cgi @@ -1,29 +1,33 @@ + <% -# -use strict; -use vars qw( $cgi $p $part_pkg ); -use CGI; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearch qsearchs); -use FS::CGI qw(header menubar popurl table); -use FS::part_pkg; -use FS::pkg_svc; -use FS::part_svc; +my %search; +if ( $cgi->param('showdisabled') ) { + %search = (); +} else { + %search = ( 'disabled' => '' ); +} -$cgi = new CGI; +my @part_pkg = qsearch('part_pkg', \%search ); +my $total = scalar(@part_pkg); -&cgisuidsetup($cgi); +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.

". + "$total packages "; -$p = popurl(2); +if ( $cgi->param('showdisabled') ) { + $cgi->param('showdisabled', 0); + print qq!( hide disabled packages )!; +} else { + $cgi->param('showdisabled', 1); + print qq!( show disabled packages )!; +} -print $cgi->header( @FS::CGI::header ), 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(), <param('showdisabled') ? 2 : 3; +print &table(), < Package Comment @@ -35,9 +39,9 @@ print $cgi->header( @FS::CGI::header ), header("Package Definition Listing",menu END -foreach $part_pkg ( sort { +foreach my $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 +58,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}