[open-ils-commits] [GIT] Evergreen ILS branch master updated. 0cceaa8c24d18b8e2d3691049eef97ae3f373ca6

Evergreen Git git at git.evergreen-ils.org
Wed Oct 12 23:21:34 EDT 2011


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, master has been updated
       via  0cceaa8c24d18b8e2d3691049eef97ae3f373ca6 (commit)
      from  4d6da36ad97c638af7aef89734dc9cb90e3c1020 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 0cceaa8c24d18b8e2d3691049eef97ae3f373ca6
Author: Lebbeous Fogle-Weekley <lebbeous at esilibrary.com>
Date:   Wed Oct 12 14:04:01 2011 -0400

    TPac: One prefers to download CSV, not to display it
    
    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 at esilibrary.com>
    Signed-off-by: Dan Scott <dscott at laurentian.ca>

diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm
index b63f89a..9952c8c 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm
@@ -1626,6 +1626,15 @@ sub load_myopac_bookbag_print {
         );
     }
 
+    # 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;
 }
 
diff --git a/Open-ILS/src/templates/opac/myopac/lists.tt2 b/Open-ILS/src/templates/opac/myopac/lists.tt2
index 863bb1a..5615fa9 100644
--- a/Open-ILS/src/templates/opac/myopac/lists.tt2
+++ b/Open-ILS/src/templates/opac/myopac/lists.tt2
@@ -99,7 +99,7 @@
                         <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 %]" />

-----------------------------------------------------------------------

Summary of changes:
 .../lib/OpenILS/WWW/EGCatLoader/Account.pm         |    9 +++++++++
 Open-ILS/src/templates/opac/myopac/lists.tt2       |    2 +-
 2 files changed, 10 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list