diff options
author | ivan <ivan> | 2008-08-29 01:09:09 +0000 |
---|---|---|
committer | ivan <ivan> | 2008-08-29 01:09:09 +0000 |
commit | c47123a101c99b35c3c7b1be5b003b773ae00e06 (patch) | |
tree | abecb0c0da3a7b65ce5d787960a852c5cb05fbad /httemplate/elements/tr-select-cdrbatch.html | |
parent | d7b220cb7443a6d55723e4b5b9d483504efe9250 (diff) |
add CDR batch TFTP feature, RT#3113
Diffstat (limited to 'httemplate/elements/tr-select-cdrbatch.html')
-rw-r--r-- | httemplate/elements/tr-select-cdrbatch.html | 32 |
1 files changed, 32 insertions, 0 deletions
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'} }) ) { + + <INPUT TYPE="hidden" NAME="<% $opt{'element_name'} || $opt{'field'} || 'cdrbatch' %>" VALUE="<% $selected_cdrbatch %>"> + +% } else { + + <TR> + <TD ALIGN="right"><% $opt{'cdrbatch'} || 'CDR Batch: ' %></TD> + <TD> + <% include( '/elements/select-cdrbatch.html', 'curr_value' => $selected_cdrbatch, %opt ) %> + </TD> + </TR> + +% } +<%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; + +} + +</%init> + |