For the "Download CSV" operation in the TPac "My Lists" interface,
provoke the user's browser to download the file, rather than displaying
the file in a new tab/window.
Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
);
}
+ # Create a reasonable filename and set the content disposition to
+ # provoke browser download dialogs.
+ (my $filename = $bbag->id . $bbag->name) =~ s/[^a-z0-9_ -]//gi;
+
+ $self->apache->headers_out->add(
+ "Content-Disposition",
+ "attachment;filename=$filename.csv"
+ );
+
return Apache2::Const::OK;
}
<input type="submit" value="[% l('Delete List') %]" />
</div>
</form>
- <form action="[% ctx.opac_root %]/myopac/list/print" method="POST" target="_blank">
+ <form action="[% ctx.opac_root %]/myopac/list/print" method="POST">
<div class="bookbag-controls">
<input type="hidden" name="list" value="[% bbag.id %]" />
<input type="hidden" name="sort" value="[% CGI.param('sort') | html %]" />