This commit was generated by cvs2svn to compensate for changes in r5562,
[freeside.git] / httemplate / elements / tr-select-agent_type.html
1 % if ( scalar(@agent_types) == 1 ) { 
2
3   <INPUT TYPE="hidden" NAME="<% $opt{'field'} || 'typenum' %>" VALUE="<% $agent_types[0]->typenum %>">
4
5 % } else { 
6
7   <TR>
8     <TD ALIGN="right"><% $opt{'label'} || 'Agent Type' %></TD>
9     <TD>
10       <% include( '/elements/select-agent_type.html',
11                      'curr_value'  => $typenum,
12                      'agent_types' => \@agent_types,
13                      %opt,
14                  )
15       %>
16     </TD>
17   </TR>
18
19 % } 
20
21 <%init>
22
23 my %opt = @_;
24 my $typenum = $opt{'curr_value'} || $opt{'value'};
25
26 my @agent_types = ();
27 if ( $opt{'agent_types'} ) {
28   #@agents = @{ $opt{'agents'} };
29
30   #here is the agent virtualization
31 #  my $agentnums_href = $FS::CurrentUser::CurrentUser->agentnums_href;
32 #  @agent_types = grep $agentnums_href->{$_->agentnum}, @{ $opt{'agent_types'} };
33
34   delete $opt{'agent_types'};
35 } else {
36 #  @agents = $FS::CurrentUser::CurrentUser->agents;
37 }
38
39 </%init>