X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fagent_type.cgi;h=944ddd0d02997bd9bbcd3adb936e305f5ee40a45;hb=1a033848671cad2cbe7687b37fc718b3b2a68b83;hp=68421633579749401a2211515baaad7e3098b3e1;hpb=e5787d471e4d94f28cfb68db97b31eefbe35a651;p=freeside.git
diff --git a/httemplate/edit/agent_type.cgi b/httemplate/edit/agent_type.cgi
index 684216335..944ddd0d0 100755
--- a/httemplate/edit/agent_type.cgi
+++ b/httemplate/edit/agent_type.cgi
@@ -16,7 +16,7 @@ my $action = $agent_type->typenum ? 'Edit' : 'Add';
%>
-<%= header("$action Agent Type", menubar(
+<%= include("/elements/header.html","$action Agent Type", menubar(
'Main Menu' => "$p",
'View all agent types' => "${p}browse/agent_type.cgi",
))
@@ -37,7 +37,18 @@ Agent Type
Select which packages agents of this type may sell to customers
-<% foreach my $part_pkg ( qsearch('part_pkg',{ 'disabled' => '' }) ) { %>
+<% foreach my $part_pkg (
+ qsearch({ 'table' => 'part_pkg',
+ 'hashref' => { 'disabled' => '' },
+ 'select' => 'part_pkg.*',
+ 'addl_from' => 'LEFT JOIN type_pkgs USING ( pkgpart )',
+ 'extra_sql' => ( $agent_type->typenum
+ ? 'OR typenum = '. $agent_type->typenum
+ : ''
+ ),
+ })
+ ) {
+%>
%> VALUE="ON">
<%= $part_pkg->pkgpart %>:
- <%= $part_pkg->pkg %> (<%= $part_pkg->comment %>)
+ <%= $part_pkg->pkg %> - <%= $part_pkg->comment %>
+ <%= $part_pkg->disabled =~ /^Y/i ? ' (DISABLED)' : '' %>
<% } %>