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/tr-select-cdrbatch.html | 32 +++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 httemplate/elements/tr-select-cdrbatch.html (limited to 'httemplate/elements/tr-select-cdrbatch.html') diff --git a/httemplate/elements/tr-select-cdrbatch.html b/httemplate/elements/tr-select-cdrbatch.html new file mode 100644 index 000000000..21cd00462 --- /dev/null +++ b/httemplate/elements/tr-select-cdrbatch.html @@ -0,0 +1,32 @@ +% if ( ! scalar(@{ $opt{'cdrbatches'} }) ) { + + + +% } else { + + + <% $opt{'cdrbatch'} || 'CDR Batch: ' %> + + <% include( '/elements/select-cdrbatch.html', 'curr_value' => $selected_cdrbatch, %opt ) %> + + + +% } +<%init> + +my( %opt ) = @_; +my $conf = new FS::Conf; +my $selected_cdrbatch = $opt{'curr_value'}; # || $opt{'value'} necessary? + +unless ( $opt{'cdrbatches'} ) { + + my $sth = dbh->prepare('SELECT 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