3 print header("Agent Type Listing", menubar(
5 )), "Agent types define groups of packages that you can then assign to".
6 " particular agents.<BR><BR>", &table(), <<END;
8 <TH COLSPAN=2>Agent Type</TH>
9 <TH COLSPAN=2>Packages</TH>
13 foreach my $agent_type ( sort {
14 $a->getfield('typenum') <=> $b->getfield('typenum')
15 } qsearch('agent_type',{}) ) {
16 my($hashref)=$agent_type->hashref;
17 my(@type_pkgs)=qsearch('type_pkgs',{'typenum'=> $hashref->{typenum} });
18 my($rowspan)=scalar(@type_pkgs);
19 $rowspan = int($rowspan/2+0.5) ;
22 <TD ROWSPAN=$rowspan><A HREF="${p}edit/agent_type.cgi?$hashref->{typenum}">
25 <TD ROWSPAN=$rowspan><A HREF="${p}edit/agent_type.cgi?$hashref->{typenum}">$hashref->{atype}</A></TD>
30 foreach $type_pkgs ( @type_pkgs ) {
31 my($pkgpart)=$type_pkgs->getfield('pkgpart');
32 my($part_pkg) = qsearchs('part_pkg',{'pkgpart'=> $pkgpart });
33 print qq!<TR>! if ($tdcount == 0) ;
34 $tdcount = 0 if ($tdcount == -1) ;
35 print qq!<TD><A HREF="${p}edit/part_pkg.cgi?$pkgpart">!,
36 $part_pkg->getfield('pkg'),"</A></TD>";
49 <TR><TD COLSPAN=4><I><A HREF="${p}edit/agent_type.cgi">Add a new agent type</A></I></TD></TR>