diff options
author | ivan <ivan> | 2005-03-10 08:58:02 +0000 |
---|---|---|
committer | ivan <ivan> | 2005-03-10 08:58:02 +0000 |
commit | aa8abee96e4c9a915ebbbd1d987c8dec23f9ae70 (patch) | |
tree | 95fb20ee99c561e2f12197b2419f34574b08a9aa /httemplate/edit/part_pkg.cgi | |
parent | dcd77b42f7d872c87a25ba3b56b45793d5cb2d36 (diff) |
fixes package editing problem with extraneous services showing up, closes: Bug#1170
Diffstat (limited to 'httemplate/edit/part_pkg.cgi')
-rwxr-xr-x | httemplate/edit/part_pkg.cgi | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/httemplate/edit/part_pkg.cgi b/httemplate/edit/part_pkg.cgi index 1790cdfeb..fd2aa2bfc 100755 --- a/httemplate/edit/part_pkg.cgi +++ b/httemplate/edit/part_pkg.cgi @@ -176,7 +176,16 @@ END my @fixups = (); my $count = 0; my $columns = 3; -my @part_svc = qsearch( 'part_svc', { 'disabled' => '' } ); +my @part_svc = qsearch( + 'part_svc', + {}, + '', + "WHERE disabled IS NULL OR disabled = '' + OR 0 < ( SELECT quantity FROM pkg_svc + WHERE pkg_svc.svcpart = part_svc.svcpart + AND pkgpart = 72 + )" +); foreach my $part_svc ( @part_svc ) { my $svcpart = $part_svc->svcpart; my $pkgpart = $cgi->param('clone') || $part_pkg->pkgpart; @@ -206,7 +215,9 @@ foreach my $part_svc ( @part_svc ) { print '></TD>'; } print qq!<TD><A HREF="part_svc.cgi?!,$part_svc->svcpart, - qq!">!, $part_svc->getfield('svc'), "</A></TD></TR>"; + qq!">!, $part_svc->getfield('svc'), '</A>'; + print ' (DISABLED)' if $part_svc->disabled =~ /^Y/i; + print '</TD></TR>'; # print "</TABLE></TD><TD>$thead" if ++$count == int(scalar(@part_svc) / 2); $count+=1; foreach ( 1 .. $columns-1 ) { |