From: ivan Date: Fri, 29 May 2009 23:36:14 +0000 (+0000) Subject: slightly better labels and field order for CDR report, RT#4081 X-Git-Tag: root_of_svc_elec_features~1162 X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=be5ca902476e66c87bbcb6c77aaf02ffc4cd7c08 slightly better labels and field order for CDR report, RT#4081 --- diff --git a/httemplate/search/cdr.html b/httemplate/search/cdr.html index 852eebadb..cef8ec016 100644 --- a/httemplate/search/cdr.html +++ b/httemplate/search/cdr.html @@ -10,7 +10,7 @@ 'count_query' => $count_query, 'header' => [ '', # checkbox column - fields('cdr'), #XXX fill in some nice names + @header, ], 'fields' => [ sub { @@ -20,7 +20,7 @@ my $acctid = $cdr->acctid; qq!!; }, - fields('cdr'), #XXX fill in some pretty-print + @fields, #XXX fill in some pretty-print #processing, etc. ], @@ -156,4 +156,36 @@ my $qsearch = join(' AND ', @qsearch); $qsearch = ( scalar(keys %$hashref) ? ' AND ' : ' WHERE ' ) . $qsearch if $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 @first = qw( acctid calldate clid charged_party src dst dcontext ); +my %first = map { $_=>1 } @first; + +my @fields = ( @first, grep !$first{$_}, fields('cdr') ); + +my @header = map { + if ( exists($header{$_}) ) { + $header{$_}; + } else { + my $header = $_; + $header =~ s/\_/ /g; + ucfirst($header); + } + } @fields; +