clean up select-agent agent virtualization, RT#1405
[freeside.git] / httemplate / elements / select-agent.html
1 <% include( '/elements/select-table.html',
2                  'table'         => 'agent',
3                  'name_col'      => 'agent',
4                  'value'         => $agentnum || '',
5                  'agent_virt'    => 1,
6                  'empty_label'   => 'all',
7                  'hashref'       => { 'disabled' => '' },
8                  'order_by'      => ' ORDER BY agent',
9                  'disable_empty' => $disable_empty,
10                  %opt,
11              )
12 %>
13 <%init>
14
15 my %opt = @_;
16 my $agentnum = $opt{'curr_value'} || $opt{'value'};
17
18 $opt{'records'} = delete $opt{'agents'}
19   if $opt{'agents'};
20
21 my $curuser = $FS::CurrentUser::CurrentUser;
22 my $disable_empty = 0;
23 if ( $opt{'agent_null_right'} ) {
24   if ( $curuser->access_right($opt{'agent_null_right'}) ) {
25     $disable_empty = 0;
26   } else {
27     $disable_empty = 1;
28   }
29 }
30
31 </%init>