From c47123a101c99b35c3c7b1be5b003b773ae00e06 Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 29 Aug 2008 01:09:09 +0000 Subject: add CDR batch TFTP feature, RT#3113 --- httemplate/elements/select-cdrbatch.html | 38 ++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 httemplate/elements/select-cdrbatch.html (limited to 'httemplate/elements/select-cdrbatch.html') diff --git a/httemplate/elements/select-cdrbatch.html b/httemplate/elements/select-cdrbatch.html new file mode 100644 index 000000000..866ba2516 --- /dev/null +++ b/httemplate/elements/select-cdrbatch.html @@ -0,0 +1,38 @@ +% if ( scalar(@{ $opt{'cdrbatches'} }) ) { + + + +% } else { + + + +% } + +<%init> + +my %opt = @_; +my $selected_cdrbatch = $opt{'curr_value'}; # || $opt{'value'} necessary? + +my $conf = new FS::Conf; + +unless ( $opt{'cdrbatches'} ) { + + my $sth = dbh->prepare('SELECT DISTINCT cdrbatch FROM cdr') + or die dbh->errstr; + $sth->execute or die $sth->errstr; + my %cdrbatches = map { $_->[0] => 1 } @{$sth->fetchall_arrayref}; + @{ $opt{'cdrbatches'} } = grep $_, keys %cdrbatches; + +} + + + -- cgit v1.2.1