projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
use stored card type for payment search, #71291
[freeside.git]
/
httemplate
/
search
/
elements
/
search-csv.html
diff --git
a/httemplate/search/elements/search-csv.html
b/httemplate/search/elements/search-csv.html
index
2182270
..
90230e6
100644
(file)
--- a/
httemplate/search/elements/search-csv.html
+++ b/
httemplate/search/elements/search-csv.html
@@
-27,10
+27,21
@@
% $csv->combine(@$row); #or die $csv->status;
% }
%
% $csv->combine(@$row); #or die $csv->status;
% }
%
-%
<% $csv->string %>\
%
% }
<% $csv->string %>\
%
% }
+%
+% if ( $opt{'footer'} and !$opt{'no_csv_header'} ) {
+% my @footer;
+% foreach my $item (@{ $opt{'footer'} }) {
+% if ( ref($item) eq 'CODE' ) {
+% $item = &{$item}();
+% }
+% push @footer, $item;
+% }
+% $csv->combine(@footer);
+<% $csv->string %>\
+% }
<%init>
my %args = @_;
<%init>
my %args = @_;
@@
-39,7
+50,10
@@
my $rows = $args{'rows'};
my %opt = %{ $args{'opt'} };
#http_header('Content-Type' => 'text/comma-separated-values' ); #IE chokes
my %opt = %{ $args{'opt'} };
#http_header('Content-Type' => 'text/comma-separated-values' ); #IE chokes
-http_header('Content-Type' => 'text/plain' );
+#http_header('Content-Type' => 'text/plain' );
+http_header('Content-Type' => 'text/csv' ); # So saith RFC 4180
+http_header('Content-Disposition' =>
+ 'attachment;filename="'.($opt{'name'} || PL($opt{'name_singular'}) ).'.csv"');
my $quote_char = '"';
$quote_char = $opt{csv_quote} if exists($opt{csv_quote});
my $quote_char = '"';
$quote_char = $opt{csv_quote} if exists($opt{csv_quote});