diff options
author | ivan <ivan> | 2009-11-19 09:47:02 +0000 |
---|---|---|
committer | ivan <ivan> | 2009-11-19 09:47:02 +0000 |
commit | 457cf05ffc31212de613249c95a8ab05aed34f47 (patch) | |
tree | 0ce85765bb021c52d3c3b572a68afc49879c1a57 /httemplate/search | |
parent | 8efd6f2dd2b81f42fdd573c3a194dd0eb6e28206 (diff) |
proper cdr_batch table, RT#6386
Diffstat (limited to 'httemplate/search')
-rw-r--r-- | httemplate/search/cdr.html | 26 | ||||
-rw-r--r-- | httemplate/search/report_cdr.html | 2 |
2 files changed, 20 insertions, 8 deletions
diff --git a/httemplate/search/cdr.html b/httemplate/search/cdr.html index d1f68c5c6..cfbc5ed5d 100644 --- a/httemplate/search/cdr.html +++ b/httemplate/search/cdr.html @@ -179,18 +179,30 @@ if ( $cgi->param('charged_party') =~ /^\s*([\d\-\+\ ]+)\s*$/ ) { } ### -# cdrbatch +# cdrbatchnum (or legacy cdrbatch) ### -if ( $cgi->param('cdrbatch') ne '__ALL__' ) { - if ( $cgi->param('cdrbatch') eq '' ) { - my $search = "( cdrbatch IS NULL OR cdrbatch = '' )"; +if ( $cgi->param('cdrbatch') ) { + + my $cdr_batch = + qsearchs('cdr_batch', { 'cdrbatch' => scalar($cgi->param('cdrbatch')) } ); + if ( $cdr_batch ) { + push @search, 'cdrbatchnum = '. $cdr_batch->cdrbatchnum; + } else { + die "unknown cdrbatch ". $cgi->param('cdrbatch'); + } + +} elsif ( $cgi->param('cdrbatchnum') ne '__ALL__' ) { + + if ( $cgi->param('cdrbatchnum') eq '' ) { + my $search = "( cdrbatchnum IS NULL )"; push @qsearch, $search; push @search, $search; - } else { - $hashref->{cdrbatch} = $cgi->param('cdrbatch'); - push @search, 'cdrbatch = '. dbh->quote($cgi->param('cdrbatch')); + } elsif ( $cgi->param('cdrbatchnum') =~ /^(\d+)$/ ) { + $hashref->{cdrbatchnum} = $1; + push @search, "cdrbatchnum = $1"; } + } ### diff --git a/httemplate/search/report_cdr.html b/httemplate/search/report_cdr.html index c685198d9..744038d12 100644 --- a/httemplate/search/report_cdr.html +++ b/httemplate/search/report_cdr.html @@ -132,7 +132,7 @@ my @show_default = qw( startdate answerdate enddate duration billsec disposition amaflags accountcode userfield rated_price upstream_price carrierid - svcnum freesidestatus freesiderewritestatus cdrbatch + svcnum freesidestatus freesiderewritestatus ); my %show_default = map { $_=>1 } @show_default; |