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

svn at svn.open-ils.org svn at svn.open-ils.org
Fri Sep 5 10:04:40 EDT 2008


Author: erickson
Date: 2008-09-05 10:04:39 -0400 (Fri, 05 Sep 2008)
New Revision: 10543

Modified:
   trunk/Open-ILS/web/vandelay/vandelay.html
   trunk/Open-ILS/web/vandelay/vandelay.js
Log:
finished overlay select. overlay selected records on import

Modified: trunk/Open-ILS/web/vandelay/vandelay.html
===================================================================
--- trunk/Open-ILS/web/vandelay/vandelay.html	2008-09-05 14:03:42 UTC (rev 10542)
+++ trunk/Open-ILS/web/vandelay/vandelay.html	2008-09-05 14:04:39 UTC (rev 10543)
@@ -136,7 +136,7 @@
                             {
                                 name: 'Overlay Target', 
                                 get: vlGetOverlayTargetSelector,
-                                value: '<input type="radio" name="overlay_target" onclick="vlHandleOverlayTargetSelected" id="vl-overlay-target-ID"/>'
+                                value: '<input type="radio" name="overlay_target" onclick="vlHandleOverlayTargetSelected();" id="vl-overlay-target-ID"/>'
                             },
                             {name:'Match Point', field:'field_type'},
                             {name: 'ID', field:'id'},

Modified: trunk/Open-ILS/web/vandelay/vandelay.js
===================================================================
--- trunk/Open-ILS/web/vandelay/vandelay.js	2008-09-05 14:03:42 UTC (rev 10542)
+++ trunk/Open-ILS/web/vandelay/vandelay.js	2008-09-05 14:04:39 UTC (rev 10543)
@@ -197,7 +197,9 @@
 function retrieveQueuedRecords(type, queueId, onload) {
     queuedRecords = [];
     queuedRecordsMap = {};
+    currentOverlayRecordsMap = {};
     resetVlQueueGridLayout();
+
     fieldmapper.standardRequest(
         ['open-ils.vandelay', 'open-ils.vandelay.'+type+'_queue.records.retrieve.atomic'],
         {   async: true,
@@ -364,19 +366,22 @@
         return this.value.replace('ID', data.id);
 }
 
+/**
+  * see if the user has enabled overlays for the current match set and, 
+  * if so, map the current import record to the overlay target.
+  */
 function vlHandleOverlayTargetSelected() {
-    //alert(1);
-    console.log("checking target select..");
-    if(!vlOverlayTargetEnable.checked) return;
-    console.log("overlay enabled for for record "+matchRecId);
-    for(var i = 0; i < currentMatchedRecords.length; i++) {
-        var matchRecId = currentMatchedRecords[i].id();
-        console.log("checking id vl-overlay-target-"+matchRecId);
-        if(dojo.byId('vl-overlay-target-'+matchRecId).selected) {
-            console.log("CHECKED");
-            currentOverlayRecordsMap[currentImportRecId] = matchRecId;
-            return;
+    if(vlOverlayTargetEnable.checked) {
+        for(var i = 0; i < currentMatchedRecords.length; i++) {
+            var matchRecId = currentMatchedRecords[i].id();
+            if(dojo.byId('vl-overlay-target-'+matchRecId).checked) {
+                console.log("found overlay target " + matchRecId);
+                currentOverlayRecordsMap[currentImportRecId] = matchRecId;
+                return;
+            }
         }
+    } else {
+        delete currentOverlayRecordsMap[currentImportRecId];
     }
 }
 
@@ -453,6 +458,7 @@
 function vlImportSelectedRecords() {
     displayGlobalDiv('vl-generic-progress-with-total');
     var records = [];
+
     for(var id in selectableGridRecords) {
         if(dojo.byId(id).checked) {
             var recId = selectableGridRecords[id];
@@ -461,10 +467,11 @@
                 records.push(recId);
         }
     }
+
     fieldmapper.standardRequest(
         ['open-ils.vandelay', 'open-ils.vandelay.'+currentType+'_record.list.import'],
         {   async: true,
-            params: [authtoken, records],
+            params: [authtoken, records, {overlay_map:currentOverlayRecordsMap}],
             onresponse: function(r) {
                 var resp = r.recv().content();
                 if(e = openils.Event.parse(resp))



More information about the open-ils-commits mailing list