X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Felements%2Ftr-select-agent.html;h=fcfa9f300074bb9ec820c34066d6a0d28cf5b3c5;hb=37591b61f8ad6fc5c5acb2fd8f520d2dbe4f1539;hp=37b1c1e88658ca101d67fc8fd96f760cd05fb9e7;hpb=3ce7691203a7737406bf2d4442f7fd84b81f847e;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; + +