X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Felements%2Fselect-agent.html;h=2bd0095dabdbbca8308520ded79fdc9e108f58fb;hp=d8ab50080964601bfc33a441f13413996a50cdd2;hb=7b0bbc4117a7959b9f7b7b2cf999b8188ba34160;hpb=a1871d3d13c1dafa93b956762c0d23728d261da7 diff --git a/httemplate/elements/select-agent.html b/httemplate/elements/select-agent.html index d8ab50080..2bd0095da 100644 --- a/httemplate/elements/select-agent.html +++ b/httemplate/elements/select-agent.html @@ -1,14 +1,14 @@ -<% include( '/elements/select-table.html', - 'table' => 'agent', - 'name_col' => 'agent', - 'value' => $agentnum || '', - 'empty_label' => 'all', - 'hashref' => { 'disabled' => '' }, - 'order_by' => ' ORDER BY agent', +<& /elements/select-table.html, + 'table' => 'agent', + 'name_col' => 'agent', + 'value' => $agentnum || '', + 'agent_virt' => 1, + 'empty_label' => $empty_label, + 'hashref' => { 'disabled' => '' }, + 'order_by' => ' ORDER BY agent', 'disable_empty' => $disable_empty, %opt, - ) -%> +&> <%init> my %opt = @_; @@ -18,12 +18,14 @@ $opt{'records'} = delete $opt{'agents'} if $opt{'agents'}; my $curuser = $FS::CurrentUser::CurrentUser; -my $disable_empty = 1; -if ( $opt{'agent_null_right'} && - $curuser->access_right($opt{'agent_null_right'}) - ) -{ - $disable_empty--; +my $empty_label = $opt{'empty_label'} ? $opt{'empty_label'} : 'all'; +my $disable_empty = 0; +if ( $opt{'agent_null_right'} ) { + if ( $curuser->access_right($opt{'agent_null_right'}) ) { + $disable_empty = 0; + } else { + $disable_empty = 1; + } }