[open-ils-commits] [GIT] Evergreen ILS branch master updated. 791613c5d92f50ff126949bbdc4d70f086397429
Evergreen Git
git at git.evergreen-ils.org
Wed Oct 11 11:50:50 EDT 2017
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 791613c5d92f50ff126949bbdc4d70f086397429 (commit)
from d1e679610e7911e5bad621098b0842d7d0b5a2cc (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 791613c5d92f50ff126949bbdc4d70f086397429
Author: Remington Steed <rjs7 at calvin.edu>
Date: Thu Oct 5 09:26:39 2017 -0400
LP#1721557 Fix Vandelay export within web client
Triggering a file download from dojo pages within the web client
requires a new technique. This commit borrows from the acq lineitem
table export (acq/common/li_table.js) and applies the technique to the
vandelay feature.
Signed-off-by: Remington Steed <rjs7 at calvin.edu>
Signed-off-by: Cesar Velez <cesar.velez at equinoxinitiative.org>
Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>
diff --git a/Open-ILS/src/templates/vandelay/vandelay.tt2 b/Open-ILS/src/templates/vandelay/vandelay.tt2
index 2002efc..9a7a72a 100644
--- a/Open-ILS/src/templates/vandelay/vandelay.tt2
+++ b/Open-ILS/src/templates/vandelay/vandelay.tt2
@@ -2,6 +2,7 @@
[% ctx.page_title = l('MARC Import/Export') %]
<script type="text/javascript" src='[% ctx.media_prefix %]/js/ui/default/vandelay/vandelay.js'> </script>
+<script type="text/javascript" src='[% ctx.media_prefix %]/js/file-saver/FileSaver.min.js'> </script>
<link rel='stylesheet' type='text/css' href='[% ctx.media_prefix %]/css/skin/[% ctx.skin %]/vandelay.css'/>
<link rel='stylesheet' type='text/css' href='[% ctx.media_prefix %]/css/theme/[% ctx.skin %]/vandelay.css'/>
diff --git a/Open-ILS/web/js/ui/default/vandelay/vandelay.js b/Open-ILS/web/js/ui/default/vandelay/vandelay.js
index 8726153..b60cab0 100644
--- a/Open-ILS/web/js/ui/default/vandelay/vandelay.js
+++ b/Open-ILS/web/js/ui/default/vandelay/vandelay.js
@@ -577,13 +577,24 @@ function vlExportRecordQueue(opts) {
req.onreadystatechange = function () {
if (req.readyState == 4) {
var file_tag = opts.nonimported ? '_nonimported' : '';
- openils.XUL.contentToFileSaveDialog(req.responseText, null, {
- defaultString : currentQueueName + file_tag + '.mrc',
- defaultExtension : '.mrc',
- filterName : 'MARC21',
- filterExtension : '*.mrc',
- filterAll : true
- } );
+ var filename = currentQueueName + file_tag + '.mrc';
+
+ try {
+ if (window.IAMBROWSER) {
+ var blob = new Blob([req.responseText], {type: "application/octet-stream"});
+ saveAs(blob, filename);
+ } else {
+ openils.XUL.contentToFileSaveDialog(req.responseText, null, {
+ defaultString : filename,
+ defaultExtension : '.mrc',
+ filterName : 'MARC21',
+ filterExtension : '*.mrc',
+ filterAll : true
+ } );
+ }
+ } catch (E) {
+ alert(E);
+ }
}
}
}
-----------------------------------------------------------------------
Summary of changes:
Open-ILS/src/templates/vandelay/vandelay.tt2 | 1 +
Open-ILS/web/js/ui/default/vandelay/vandelay.js | 25 ++++++++++++++++------
2 files changed, 19 insertions(+), 7 deletions(-)
hooks/post-receive
--
Evergreen ILS
More information about the open-ils-commits
mailing list