summaryrefslogtreecommitdiff
path: root/httemplate/search/cdr.html
diff options
context:
space:
mode:
authorivan <ivan>2009-05-29 23:36:14 +0000
committerivan <ivan>2009-05-29 23:36:14 +0000
commitbe5ca902476e66c87bbcb6c77aaf02ffc4cd7c08 (patch)
tree32ead9813a9b4915713270483906e0affd9beafb /httemplate/search/cdr.html
parentdeba223d89f516851d24d535d785cc2b39b7784c (diff)
slightly better labels and field order for CDR report, RT#4081
Diffstat (limited to 'httemplate/search/cdr.html')
-rw-r--r--httemplate/search/cdr.html36
1 files changed, 34 insertions, 2 deletions
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!<INPUT NAME="acctid$acctid" TYPE="checkbox" VALUE="1">!;
},
- 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;
+
</%init>