From 57692a847e30c2a95c568f2b15ed0cc6669a392c Mon Sep 17 00:00:00 2001 From: berick Date: Fri, 6 May 2011 15:37:32 -0400 Subject: [PATCH] initial export drop-down for items UI --- Open-ILS/web/js/ui/default/vandelay/vandelay.js | 31 +++++++++++++++++++++- .../default/vandelay/inc/import_errors.tt2 | 9 +++++++ 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/Open-ILS/web/js/ui/default/vandelay/vandelay.js b/Open-ILS/web/js/ui/default/vandelay/vandelay.js index 193056cc32..d2405cce6e 100644 --- a/Open-ILS/web/js/ui/default/vandelay/vandelay.js +++ b/Open-ILS/web/js/ui/default/vandelay/vandelay.js @@ -377,6 +377,8 @@ function processSpool(key, queueId, type, onload) { } function vlExportInit() { + + // queue export var qsel = dojo.byId('vl-queue-export-options'); qsel.onchange = function(newVal) { var value = qsel.options[qsel.selectedIndex].value; @@ -386,10 +388,37 @@ function vlExportInit() { retrieveQueuedRecords( currentType, currentQueueId, - function(r) { exportHandler(value, r) }, + function(r) { + exportHandler(value, r); + displayGlobalDiv('vl-queue-div'); + }, value ); } + + // item export + var isel = dojo.byId('vl-item-export-options'); + isel.onchange = function(newVal) { + var value = isel.options[isel.selectedIndex].value; + isel.selectedIndex = 0; + if(!value) return; + if(!confirm('Export as "' + value + '"?')) return; // TODO: i18n + + var method = 'open-ils.vandelay.import_item.queue.export.' + value; + + fieldmapper.standardRequest( + ['open-ils.vandelay', method], + { + params : [ + authtoken, + currentQueueId, + {with_import_error: (vlImportItemsShowErrors.checked) ? 1 : null} + ], + async : true, + oncomplete : function(r) {exportHandler(type, r)} + } + ); + } } function exportHandler(type, response) { diff --git a/Open-ILS/web/templates/default/vandelay/inc/import_errors.tt2 b/Open-ILS/web/templates/default/vandelay/inc/import_errors.tt2 index f72630bef5..5554f0006c 100644 --- a/Open-ILS/web/templates/default/vandelay/inc/import_errors.tt2 +++ b/Open-ILS/web/templates/default/vandelay/inc/import_errors.tt2 @@ -47,6 +47,15 @@

Import Items


Limit to Import Failures +
+ +