summaryrefslogtreecommitdiff
path: root/httemplate/elements/select-agent.html
blob: fd2c57eaccb6362337a62c878cc2da38fb551e2f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<& /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 = @_;
my $agentnum = $opt{'curr_value'} || $opt{'value'};

$opt{'records'} = delete $opt{'agents'}
  if $opt{'agents'};

my $curuser = $FS::CurrentUser::CurrentUser;
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>