1 % if ( ! scalar(@{ $opt{'cdrbatches'} }) ) {
3 <INPUT TYPE="hidden" NAME="<% $opt{'element_name'} || $opt{'field'} || 'cdrbatch' %>" VALUE="<% $selected_cdrbatch %>">
8 <TD ALIGN="right"><% $opt{'cdrbatch'} || 'CDR Batch: ' %></TD>
10 <% include( '/elements/select-cdrbatch.html', 'curr_value' => $selected_cdrbatch, %opt ) %>
18 my $conf = new FS::Conf;
19 my $selected_cdrbatch = $opt{'curr_value'}; # || $opt{'value'} necessary?
21 unless ( $opt{'cdrbatches'} ) {
23 my $sth = dbh->prepare('SELECT cdrbatch FROM cdr')
25 $sth->execute or die $sth->errstr;
26 my %cdrbatches = map { $_->[0] => 1 } @{$sth->fetchall_arrayref};
27 @{ $opt{'cdrbatches'} } = grep $_, keys %cdrbatches;