[freeside-commits] freeside/httemplate/search/elements search.html, 1.31, 1.32

Ivan,,, ivan at wavetail.420.am
Tue Dec 4 12:51:54 PST 2007


Update of /home/cvs/cvsroot/freeside/httemplate/search/elements
In directory wavetail:/tmp/cvs-serv25475/httemplate/search/elements

Modified Files:
	search.html 
Log Message:
add some time-worked reporting

Index: search.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/search/elements/search.html,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -d -r1.31 -r1.32
--- search.html	26 Nov 2007 02:19:49 -0000	1.31
+++ search.html	4 Dec 2007 20:51:51 -0000	1.32
@@ -45,7 +45,7 @@
     #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, <TH>
@@ -313,8 +313,14 @@
                 <BR>
 
 %               if ( $opt{'count_addl'} ) { 
-%                 my $n=0; foreach my $count ( @{$opt{'count_addl'}} ) { 
-                    <% sprintf( $count, $count_arrayref->[++$n] ) %><BR>
+%                 my $n=0;
+%                 foreach my $count ( @{$opt{'count_addl'}} ) { 
+%                   my $data = $count_arrayref->[++$n];
+%                   if ( ref($count) ) {
+                      <% &{ $count }( $data ) %>
+%                   } else {
+                      <% sprintf( $count, $data ) %><BR>
+%                   }
 %                 } 
 %               } 
               </FORM>



More information about the freeside-commits mailing list