vandelay copy overlay; initial UI support, more needed
authorBill Erickson <berick@esilibrary.com>
Fri, 27 Jul 2012 22:09:46 +0000 (18:09 -0400)
committerBill Erickson <berick@esilibrary.com>
Fri, 27 Jul 2012 22:09:46 +0000 (18:09 -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 25d42e6..31ef412 100644 (file)
@@ -9,6 +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>
                 </select>
             </td>
         </tr>
index 2728b4c..4a95b44 100644 (file)
@@ -373,7 +373,7 @@ function uploadMARC(onload){
   * Creates a new vandelay queue
   */
 function createQueue(queueName, type, onload, importDefId, matchSet) {
-    var name = (type=='bib') ? 'bib' : 'authority';
+    var name = (type=='auth') ? 'authority' : 'bib';
     var method = 'open-ils.vandelay.'+ name +'_queue.create'
     fieldmapper.standardRequest(
         ['open-ils.vandelay', method],
@@ -394,6 +394,7 @@ 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,
@@ -499,6 +500,7 @@ 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;
@@ -1094,6 +1096,7 @@ 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,
@@ -1358,6 +1361,7 @@ function batchUpload() {
 function vlGetQueueData(type, asStore) {
     var filter;
     switch(type) {
+        case 'acq':
         case 'bib-acq':
             filter = 'acq';
         case 'bib':
@@ -1421,7 +1425,7 @@ function vlFleshQueueSelect(selector, type) {
 }
 
 function vlUpdateMatchSetSelector(type) {
-    type = (type.match(/bib/)) ? 'biblio' : 'authority';
+    type = (type.match(/auth/)) ? 'authority' : 'biblio';
     vlUploadQueueMatchSet.store = 
         new dojo.data.ItemFileReadStore({data:vms.toStoreData(matchSets[type])});
 }