X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fsearch%2Felements%2Fsearch-xml.html;h=18bfe8d82dc81d4649e64a0ba281957ead6d1f7d;hb=3f2a7b01b59902faed5767d81e2959e131bdbdfd;hp=9f5e9b6c173d69d92be3d6b99b722868b00d8e23;hpb=4ef5b3b917b7802a136551ad567dc9d649700f53;p=freeside.git diff --git a/httemplate/search/elements/search-xml.html b/httemplate/search/elements/search-xml.html index 9f5e9b6c1..18bfe8d82 100644 --- a/httemplate/search/elements/search-xml.html +++ b/httemplate/search/elements/search-xml.html @@ -14,6 +14,7 @@ % } else { % $value = $row->$field(); % } +% next unless ($value || !$opt{xml_omit_empty}); % <% &{$beginfield}($row, $i) %><% $value |h %><% &{$endfield}($row, $i) %> % @@ -31,9 +32,11 @@ my $header = $args{'header'}; my $rows = $args{'rows'}; my %opt = %{ $args{'opt'} }; +my $filename = $opt{'filename'} || + ($opt{'name'} || PL($opt{'name_singular'}) . 'xml'); + http_header('Content-Type' => 'application/XML' ); # So saith RFC 4180 -http_header('Content-Disposition' => - 'attachment;filename="'.($opt{'name'} || PL($opt{'name_singular'}) ).'.xml"'); +http_header('Content-Disposition' => 'attachment;filename="'.$filename.'"'); unless ( $opt{'fields'} ) { foreach my $i ( 0 .. ( $#{ @$rows[0] } ) ) {