Optimize "Customer has a referring customer" condition, RT#74452
[freeside.git] / httemplate / elements / tr-select-agent_type.html
index 1b0dfd4..3e6ce07 100644 (file)
@@ -7,12 +7,10 @@
   <TR>
     <TD ALIGN="right"><% $opt{'label'} || 'Agent Type' %></TD>
     <TD>
-      <% include( '/elements/select-agent_type.html',
-                     'curr_value'  => $typenum,
-                     'agent_types' => \@agent_types,
-                     %opt,
-                 )
-      %>
+      <& /elements/select-agent_type.html,
+           'curr_value'  => $typenum,
+           %opt,
+      &>
     </TD>
   </TR>
 
 my %opt = @_;
 my $typenum = $opt{'curr_value'} || $opt{'value'};
 
-my @agent_types = ();
-if ( $opt{'agent_types'} ) {
-  #@agents = @{ $opt{'agents'} };
-
-  #here is the agent virtualization
-#  my $agentnums_href = $FS::CurrentUser::CurrentUser->agentnums_href;
-#  @agent_types = grep $agentnums_href->{$_->agentnum}, @{ $opt{'agent_types'} };
-
-  delete $opt{'agent_types'};
-} else {
-#  @agents = $FS::CurrentUser::CurrentUser->agents;
-}
+my @agent_types = qsearch('agent_type', { 'disabled' => '' });
 
 </%init>