From: erickson Date: Thu, 29 Apr 2010 15:53:35 +0000 (+0000) Subject: added support for selecting merge/overlay options during import of already queued... X-Git-Tag: sprint4-merge-nov22~7795 X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=f0851d0cf39aa7b82d7994a7393b76775956b5cc;p=working%2FEvergreen.git added support for selecting merge/overlay options during import of already queued records, same as main upload page git-svn-id: svn://svn.open-ils.org/ILS/trunk@16345 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/web/js/ui/default/vandelay/vandelay.js b/Open-ILS/web/js/ui/default/vandelay/vandelay.js index 0af7275abd..7346ef029b 100644 --- a/Open-ILS/web/js/ui/default/vandelay/vandelay.js +++ b/Open-ILS/web/js/ui/default/vandelay/vandelay.js @@ -109,6 +109,12 @@ function vlInit() { vlUploadMergeProfile.searchAttr = 'name'; vlUploadMergeProfile.startup(); + vlUploadMergeProfile2.store = new dojo.data.ItemFileReadStore({data:fieldmapper.vmp.toStoreData(profiles)}); + vlUploadMergeProfile2.labelAttr = 'name'; + vlUploadMergeProfile2.searchAttr = 'name'; + vlUploadMergeProfile2.startup(); + + // Fetch the bib and authority attribute definitions vlFetchBibAttrDefs(function () { checkInitDone(); }); vlFetchAuthAttrDefs(function () { checkInitDone(); }); @@ -793,6 +799,49 @@ function vlFetchQueueSummary(qId, type, onload) { } ); } + +function vlHandleQueueItemsAction(action) { + + dojo.connect( + queueItemsImportCancelButton, + 'onClick', + function() { + queueItemsImportDialog.hide(); + } + ); + + dojo.connect( + queueItemsImportGoButton, + 'onClick', + function() { + queueItemsImportDialog.hide(); + + // hack to set the widgets the import funcs will be looking at. Reset them below. + vlUploadQueueAutoImport.attr('value', vlUploadQueueAutoImport2.attr('value')); + vlUploadQueueAutoOverlayExact.attr('value', vlUploadQueueAutoOverlayExact2.attr('value')); + vlUploadQueueAutoOverlay1Match.attr('value', vlUploadQueueAutoOverlay1Match2.attr('value')); + vlUploadMergeProfile.attr('value', vlUploadMergeProfile2.attr('value')); + + if(action == 'import') { + vlImportSelectedRecords(); + } else if(action == 'import_all') { + vlImportAllRecords(); + } + + // reset the widgets to prevent accidental future actions + vlUploadQueueAutoImport.attr('value', false); + vlUploadQueueAutoImport2.attr('value', false); + vlUploadQueueAutoOverlayExact.attr('value', false); + vlUploadQueueAutoOverlayExact2.attr('value', false); + vlUploadQueueAutoOverlay1Match.attr('value', false); + vlUploadQueueAutoOverlay1Match2.attr('value', false); + vlUploadMergeProfile.attr('value', ''); + vlUploadMergeProfile2.attr('value', ''); + } + ); + + queueItemsImportDialog.show(); +} function vlImportSelectedRecords() { @@ -808,10 +857,27 @@ function vlImportSelectedRecords() { } } + var options = {overlay_map : currentOverlayRecordsMap}; + + if(vlUploadQueueAutoOverlayExact.checked) { + options.auto_overlay_exact = true; + vlUploadQueueAutoOverlayExact.checked = false; + } + + if(vlUploadQueueAutoOverlay1Match.checked) { + options.auto_overlay_1match = true; + vlUploadQueueAutoOverlay1Match.checked = false; + } + + var profile = vlUploadMergeProfile.attr('value'); + if(profile != null && profile != '') { + options.merge_profile = profile; + } + fieldmapper.standardRequest( ['open-ils.vandelay', 'open-ils.vandelay.'+currentType+'_record.list.import'], { async: true, - params: [authtoken, records, {overlay_map:currentOverlayRecordsMap}], + params: [authtoken, records, options], onresponse: function(r) { var resp = r.recv().content(); if(e = openils.Event.parse(resp)) @@ -849,7 +915,6 @@ function vlImportRecordQueue(type, queueId, noMatchOnly, onload) { options.auto_overlay_1match = true; vlUploadQueueAutoOverlay1Match.checked = false; } - var profile = vlUploadMergeProfile.attr('value'); if(profile != null && profile != '') { diff --git a/Open-ILS/web/templates/default/vandelay/inc/queue.tt2 b/Open-ILS/web/templates/default/vandelay/inc/queue.tt2 index 8f3c458053..5f0df1e831 100644 --- a/Open-ILS/web/templates/default/vandelay/inc/queue.tt2 +++ b/Open-ILS/web/templates/default/vandelay/inc/queue.tt2 @@ -14,6 +14,48 @@
+
+
+ + + + + + + + + + + + + + + + + + + + + + + +
&vandelay.auto.import.noncolliding; + +
&vandelay.auto.import.auto_overlay_exact; + +
&vandelay.auto.import.auto_overlay_1match; + +
&vandelay.auto.import.merge_profile; +
+
+ + + +
+
+
+
@@ -30,8 +72,8 @@ var sel = dojo.byId('vl-queue-actions-selector'); sel.onchange = function(evt) { switch(openils.Util.selectorValue(evt.target)) { - case 'import': vlImportSelectedRecords(); break;; - case 'import_all': vlImportAllRecords(); break;; + case 'import': vlHandleQueueItemsAction('import'); break;; + case 'import_all': vlHandleQueueItemsAction('import_all'); break;; case 'delete_queue': if(confirm('&vandelay.sure.to.delete.queue;')) { vlDeleteQueue(currentType, currentQueueId,