X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Felements%2Ftr-select-agent.html;h=fcfa9f300074bb9ec820c34066d6a0d28cf5b3c5;hb=7b125e587a4d1ee0aca692e23ea7897f671855ae;hp=37b1c1e88658ca101d67fc8fd96f760cd05fb9e7;hpb=c8cccb4a92adceb943c635fe62dad0d034462ce0;p=freeside.git diff --git a/httemplate/elements/tr-select-agent.html b/httemplate/elements/tr-select-agent.html index 37b1c1e88..fcfa9f300 100644 --- a/httemplate/elements/tr-select-agent.html +++ b/httemplate/elements/tr-select-agent.html @@ -1,34 +1,33 @@ -% -% my( $agentnum, %opt ) = @_; -% -% my @agents; -% if ( $opt{'agents'} ) { -% #@agents = @{ $opt{'agents'} }; -% #here is the agent virtualization -% my $agentnums_href = $FS::CurrentUser::CurrentUser->agentnums_href; -% @agents = grep $agentnums_href->{$_->agentnum}, @{ $opt{'agents'} }; -% delete $opt{'agents'}; -% } else { -% @agents = $FS::CurrentUser::CurrentUser->agents; -% } -% -% % if ( scalar(@agents) == 1 ) { + - +%# YUCK. empty row so we don't throw g_row in edit.html off :/ + + % } else { - <% $opt{'label'} || 'Agent' %> - <% include( '/elements/select-agent.html', $agentnum, - 'agents' => \@agents, + <% include( '/elements/select-agent.html', + 'curr_value' => $agentnum, + 'agents' => \@agents, %opt, ) %> + % } +<%init> + +my %opt = @_; +my $agentnum = $opt{'curr_value'} || $opt{'value'}; + +my @agents = $opt{'agents'} + ? @{ $opt{'agents'} } + : $FS::CurrentUser::CurrentUser->agents; + +