default to a session cookie instead of setting an explicit timeout, weird timezone...
[freeside.git] / httemplate / elements / select-agent.html
1 <& /elements/select-table.html,
2                  'table'         => 'agent',
3                  'name_col'      => 'agent',
4                  'value'         => $agentnum || '',
5                  'agent_virt'    => 1,
6                  'empty_label'   => $empty_label,
7                  'hashref'       => { 'disabled' => '' },
8                  'order_by'      => ' ORDER BY agent',
9                  'disable_empty' => $disable_empty,
10                  %opt,
11 &>
12 <%init>
13
14 my %opt = @_;
15 my $agentnum = $opt{'curr_value'} || $opt{'value'};
16
17 $opt{'records'} = delete $opt{'agents'}
18   if $opt{'agents'};
19
20 my $curuser = $FS::CurrentUser::CurrentUser;
21 my $empty_label = $opt{'empty_label'} ? $opt{'empty_label'} : 'all';
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>