another bug spotted by jeff
[freeside.git] / httemplate / edit / cust_pkg.cgi
index ea92ac0..73b1907 100755 (executable)
@@ -1,5 +1,5 @@
 <%
-#<!-- $Id: cust_pkg.cgi,v 1.3 2001-10-26 10:24:56 ivan Exp $ -->
+#<!-- $Id: cust_pkg.cgi,v 1.5 2001-12-27 09:26:14 ivan Exp $ -->
 
 use strict;
 use vars qw( $cgi %pkg %comment $custnum $p1 @cust_pkg 
@@ -17,7 +17,7 @@ $cgi = new CGI;
 
 %pkg = ();
 %comment = ();
-foreach (qsearch('part_pkg', {})) {
+foreach (qsearch('part_pkg', { 'disabled' => '' })) {
   $pkg{ $_ -> getfield('pkgpart') } = $_->getfield('pkg');
   $comment{ $_ -> getfield('pkgpart') } = $_->getfield('comment');
 }
@@ -33,7 +33,7 @@ if ( $cgi->param('error') ) {
 }
 
 $p1 = popurl(1);
-print $cgi->header( @FS::CGI::header ), header("Add/Edit Packages", '');
+print header("Add/Edit Packages", '');
 
 print qq!<FONT SIZE="+1" COLOR="#ff0000">Error: !, $cgi->param('error'),
       "</FONT>"
@@ -83,6 +83,7 @@ print qq!<TABLE>!;
 foreach $type_pkgs ( qsearch('type_pkgs',{'typenum'=> $agent->typenum }) ) {
   $pkgparts++;
   my($pkgpart)=$type_pkgs->pkgpart;
+  next unless exists $pkg{$pkgpart}; #skip disabled ones
   print qq!<TR>! if ( $count == 0 );
   my $value = $cgi->param("pkg$pkgpart") || 0;
   print <<END;