X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Felements%2Fselect-agent.html;h=54069a5cb12ca95c7b22a213c6a8a95697829f74;hb=9509e5bfb7f9331303153cac24d7bfecbe2ea9f1;hp=009cc6e0638d88cfc05c83ebdd6683d2191b0a51;hpb=e47e9758f480c664bfc3917d798cd69c7d354999;p=freeside.git diff --git a/httemplate/elements/select-agent.html b/httemplate/elements/select-agent.html index 009cc6e06..54069a5cb 100644 --- a/httemplate/elements/select-agent.html +++ b/httemplate/elements/select-agent.html @@ -1,13 +1,7 @@ -<% - my( $agentnum, %opt ) = @_; - - $opt{'records'} = delete $opt{'agents'} - if $opt{'agents'}; - -%><%= include( '/elements/select-table.html', +<% include( '/elements/select-table.html', 'table' => 'agent', 'name_col' => 'agent', - 'value' => $agentnum, + 'value' => $agentnum || '', 'empty_label' => 'all', 'hashref' => { 'disabled' => '' }, 'extra_sql' => ' AND '. @@ -16,3 +10,12 @@ %opt, ) %> +<%init> + +my %opt = @_; +my $agentnum = $opt{'curr_value'} || $opt{'value'}; + +$opt{'records'} = delete $opt{'agents'} + if $opt{'agents'}; + +