vandelay copy overlay : UI / queue mgmt
authorBill Erickson <berick@esilibrary.com>
Mon, 30 Jul 2012 22:20:06 +0000 (18:20 -0400)
committerBill Erickson <berick@esilibrary.com>
Mon, 30 Jul 2012 22:20:06 +0000 (18:20 -0400)
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Open-ILS/src/templates/vandelay/inc/upload.tt2
Open-ILS/web/js/ui/default/vandelay/vandelay.js

index 31ef412..3e4237a 100644 (file)
@@ -9,7 +9,7 @@
                         jsId='vlUploadRecordType' onchange='vlShowUploadForm();'>
                     <option value='bib' selected='selected'>[% l('Bibliographic Records') %]</option>
                     <option value='auth'>[% l('Authority Records') %]</option>
-                    <option value='acq'>[% l('Acquisitions Records') %]</option>
+                    <option value='bib-acq'>[% l('Acquisitions Records') %]</option>
                 </select>
             </td>
         </tr>
index 8048bb1..7d35503 100644 (file)
@@ -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])});
 }