X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=httemplate%2Fbrowse%2Fagent_type.cgi;h=5473804e825bde1bb86594a0ef987ab90f86a23c;hb=95d7eccb2a441d225257181eb8db0911f38a5176;hp=eb20c640433d0e684a93971278c5fef31ac8b499;hpb=a4c96748eb6eab29a70f3a944c6520283a635c78;p=freeside.git
diff --git a/httemplate/browse/agent_type.cgi b/httemplate/browse/agent_type.cgi
index eb20c6404..5473804e8 100755
--- a/httemplate/browse/agent_type.cgi
+++ b/httemplate/browse/agent_type.cgi
@@ -1,22 +1,27 @@
-<%
-
-print header("Agent Type Listing", menubar(
+<%= header("Agent Type Listing", menubar(
'Main Menu' => $p,
-)), "Agent types define groups of packages that you can then assign to".
- " particular agents.
", &table(), <
- Agent Type |
- Packages |
-
-END
+ 'Agents' => $p. 'browse/agent.cgi',
+)) %>
+Agent types define groups of packages that you can then assign to particular
+agents.
+Add a new agent type
+
+<%= table() %>
+
+ Agent Type |
+ Packages |
+
+<%
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);
+ my $hashref = $agent_type->hashref;
+ #more efficient to do this with SQL...
+ my @type_pkgs = grep { $_->part_pkg and ! $_->part_pkg->disabled }
+ qsearch('type_pkgs',{'typenum'=> $hashref->{typenum} });
+ my $rowspan = scalar(@type_pkgs);
$rowspan = int($rowspan/2+0.5) ;
print <
@@ -47,7 +52,6 @@ END
}
print <Add a new agent type |