}
function vlExportInit() {
+
+ // queue export
var qsel = dojo.byId('vl-queue-export-options');
qsel.onchange = function(newVal) {
var value = qsel.options[qsel.selectedIndex].value;
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) {
<h1>Import Items</h1><br/>
<input dojoType='dijit.form.CheckBox' jsId='vlImportItemsShowErrors' onchange='vlLoadErrorUIAll();'/>
<span>Limit to Import Failures</span>
+ <table width='100%'><tr><td width='100%' align='right'>
+ <select id='vl-item-export-options' style='margin-right: 10px;'>
+ <!-- TODO I18N -->
+ <option value=''>Export Items As...</option>
+ <option value='print'>Print</option>
+ <option value='csv'>CSV</option>
+ <option value='email'>Email</option>
+ </select>
+ </td></tr></table>
<table jsId="vlAllImportErrorGrid"
dojoType="openils.widget.AutoGrid"
autoHeight='true'