[freeside-commits] freeside/httemplate/search cdr.html,1.16,1.17
Ivan,,,
ivan at wavetail.420.am
Sun Jul 5 16:17:33 PDT 2009
Update of /home/cvs/cvsroot/freeside/httemplate/search
In directory wavetail.420.am:/tmp/cvs-serv17933
Modified Files:
cdr.html
Log Message:
format start/answer/end dates and link svcnum to service
Index: cdr.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/search/cdr.html,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- cdr.html 5 Jul 2009 21:35:52 -0000 1.16
+++ cdr.html 5 Jul 2009 23:17:31 -0000 1.17
@@ -23,6 +23,7 @@
@fields, #XXX fill in some pretty-print
#processing, etc.
],
+ 'links' => \@links,
'html_form' => qq!<FORM NAME="cdrForm" ACTION="$p/misc/cdr.cgi" METHOD="POST">!,
#false laziness w/queue.html
@@ -225,9 +226,33 @@
$header{$_};
} else {
my $header = $_;
- $header =~ s/\_/ /g;
+ $header =~ s/\_/ /g; #//wtf
ucfirst($header);
}
} @fields;
+my $date_sub_factory = sub {
+ my $column = shift;
+ sub {
+ #my $cdr = shift;
+ my $date = shift->$column();
+ $date ? time2str( '%Y-%m-%d %T', $date ) : ''; #config time2str format?
+ };
+};
+
+my %fields = (
+ #any other formatters?
+ map { $_ => &{ $date_sub_factory }($_) } qw( startdate answerdate enddate )
+);
+
+my %links = (
+ 'svcnum' =>
+ sub { $_[0]->svcnum ? [ $p.'view/svc_phone.cgi?', 'svcnum' ] : ''; },
+);
+
+ at fields = map { exists($fields{$_}) ? $fields{$_} : $_ } @fields;
+
+ #checkbox column
+my @links = ( '', map { exists($links{$_}) ? $links{$_} : '' } @fields );
+
</%init>
More information about the freeside-commits
mailing list