X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Felements%2Ftr-select-agent.html;h=986bbc0b1d9c6fcd0be59f503765fc43eb8e0561;hb=4ef042d6aea8b8922fc5cfb596023d04da4690be;hp=6158f6f478570b812ac0a5080a299b3cee323c0a;hpb=e47e9758f480c664bfc3917d798cd69c7d354999;p=freeside.git diff --git a/httemplate/elements/tr-select-agent.html b/httemplate/elements/tr-select-agent.html index 6158f6f47..986bbc0b1 100644 --- a/httemplate/elements/tr-select-agent.html +++ b/httemplate/elements/tr-select-agent.html @@ -1,34 +1,80 @@ -<% - my( $agentnum, %opt ) = @_; +<%doc> - 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; - } +Example: -%> + include( '/elements/tr-select-agent.html', -<% if ( scalar(@agents) == 1 ) { %> + #recommended to keep things "sticky" on errors + 'curr_value' => $curr_value, - + ## + # optional + ## -<% } else { %> + 'label' => 'Agent for this thing', + 'empty_label' => 'Select agent', #override default + 'disable_empty' => 1, + + #set to 'None' or something to override default of showing all agents + #for employees w/ 'View customers of all agents' right + viewall_right => 'None', + + ); + +%doc> + +% $required = '*' if $opt{'required'}; + +% if ( scalar(@agents) == 1 || $opt{'fixed'} ) { + + + +% if ( scalar(@agents) != 1 ) { +