X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fbrowse%2Fagent_type.cgi;h=5473804e825bde1bb86594a0ef987ab90f86a23c;hp=ba74e0d4c694832038033de160c4f7ac3d7b4ed4;hb=432a10eb5431f3ef973f6273539b2a685f665807;hpb=22a35047ecdffff80110e06cc08fc84f9ddba9b0 diff --git a/httemplate/browse/agent_type.cgi b/httemplate/browse/agent_type.cgi index ba74e0d4c..5473804e8 100755 --- a/httemplate/browse/agent_type.cgi +++ b/httemplate/browse/agent_type.cgi @@ -1,21 +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 < @@ -46,7 +52,6 @@ END } print <Add a new agent type