-%
-% my( $agentnum, %opt ) = @_;
-%
-% $opt{'records'} = delete $opt{'agents'}
-% if $opt{'agents'};
-%
-%
-<% include( '/elements/select-table.html',
- 'table' => 'agent',
- 'name_col' => 'agent',
- 'value' => $agentnum,
- 'empty_label' => 'all',
- 'hashref' => { 'disabled' => '' },
- 'extra_sql' => ' AND '.
- $FS::CurrentUser::CurrentUser->agentnums_sql.
- ' 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,