summaryrefslogtreecommitdiff
path: root/httemplate/elements/select-otaker.html
blob: 660566565a9cfb2aa11cee5d4903af961f22b715 (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
<SELECT NAME="otaker">

% unless ( $opt{'multiple'} || $opt{'disable_empty'} ) {
  <OPTION VALUE=""><% mt('all') |h %></OPTION>
% }

% foreach my $otaker ( @{ $opt{'otakers'} } ) { 
    <OPTION VALUE="<% $otaker %>"><% $otaker %></OPTION>
% } 

</SELECT>

<%init>

my %opt = @_;

unless ( $opt{'otakers'} ) {

  my $sth = dbh->prepare("SELECT username FROM access_user".
                       " WHERE disabled = '' or disabled IS NULL")
    or die dbh->errstr;
  $sth->execute or die $sth->errstr;
  $opt{'otakers'} = [ map { $_->[0] } @{$sth->fetchall_arrayref} ];

}

</%init>