[open-ils-commits] r10647 - trunk/Open-ILS/web/vandelay

svn at svn.open-ils.org svn at svn.open-ils.org
Fri Sep 19 14:49:39 EDT 2008


Author: erickson
Date: 2008-09-19 14:49:35 -0400 (Fri, 19 Sep 2008)
New Revision: 10647

Modified:
   trunk/Open-ILS/web/vandelay/vandelay.js
Log:
added auto-import of non-colliding recs support

Modified: trunk/Open-ILS/web/vandelay/vandelay.js
===================================================================
--- trunk/Open-ILS/web/vandelay/vandelay.js	2008-09-19 18:24:41 UTC (rev 10646)
+++ trunk/Open-ILS/web/vandelay/vandelay.js	2008-09-19 18:49:35 UTC (rev 10647)
@@ -587,7 +587,30 @@
     );
 }
 
+function vlImportRecordQueue(type, queueId, noMatchOnly, onload) {
+    displayGlobalDiv('vl-generic-progress-with-total');
+    var method = 'open-ils.vandelay.bib_queue.import';
+    if(noMatchOnly)
+        method = method.replace('import', 'nomatch.import');
+    if(type == 'auth')
+        method = method.replace('bib', 'auth');
 
+    fieldmapper.standardRequest(
+        ['open-ils.vandelay', method],
+        {   async: true,
+            params: [authtoken, queueId],
+            onresponse: function(r) {
+                var resp = r.recv().content();
+                if(e = openils.Event.parse(resp))
+                    return alert(e);
+                vlControlledProgressBar.update({maximum:resp.total, progress:resp.progress});
+            },
+            oncomplete: function() {onload();}
+        }
+    );
+}
+
+
 /**
   * Create queue, upload MARC, process spool, load the newly created queue 
   */
@@ -597,7 +620,15 @@
 
     var handleProcessSpool = function() {
         console.log('records uploaded and spooled');
-        retrieveQueuedRecords(currentType, currentQueueId, handleRetrieveRecords);
+        if(vlUploadQueueAutoImport.checked) {
+            vlImportRecordQueue(currentType, currentQueueId, true,  
+                function() {
+                    retrieveQueuedRecords(currentType, currentQueueId, handleRetrieveRecords);
+                }
+            );
+        } else {
+            retrieveQueuedRecords(currentType, currentQueueId, handleRetrieveRecords);
+        }
     }
 
     var handleUploadMARC = function(key) {



More information about the open-ils-commits mailing list