-<% 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' => emt('all'),
+ 'hashref' => { 'disabled' => '' },
+ 'order_by' => ' ORDER BY agent',
'disable_empty' => $disable_empty,
%opt,
- )
-%>
+&>
<%init>
my %opt = @_;
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 $disable_empty = 0;
+if ( $opt{'agent_null_right'} ) {
+ if ( $curuser->access_right($opt{'agent_null_right'}) ) {
+ $disable_empty = 0;
+ } else {
+ $disable_empty = 1;
+ }
}
</%init>