summaryrefslogtreecommitdiff
path: root/httemplate/elements/tr-select-agent.html
blob: 2227262b6cc389a0d53382a55ed3e8579be28da7 (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
<%
  my( $agentnum, %opt ) = @_;

  my @agents;
  if ( $opt{'agents'} ) {
    @agents = @{ $opt{'agents'} };
  } else {
    @agents = qsearch( 'agent', { disabled=>'' } );
  }

%>

<% if ( scalar(@agents) == 1 ) { %>

  <INPUT TYPE="hidden" NAME="agentnum" VALUE="<%= $agents[0]->agentnum %>">

<% } else { %>

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

<% } %>