X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fbrowse%2Fpart_pkg.cgi;h=58422c67d67471af800e8ed5773e428faa477541;hb=1a4ba4fc23449a4bb189c8e7a69a10a2a793efc3;hp=30f994872fef2b2f49a12a98bf1d00dab1db2eb9;hpb=60c837e0aaf454dfa0b0c0283dc36928782d1b6c;p=freeside.git diff --git a/httemplate/browse/part_pkg.cgi b/httemplate/browse/part_pkg.cgi index 30f994872..58422c67d 100755 --- a/httemplate/browse/part_pkg.cgi +++ b/httemplate/browse/part_pkg.cgi @@ -1,31 +1,38 @@ + <% -# -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); +%> +<%= 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.

+Add a new package definition +

-$p = popurl(2); +<%= $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 )!; +} -print $cgi->header( '-expires' => 'now' ), 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 + Package Comment Freq. Plan @@ -35,9 +42,9 @@ print $cgi->header( '-expires' => 'now' ), header("Package Definition Listing",m 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 +61,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} @@ -78,8 +92,9 @@ END print ""; } +$colspan = $cgi->param('showdisabled') ? 8 : 9; print <Add a new package definition +