summaryrefslogtreecommitdiff
path: root/httemplate/elements/tr-select-multiple-contact_class.html
blob: 5de12932487c11fce6e588da5dfebddc17fe08e4 (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
<%doc>

  Displays Contact Types as a multi-select box.

  If no non-disabled Contact Types have been defined in contact_class table,
  renders a hidden input field with a blank value.

</%doc>

% if ($has_types) {
<TR>
  <TD ALIGN="right"><% $opt{'label'} || emt('Contact Type') %></TD>
  <TD>
    <% include( '/elements/select-multiple-contact_class.html', %opt ) %>
  </TD>
</TR>
% } else {
<INPUT TYPE="hidden" NAME="<% $opt{field} %>" VALUE="">
% }

<%init>

my %opt = @_;
$opt{field} ||= $opt{element_name} ||= 'classnum';

my $has_types =()= qsearch({
  table     => 'contact_class',
  hashref   => { disabled => '' },
  extra_sql => ' LIMIT 1 ',
});

</%init>