X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fbrowse%2Fpart_svc.cgi;h=8b596752f814ebd7fe959fed66d24103cfc0752f;hp=ef0de13cccd3c1d8bfd61d4100409eaff25dbf5a;hb=3f2a7b01b59902faed5767d81e2959e131bdbdfd;hpb=b8cfd0780aa40bb07f3215bf9cb58011f5e32a35 diff --git a/httemplate/browse/part_svc.cgi b/httemplate/browse/part_svc.cgi index ef0de13cc..8b596752f 100755 --- a/httemplate/browse/part_svc.cgi +++ b/httemplate/browse/part_svc.cgi @@ -1,34 +1,4 @@ - -<% - -my %search; -if ( $cgi->param('showdisabled') ) { - %search = (); -} else { - %search = ( 'disabled' => '' ); -} - -my @part_svc = - sort { $a->getfield('svcpart') <=> $b->getfield('svcpart') } - qsearch('part_svc', \%search ); -my $total = scalar(@part_svc); - -my %num_active_cust_svc = (); -if ( $cgi->param('active') ) { - my $active_sth = dbh->prepare( - 'SELECT COUNT(*) FROM cust_svc WHERE svcpart = ?' - ) or die dbh->errstr; - foreach my $part_svc ( @part_svc ) { - $active_sth->execute($part_svc->svcpart) or die $active_sth->errstr; - $num_active_cust_svc{$part_svc->svcpart} = - $active_sth->fetchrow_arrayref->[0]; - } - @part_svc = sort { $num_active_cust_svc{$b->svcpart} <=> - $num_active_cust_svc{$a->svcpart} } @part_svc; -} - -%> -<%= header('Service Definition Listing', menubar( 'Main Menu' => $p) ) %> +<% include('/elements/header.html', 'Service Definition Listing') %>