diff options
| author | ivan <ivan> | 2009-07-05 21:35:52 +0000 |
|---|---|---|
| committer | ivan <ivan> | 2009-07-05 21:35:52 +0000 |
| commit | 0ce1ba66efbd074aca5182bb3e42bd99ff55472a (patch) | |
| tree | 596f309179d1c6c502ffb9bc2adb3bb8e310c7ea /httemplate/search/cdr.html | |
| parent | 15c8b0fd8580afcd9c10d5816cbae43996c02ec0 (diff) | |
CDR search by dcontext, charged_party, toggle of display fields, RT#4081
Diffstat (limited to 'httemplate/search/cdr.html')
| -rw-r--r-- | httemplate/search/cdr.html | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/httemplate/search/cdr.html b/httemplate/search/cdr.html index 26eac75b3..126c4fd43 100644 --- a/httemplate/search/cdr.html +++ b/httemplate/search/cdr.html @@ -158,6 +158,12 @@ if ( $cgi->param('dst') =~ /^\s*([\d\-\+ ]+)\s*$/ ) { push @search, "dst = '$dst'"; } +if ( $cgi->param('dcontext') =~ /^\s*(.+)\s*$/ ) { + my $dcontext = $1; + $hashref->{'dcontext'} = $dcontext; + push @search, "dcontext = '$dcontext'"; +} + if ( $cgi->param('charged_party') =~ /^\s*([\d\-\+\ ]+)\s*$/ ) { ( my $charged_party = $1 ) =~ s/\D//g; #$hashref->{'charged_party'} = $charged_party; @@ -203,24 +209,17 @@ $qsearch = ( scalar(keys %$hashref) ? ' AND ' : ' WHERE ' ) . $qsearch # display fields ### -#XXX fill in some (more) nice names -my %header = ( - 'calldate' => 'Call Date', - 'clid' => 'Caller ID', - 'charged_party' => 'Charged party', - 'src' => 'Source', - 'dst' => 'Destination', - 'dcontext' => 'Destination Context', - 'channel' => 'Channel', - 'dstchannel' => 'Destination Channel', - 'freesidestatus' => 'Freeside status', -); +my %header = %{ FS::cdr->table_info->{'fields'} }; my @first = qw( acctid calldate clid charged_party src dst dcontext ); my %first = map { $_=>1 } @first; my @fields = ( @first, grep !$first{$_}, fields('cdr') ); +if ( $cgi->param('show') ) { + @fields = grep $cgi->param("show_$_"), @fields; +} + my @header = map { if ( exists($header{$_}) ) { $header{$_}; |
