2 <%= header("Agent Type Listing", menubar(
4 'Agents' => $p. 'browse/agent.cgi',
6 Agent types define groups of packages that you can then assign to particular
8 <A HREF="<%= $p %>edit/agent_type.cgi"><I>Add a new agent type</I></A><BR><BR>
12 <TH COLSPAN=2>Agent Type</TH>
13 <TH COLSPAN=2>Packages</TH>
17 foreach my $agent_type ( sort {
18 $a->getfield('typenum') <=> $b->getfield('typenum')
19 } qsearch('agent_type',{}) ) {
20 my $hashref = $agent_type->hashref;
21 #more efficient to do this with SQL...
22 my @type_pkgs = grep { $_->part_pkg and ! $_->part_pkg->disabled }
23 qsearch('type_pkgs',{'typenum'=> $hashref->{typenum} });
24 my $rowspan = scalar(@type_pkgs);
25 $rowspan = int($rowspan/2+0.5) ;
28 <TD ROWSPAN=$rowspan><A HREF="${p}edit/agent_type.cgi?$hashref->{typenum}">
31 <TD ROWSPAN=$rowspan><A HREF="${p}edit/agent_type.cgi?$hashref->{typenum}">$hashref->{atype}</A></TD>
36 foreach $type_pkgs ( @type_pkgs ) {
37 my($pkgpart)=$type_pkgs->getfield('pkgpart');
38 my($part_pkg) = qsearchs('part_pkg',{'pkgpart'=> $pkgpart });
39 print qq!<TR>! if ($tdcount == 0) ;
40 $tdcount = 0 if ($tdcount == -1) ;
41 print qq!<TD><A HREF="${p}edit/part_pkg.cgi?$pkgpart">!,
42 $part_pkg->getfield('pkg'),"</A></TD>";