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