summaryrefslogtreecommitdiff
path: root/httemplate/elements/tr-select-agent.html
blob: fcfa9f300074bb9ec820c34066d6a0d28cf5b3c5 (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
31
32
33
% if ( scalar(@agents) == 1 ) { 

  <INPUT TYPE="hidden" NAME="<% $opt{'field'} || 'agentnum' %>" VALUE="<% $agents[0]->agentnum %>">

%# YUCK.  empty row so we don't throw g_row in edit.html off :/
  <TR>
  </TR>
% } else { 

  <TR>
    <TD ALIGN="right"><% $opt{'label'} || 'Agent' %></TD>
    <TD>
      <% include( '/elements/select-agent.html',
                     'curr_value' => $agentnum,
                     'agents'     => \@agents,
                     %opt,
                 )
      %>
    </TD>
  </TR>

% } 

<%init>

my %opt = @_;
my $agentnum = $opt{'curr_value'} || $opt{'value'};

my @agents = $opt{'agents'}
               ? @{ $opt{'agents'} }
               : $FS::CurrentUser::CurrentUser->agents;

</%init>