diff options
author | ivan <ivan> | 2005-07-14 10:52:46 +0000 |
---|---|---|
committer | ivan <ivan> | 2005-07-14 10:52:46 +0000 |
commit | 08662d58e7b9a13cf841e9c89daa39b28655724e (patch) | |
tree | bb6415dcfc8c94a30639c8a913051a38c31780ad /httemplate/search/elements | |
parent | c91e5cd4ce307d5f3573ea309cbcf03186ea3de4 (diff) |
move account search (httemplate/search/svc_acct.cgi) to new template, cust-fields configuration value to control which customer fields are shown on reports
Diffstat (limited to 'httemplate/search/elements')
-rw-r--r-- | httemplate/search/elements/search.html | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/httemplate/search/elements/search.html b/httemplate/search/elements/search.html index 47d619444..78754fe00 100644 --- a/httemplate/search/elements/search.html +++ b/httemplate/search/elements/search.html @@ -152,7 +152,9 @@ # } #} if ( ref($field) eq 'CODE' ) { - $worksheet->write($r, $c++, &{$field}($row) ); + foreach my $value ( &{$field}($row) ) { + $worksheet->write($r, $c++, $value ); + } } else { $worksheet->write($r, $c++, $row->$field() ); } @@ -253,7 +255,18 @@ my $sizes = $opt{'size'} ? [ @{$opt{'size'}} ] : []; my $styles = $opt{'style'} ? [ @{$opt{'style'}} ] : []; - foreach my $field ( @{$opt{'fields'}} ) { + foreach my $field ( + + map { + if ( ref($_) eq 'CODE' ) { + &{$_}($row); + } else { + $row->$_(); + } + } + @{$opt{'fields'}} + + ) { my $align = $aligns ? shift @$aligns : ''; $align = " ALIGN=$align" if $align; @@ -294,11 +307,7 @@ } %> - <% if ( ref($field) eq 'CODE' ) { %> - <TD CLASS="grid" BGCOLOR="<%= $bgcolor %>"<%= $align %>><%= $font %><%= $a %><%= $s %><%= &{$field}($row) %><%= $es %><%= $a ? '</A>' : '' %><%= $font ? '</FONT>' : '' %></TD> - <% } else { %> - <TD CLASS="grid" BGCOLOR="<%= $bgcolor %>"<%= $align %>><%= $font %><%= $a %><%= $s %><%= $row->$field() %><%= $es %><%= $a ? '</A>' : '' %><%= $font ? '</FONT>' : '' %></TD> - <% } %> + <TD CLASS="grid" BGCOLOR="<%= $bgcolor %>"<%= $align %>><%= $font %><%= $a %><%= $s %><%= $field %><%= $es %><%= $a ? '</A>' : '' %><%= $font ? '</FONT>' : '' %></TD> <% } %> <% } else { %> <% foreach ( @$row ) { %> |