From fd206ada9a30fbd1b71d04e24fde144b23426897 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Mon, 30 Jul 2012 18:20:06 -0400 Subject: [PATCH] vandelay copy overlay : UI / queue mgmt Signed-off-by: Bill Erickson --- Open-ILS/src/templates/vandelay/inc/upload.tt2 | 2 +- Open-ILS/web/js/ui/default/vandelay/vandelay.js | 21 ++++++++++++++------- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/Open-ILS/src/templates/vandelay/inc/upload.tt2 b/Open-ILS/src/templates/vandelay/inc/upload.tt2 index 31ef4126b0..3e4237a2d9 100644 --- a/Open-ILS/src/templates/vandelay/inc/upload.tt2 +++ b/Open-ILS/src/templates/vandelay/inc/upload.tt2 @@ -9,7 +9,7 @@ jsId='vlUploadRecordType' onchange='vlShowUploadForm();'> - + diff --git a/Open-ILS/web/js/ui/default/vandelay/vandelay.js b/Open-ILS/web/js/ui/default/vandelay/vandelay.js index 8048bb1934..7d35503f3f 100644 --- a/Open-ILS/web/js/ui/default/vandelay/vandelay.js +++ b/Open-ILS/web/js/ui/default/vandelay/vandelay.js @@ -373,12 +373,20 @@ function uploadMARC(onload){ * Creates a new vandelay queue */ function createQueue(queueName, type, onload, importDefId, matchSet) { - var name = (type=='auth') ? 'authority' : 'bib'; + var name = (type=='bib') ? 'bib' : 'authority'; var method = 'open-ils.vandelay.'+ name +'_queue.create' + + var qType = name; + if (vlUploadRecordType.getValue().match(/acq/)) + var qType = 'acq'; + + console.log('record type ' + vlUploadRecordType.getValue()); + console.log('record type ' + vlUploadRecordType.getValue()); + fieldmapper.standardRequest( ['open-ils.vandelay', method], { async: true, - params: [authtoken, queueName, null, name, matchSet, importDefId], + params: [authtoken, queueName, null, qType, matchSet, importDefId], oncomplete : function(r) { var queue = r.recv().content(); if(e = openils.Event.parse(queue)) @@ -394,7 +402,6 @@ function createQueue(queueName, type, onload, importDefId, matchSet) { * out into the vandelay tables */ function processSpool(key, queueId, type, onload) { - if (type.match(/acq/)) type = 'bib'; fieldmapper.standardRequest( ['open-ils.vandelay', 'open-ils.vandelay.'+type+'.process_spool'], { async: true, @@ -500,7 +507,6 @@ function retrieveQueuedRecords(type, queueId, onload, doExport) { if(!type) type = currentType; else currentType = type; - if (type.match(/acq/)) type = 'bib'; if(!queueId) queueId = currentQueueId; else currentQueueId = queueId; if(!onload) onload = handleRetrieveRecords; @@ -1096,7 +1102,6 @@ var handleRetrieveRecords = function() { } function vlFetchQueueSummary(qId, type, onload) { - if (type.match(/acq/)) type = 'bib'; fieldmapper.standardRequest( ['open-ils.vandelay', 'open-ils.vandelay.'+type+'_queue.summary.retrieve'], { async: true, @@ -1316,6 +1321,9 @@ function batchUpload() { var queueName = dijit.byId('vl-queue-name').getValue(); currentType = dijit.byId('vl-record-type').getValue(); + // could be bib-acq, which makes no sense in most places + if (currentType.match(/bib/)) currentType = 'bib'; + var handleProcessSpool = function() { if( vlUploadQueueImportNoMatch.checked || @@ -1361,7 +1369,6 @@ function batchUpload() { function vlGetQueueData(type, asStore) { var filter; switch(type) { - case 'acq': case 'bib-acq': filter = 'acq'; case 'bib': @@ -1425,7 +1432,7 @@ function vlFleshQueueSelect(selector, type) { } function vlUpdateMatchSetSelector(type) { - type = (type.match(/auth/)) ? 'authority' : 'biblio'; + type = (type.match(/bib/)) ? 'biblio' : 'authority'; vlUploadQueueMatchSet.store = new dojo.data.ItemFileReadStore({data:vms.toStoreData(matchSets[type])}); } -- 2.11.0