[open-ils-commits] [GIT] Evergreen ILS branch rel_2_1 updated. 06e4d3370068002a303c9a5a03448ee0e1249fc0

Evergreen Git git at git.evergreen-ils.org
Wed Aug 3 13:15:28 EDT 2011


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, rel_2_1 has been updated
       via  06e4d3370068002a303c9a5a03448ee0e1249fc0 (commit)
      from  e8fb1f54fdc871dc313641d035d25370b171babf (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 06e4d3370068002a303c9a5a03448ee0e1249fc0
Author: Dan Wells <dbw2 at calvin.edu>
Date:   Fri Jul 29 18:09:19 2011 -0400

    Vandelay fix for merging without loading new
    
    This fix is derivative of da3a453442050482a419deff91d3dc92fdbf132a
    in master, but with new feature code removed for backport to 2.1
    and 2.0.  It does the following:
    
    - renames 'vlUploadQueueAutoImport' to 'vlUploadQueueImportNoMatch' to
      match identical change in master and to increase code clarity
    - honors this flag when doing a merge.
    
    Previously, if you checked one of the two auto-merge boxes, any records
    which did not merge loaded as new records even if the 'Auto-Import
    Non-Colliding Records' box was not checked.  You can now do one, the
    other, or both together (auto-importing and merging) as needed.
    
    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
    Signed-off-by: Mike Rylander <mrylander at gmail.com>

diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Vandelay.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Vandelay.pm
index 5c48282..d177022 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Vandelay.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Vandelay.pm
@@ -622,6 +622,7 @@ sub import_record_list_impl {
     my $merge_profile = $$args{merge_profile};
     my $bib_source = $$args{bib_source};
     my $report_all = $$args{report_all};
+    my $import_no_match = $$args{import_no_match};
 
     my $overlay_func = 'vandelay.overlay_bib_record';
     my $auto_overlay_func = 'vandelay.auto_overlay_bib_record';
@@ -771,7 +772,7 @@ sub import_record_list_impl {
                 }
             }
 
-            if(!$imported and !$error) {
+            if(!$imported and !$error and $import_no_match and scalar(@{$rec->matches}) == 0) { # match count test should not be necessary, but is a good fail-safe
             
                 # No overlay / merge occurred.  Do a traditional record import by creating a new record
             
diff --git a/Open-ILS/web/js/ui/default/vandelay/vandelay.js b/Open-ILS/web/js/ui/default/vandelay/vandelay.js
index a54005f..1ae7400 100644
--- a/Open-ILS/web/js/ui/default/vandelay/vandelay.js
+++ b/Open-ILS/web/js/ui/default/vandelay/vandelay.js
@@ -821,7 +821,7 @@ function vlHandleQueueItemsAction(action) {
             queueItemsImportDialog.hide();
 
             // hack to set the widgets the import funcs will be looking at.  Reset them below.
-            vlUploadQueueAutoImport.attr('value',  vlUploadQueueAutoImport2.attr('value'));
+            vlUploadQueueImportNoMatch.attr('value',  vlUploadQueueImportNoMatch2.attr('value'));
             vlUploadQueueAutoOverlayExact.attr('value',  vlUploadQueueAutoOverlayExact2.attr('value'));
             vlUploadQueueAutoOverlay1Match.attr('value',  vlUploadQueueAutoOverlay1Match2.attr('value'));
             vlUploadMergeProfile.attr('value',  vlUploadMergeProfile2.attr('value'));
@@ -833,8 +833,8 @@ function vlHandleQueueItemsAction(action) {
             }
             
             // reset the widgets to prevent accidental future actions
-            vlUploadQueueAutoImport.attr('value',  false);
-            vlUploadQueueAutoImport2.attr('value', false);
+            vlUploadQueueImportNoMatch.attr('value',  false);
+            vlUploadQueueImportNoMatch2.attr('value', false);
             vlUploadQueueAutoOverlayExact.attr('value', false);
             vlUploadQueueAutoOverlayExact2.attr('value', false);
             vlUploadQueueAutoOverlay1Match.attr('value', false);
@@ -901,23 +901,38 @@ function vlImportAllRecords() {
         function(){displayGlobalDiv('vl-queue-div');});
 }
 
-function vlImportRecordQueue(type, queueId, noMatchOnly, onload) {
+function vlImportRecordQueue(type, queueId, 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');
 
+
+    var mergeOpt = false;
     var options = {};
+
+    if(vlUploadQueueImportNoMatch.checked) {
+        options.import_no_match = true;
+        vlUploadQueueImportNoMatch.checked = false;
+    }
+
     if(vlUploadQueueAutoOverlayExact.checked) {
         options.auto_overlay_exact = true;
         vlUploadQueueAutoOverlayExact.checked = false;
+        mergeOpt = true;
     }
 
     if(vlUploadQueueAutoOverlay1Match.checked) {
         options.auto_overlay_1match = true;
         vlUploadQueueAutoOverlay1Match.checked = false;
+        mergeOpt = true;
+    }
+
+    if(!mergeOpt) {
+        // in the interest of speed, if no merge options are 
+        // chosen, tell the back-end code to only process records
+        // that have no matches
+        method = method.replace('\.import', '.nomatch.import');
     }
     
     var profile = vlUploadMergeProfile.attr('value');
@@ -949,16 +964,18 @@ function batchUpload() {
     currentType = dijit.byId('vl-record-type').getValue();
 
     var handleProcessSpool = function() {
-        if(vlUploadQueueAutoImport.checked || vlUploadQueueAutoOverlayExact.checked || vlUploadQueueAutoOverlay1Match.checked) {
-            var noMatchOnly = !vlUploadQueueAutoOverlayExact.checked && !vlUploadQueueAutoOverlay1Match.checked;
-            vlImportRecordQueue(
-                currentType, 
-                currentQueueId, 
-                noMatchOnly,
-                function() {
-                    retrieveQueuedRecords(currentType, currentQueueId, handleRetrieveRecords);
-                }
-            );
+        if( 
+            vlUploadQueueImportNoMatch.checked || 
+            vlUploadQueueAutoOverlayExact.checked || 
+            vlUploadQueueAutoOverlay1Match.checked) {
+
+                vlImportRecordQueue(
+                    currentType, 
+                    currentQueueId, 
+                    function() {
+                        retrieveQueuedRecords(currentType, currentQueueId, handleRetrieveRecords);
+                    }
+                );
         } else {
             retrieveQueuedRecords(currentType, currentQueueId, handleRetrieveRecords);
         }
diff --git a/Open-ILS/web/templates/default/vandelay/inc/queue.tt2 b/Open-ILS/web/templates/default/vandelay/inc/queue.tt2
index e7d6eaf..6d231f2 100644
--- a/Open-ILS/web/templates/default/vandelay/inc/queue.tt2
+++ b/Open-ILS/web/templates/default/vandelay/inc/queue.tt2
@@ -21,7 +21,7 @@
                 <tr>
                     <td>&vandelay.auto.import.noncolliding;</td>
                     <td colspan='4'>
-                        <input jsId='vlUploadQueueAutoImport2' dojoType='dijit.form.CheckBox'/>
+                        <input jsId='vlUploadQueueImportNoMatch2' dojoType='dijit.form.CheckBox'/>
                     </td>
                 </tr>
                 <tr>
diff --git a/Open-ILS/web/templates/default/vandelay/inc/upload.tt2 b/Open-ILS/web/templates/default/vandelay/inc/upload.tt2
index aca6320..43e7483 100644
--- a/Open-ILS/web/templates/default/vandelay/inc/upload.tt2
+++ b/Open-ILS/web/templates/default/vandelay/inc/upload.tt2
@@ -26,7 +26,7 @@
         <tr>
             <td>&vandelay.auto.import.noncolliding;</td>
             <td colspan='4'>
-                <input jsId='vlUploadQueueAutoImport' dojoType='dijit.form.CheckBox'/>
+                <input jsId='vlUploadQueueImportNoMatch' dojoType='dijit.form.CheckBox'/>
             </td>
         </tr>
         <tr>

-----------------------------------------------------------------------

Summary of changes:
 .../perlmods/lib/OpenILS/Application/Vandelay.pm   |    3 +-
 Open-ILS/web/js/ui/default/vandelay/vandelay.js    |   49 +++++++++++++------
 .../web/templates/default/vandelay/inc/queue.tt2   |    2 +-
 .../web/templates/default/vandelay/inc/upload.tt2  |    2 +-
 4 files changed, 37 insertions(+), 19 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list