blob: eb20c640433d0e684a93971278c5fef31ac8b499 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
<!-- mason kludge -->
<%
print header("Agent Type Listing", menubar(
'Main Menu' => $p,
)), "Agent types define groups of packages that you can then assign to".
" particular agents.<BR><BR>", &table(), <<END;
<TR>
<TH COLSPAN=2>Agent Type</TH>
<TH COLSPAN=2>Packages</TH>
</TR>
END
foreach my $agent_type ( sort {
$a->getfield('typenum') <=> $b->getfield('typenum')
} qsearch('agent_type',{}) ) {
my($hashref)=$agent_type->hashref;
my(@type_pkgs)=qsearch('type_pkgs',{'typenum'=> $hashref->{typenum} });
my($rowspan)=scalar(@type_pkgs);
$rowspan = int($rowspan/2+0.5) ;
print <<END;
<TR>
<TD ROWSPAN=$rowspan><A HREF="${p}edit/agent_type.cgi?$hashref->{typenum}">
$hashref->{typenum}
</A></TD>
<TD ROWSPAN=$rowspan><A HREF="${p}edit/agent_type.cgi?$hashref->{typenum}">$hashref->{atype}</A></TD>
END
my($type_pkgs);
my($tdcount) = -1 ;
foreach $type_pkgs ( @type_pkgs ) {
my($pkgpart)=$type_pkgs->getfield('pkgpart');
my($part_pkg) = qsearchs('part_pkg',{'pkgpart'=> $pkgpart });
print qq!<TR>! if ($tdcount == 0) ;
$tdcount = 0 if ($tdcount == -1) ;
print qq!<TD><A HREF="${p}edit/part_pkg.cgi?$pkgpart">!,
$part_pkg->getfield('pkg'),"</A></TD>";
$tdcount ++ ;
if ($tdcount == 2)
{
print qq!</TR>\n! ;
$tdcount = 0 ;
}
}
print "</TR>";
}
print <<END;
<TR><TD COLSPAN=4><I><A HREF="${p}edit/agent_type.cgi">Add a new agent type</A></I></TD></TR>
</TABLE>
</BODY>
</HTML>
END
%>
|