X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fsearch%2Felements%2Fsearch.html;h=5649c85790437d7095a010629310649ea531449c;hp=7b1a515dfa21df9fd77f41155a0593ca8ecc5b84;hb=948b8acdd4b9b3864342062d0c397a11f57c5700;hpb=76c7355b1f97f99b5a3f673cf72429761924ee31 diff --git a/httemplate/search/elements/search.html b/httemplate/search/elements/search.html index 7b1a515df..5649c8579 100644 --- a/httemplate/search/elements/search.html +++ b/httemplate/search/elements/search.html @@ -45,7 +45,7 @@ Example: #required unless 'query' is an SQL query string (shouldn't be...) 'count_query' => 'SELECT COUNT(*) FROM tablename', - 'count_addl' => [], #additional count fields listref of sprintf strings + 'count_addl' => [], #additional count fields listref of sprintf strings or coderefs # [ $money_char.'%.2f total paid', ], #listref of column labels, @@ -313,8 +313,14 @@ Example:
% if ( $opt{'count_addl'} ) { -% my $n=0; foreach my $count ( @{$opt{'count_addl'}} ) { - <% sprintf( $count, $count_arrayref->[++$n] ) %>
+% my $n=0; +% foreach my $count ( @{$opt{'count_addl'}} ) { +% my $data = $count_arrayref->[++$n]; +% if ( ref($count) ) { + <% &{ $count }( $data ) %> +% } else { + <% sprintf( $count, $data ) %>
+% } % } % }