1 % if ( scalar(@agents) == 1 ) {
3 <INPUT TYPE="hidden" NAME="<% $opt{'field'} || 'agentnum' %>" VALUE="<% $agents[0]->agentnum %>">
5 %# YUCK. empty row so we don't throw g_row in edit.html off :/
11 <TD ALIGN="right"><% $opt{'label'} || 'Agent' %></TD>
13 <% include( '/elements/select-agent.html',
14 'curr_value' => $agentnum,
27 my $agentnum = $opt{'curr_value'} || $opt{'value'};
30 if ( $opt{'agents'} ) {
31 #@agents = @{ $opt{'agents'} };
32 #here is the agent virtualization
33 my $agentnums_href = $FS::CurrentUser::CurrentUser->agentnums_href;
34 @agents = grep $agentnums_href->{$_->agentnum}, @{ $opt{'agents'} };
35 delete $opt{'agents'};
37 @agents = $FS::CurrentUser::CurrentUser->agents;