X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fsearch%2Fcdr.html;h=852eebadbe8abc6020239c4eb34f1551e22838d4;hb=7bc780834a604a2e678d028f875fd4b546412cfb;hp=4bac8c1f9d35f5a6fdd712f7499e938fa5cbeaf4;hpb=1203e278e2ec38fcf1468da2e4f10862004bebeb;p=freeside.git diff --git a/httemplate/search/cdr.html b/httemplate/search/cdr.html index 4bac8c1f9..852eebadb 100644 --- a/httemplate/search/cdr.html +++ b/httemplate/search/cdr.html @@ -1,15 +1,50 @@ <% include( 'elements/search.html', 'title' => $title, 'name' => 'call detail records', + 'query' => { 'table' => 'cdr', 'hashref' => $hashref, 'extra_sql' => $qsearch, 'order_by' => 'ORDER BY calldate', }, 'count_query' => $count_query, - 'header' => [ fields('cdr') ], #XXX fill in some nice names - 'fields' => [ fields('cdr') ], #XXX fill in some pretty-print - # processing, etc. + 'header' => [ + '', # checkbox column + fields('cdr'), #XXX fill in some nice names + ], + 'fields' => [ + sub { + return '' unless $edit_data; + $areboxes = 1; + my $cdr = shift; + my $acctid = $cdr->acctid; + qq!!; + }, + fields('cdr'), #XXX fill in some pretty-print + #processing, etc. + ], + + 'html_form' => qq!
!, + #false laziness w/queue.html + 'html_foot' => sub { + if ( $areboxes ) { + '
'. + ''. + qq!
!. + qq!
!. + ''; + } else { + ''; + } + }, + ) %> <%init> @@ -17,6 +52,10 @@ die "access denied" unless $FS::CurrentUser::CurrentUser->access_right('List rating data'); +my $edit_data = $FS::CurrentUser::CurrentUser->access_right('Edit rating data'); + +my $areboxes = 0; + my $title = 'Call Detail Records'; my $hashref = {}; @@ -89,6 +128,20 @@ if ( $cgi->param('charged_party') =~ /^\s*([\d\-\+\ ]+)\s*$/ ) { OR charged_party = '1$charged_party' ) "; } +### +# cdrbatch +### + +if ( $cgi->param('cdrbatch') ne '__ALL__' ) { + if ( $cgi->param('cdrbatch') eq '' ) { + my $search = "( cdrbatch IS NULL OR cdrbatch = '' )"; + push @qsearch, $search; + push @search, $search; + } else { + $hashref->{cdrbatch} = $cgi->param('cdrbatch'); + push @search, 'cdrbatch = '. dbh->quote($cgi->param('cdrbatch')); + } +} ### # finish it up