[open-ils-commits] SPAM: r10810 - in trunk/Open-ILS/web: opac/locale/en-US vandelay vandelay/inc

svn at svn.open-ils.org svn at svn.open-ils.org
Thu Oct 9 14:59:21 EDT 2008


Author: erickson
Date: 2008-10-09 14:59:18 -0400 (Thu, 09 Oct 2008)
New Revision: 10810

Modified:
   trunk/Open-ILS/web/opac/locale/en-US/vandelay.dtd
   trunk/Open-ILS/web/vandelay/inc/queue.xml
   trunk/Open-ILS/web/vandelay/vandelay.css
   trunk/Open-ILS/web/vandelay/vandelay.js
   trunk/Open-ILS/web/vandelay/vandelay.xml
Log:
added import-all option in queue display, repaired some bugs which prevented going back and forth between bib and auth record displays.  showing queue name and imported vs. total in queue display.  minor UI rearranging for less horizontal space

Modified: trunk/Open-ILS/web/opac/locale/en-US/vandelay.dtd
===================================================================
--- trunk/Open-ILS/web/opac/locale/en-US/vandelay.dtd	2008-10-09 16:11:21 UTC (rev 10809)
+++ trunk/Open-ILS/web/opac/locale/en-US/vandelay.dtd	2008-10-09 18:59:18 UTC (rev 10810)
@@ -32,6 +32,7 @@
 <!ENTITY vandelay.import.matches "Import Matches">
 <!ENTITY vandelay.import.records "Import Records">
 <!ENTITY vandelay.import.selected "Import Selected">
+<!ENTITY vandelay.import.all "Import All">
 <!ENTITY vandelay.import.time "Import Time">
 <!ENTITY vandelay.inspect.queue "Inspect Queue">
 <!ENTITY vandelay.last.edit.date "Last Edit Date">

Modified: trunk/Open-ILS/web/vandelay/inc/queue.xml
===================================================================
--- trunk/Open-ILS/web/vandelay/inc/queue.xml	2008-10-09 16:11:21 UTC (rev 10809)
+++ trunk/Open-ILS/web/vandelay/inc/queue.xml	2008-10-09 18:59:18 UTC (rev 10810)
@@ -1,4 +1,8 @@
 <h1>&vandelay.record.queue;</h1><br/>
+<div>
+    <span style='font-size:105%;' id='vl-queue-summary-name'/>
+    <span id='vl-queue-summary-import-count'/> / <span id='vl-queue-summary-total-count'/>
+</div>
 <script>
     var vlQueueGridLayout;
     function resetVlQueueGridLayout() {
@@ -37,7 +41,7 @@
                         <button jsId='vlQueueGridColumnPickerButton' 
                             onclick='
                                 vlQueueGridColumePickerDialog.hide();
-                                vlQueueGridColumePicker.update(true);'
+                                vlQueueGridColumePicker[currentType].update(true);'
                             dojoType='dijit.form.Button'>&vandelay.done;</button>
                     </td>
                 </tr>
@@ -49,37 +53,44 @@
     <div dojoType="dijit.layout.ContentPane" layoutAlign='client'>
         <table width='100%' style='margin-bottom:0px;'>
             <tr>
-                <td align='left'>
+                <td align='left' valign='bottom'>
                     <button dojoType='dijit.form.Button' onclick='vlImportSelectedRecords();'>&vandelay.import.selected;</button>
+                    <button dojoType='dijit.form.Button' onclick='vlImportAllRecords();'>&vandelay.import.all;</button>
                     <button dojoType='dijit.form.Button' onclick="
                         if(confirm('&vandelay.sure.to.delete.queue;')) {
                             vlDeleteQueue(currentType, currentQueueId, 
                                 function() { displayGlobalDiv('vl-marc-upload-div'); });
                         }">&vandelay.delete.queue;</button>
                 </td>
-                <td align='middle'>
+                <td align='middle' valign='bottom'>
                     <style>.filter_td { padding-right: 5px; border-right: 2px solid #e8e1cf; } </style>
                     <table><tr>
                         <td class='filter_td'>
-                            &vandelay.limit.to.collision.matches;
-                            <input dojoType='dijit.form.CheckBox' jsId='vlQueueGridShowMatches'/>
+                            <table class='small_form_table'><tr>
+                                    <td>&vandelay.limit.to.collision.matches;</td>
+                                    <td><input dojoType='dijit.form.CheckBox' jsId='vlQueueGridShowMatches'/></td>
+                                </tr><tr>
+                                    <td>&vandelay.limit.to.non.imported;</td>
+                                    <td><input dojoType='dijit.form.CheckBox' jsId='vlQueueGridShowNonImport' checked='checked'/></td>
+                            </tr></table>
                         </td>
                         <td class='filter_td' style='padding-left:5px;'>
-                            &vandelay.limit.to.non.imported;
-                            <input dojoType='dijit.form.CheckBox' jsId='vlQueueGridShowNonImport' checked='checked'/>
+                            <div class='nav_row_div'>&vandelay.results.per.page;</div>
+                            <div class='nav_row_div'>
+                                <select style='width:68px;' jsId='vlQueueDisplayLimit' dojoType='dijit.form.FilteringSelect' value='10'>
+                                    <option value='10'>10</option>
+                                    <option value='20'>20</option>
+                                    <option value='50'>50</option>
+                                    <option value='100'>100</option>
+                                </select>
+                            </div>
                         </td>
                         <td class='filter_td' style='padding-left:5px;'>
-                            &vandelay.results.per.page; 
-                            <select style='width:68px;' jsId='vlQueueDisplayLimit' dojoType='dijit.form.FilteringSelect' value='10'>
-                                <option value='10'>10</option>
-                                <option value='20'>20</option>
-                                <option value='50'>50</option>
-                                <option value='100'>100</option>
-                            </select>
+                            <div class='nav_row_div'>&vandelay.page;</div>
+                            <div class='nav_row_div'>
+                                <input style='width:36px;' dojoType='dijit.form.TextBox' jsId='vlQueueDisplayPage' value='1'/>
+                            </div>
                         </td>
-                        <td class='filter_td' style='padding-left:5px;'>
-                            &vandelay.page; <input style='width:36px;' dojoType='dijit.form.TextBox' jsId='vlQueueDisplayPage' value='1'/>
-                        </td>
                         <td style='padding-left:5px;'>
                             <button dojoType='dijit.form.Button' 
                                 onclick='retrieveQueuedRecords(currentType, currentQueueId, handleRetrieveRecords)'>&vandelay.refresh;</button>

Modified: trunk/Open-ILS/web/vandelay/vandelay.css
===================================================================
--- trunk/Open-ILS/web/vandelay/vandelay.css	2008-10-09 16:11:21 UTC (rev 10809)
+++ trunk/Open-ILS/web/vandelay/vandelay.css	2008-10-09 18:59:18 UTC (rev 10810)
@@ -6,6 +6,7 @@
 table { border-collapse: collapse; }
 table.dijitTooltipTable { border-collapse: separate; }
 .form_table td { padding: 6px; }
+.small_form_table td { padding: 1px; }
 .match_div {
     height: 95%;
     width: 95%;
@@ -30,3 +31,4 @@
 }
 
 .export_tr_border td { border-top: 1px solid #808080; }
+.nav_row_div {padding:1px; text-align:center; }

Modified: trunk/Open-ILS/web/vandelay/vandelay.js
===================================================================
--- trunk/Open-ILS/web/vandelay/vandelay.js	2008-10-09 16:11:21 UTC (rev 10809)
+++ trunk/Open-ILS/web/vandelay/vandelay.js	2008-10-09 18:59:18 UTC (rev 10810)
@@ -74,7 +74,7 @@
 var allUserAuthQueues;
 var selectableGridRecords;
 var cgi = new openils.CGI();
-var vlQueueGridColumePicker;
+var vlQueueGridColumePicker = {};
 
 /**
   * Grab initial data
@@ -289,20 +289,21 @@
     var limit = parseInt(vlQueueDisplayLimit.getValue());
     var offset = limit * parseInt(vlQueueDisplayPage.getValue()-1);
 
+    var params =  [authtoken, queueId, {clear_marc: 1, offset: offset, limit: limit}];
+    if(vlQueueGridShowNonImport.checked)
+        params[2].non_imported = 1;
+
     fieldmapper.standardRequest(
         ['open-ils.vandelay', method],
         {   async: true,
-            params: [authtoken, queueId, 
-                {   clear_marc: 1, 
-                    offset: offset,
-                    limit: limit
-                }
-            ],
-            /* intermittent bug in streaming, multipart requests prevents use of onreponse for now...
+            params: params,
+            /*
             onresponse: function(r) {
+                console.log("ONREPONSE");
                 var rec = r.recv().content();
                 if(e = openils.Event.parse(rec))
                     return alert(e);
+                console.log("got record " + rec.id());
                 queuedRecords.push(rec);
                 queuedRecordsMap[rec.id()] = rec;
             },
@@ -465,7 +466,7 @@
 }
 
 function getRecAttrFromCode(rec, attrCode) {
-    var defId = attrDefMap[attrCode];
+    var defId = attrDefMap[currentType][attrCode];
     var attrs = rec.attributes();
     for(var i = 0; i < attrs.length; i++) {
         var attr = attrs[i];
@@ -565,17 +566,18 @@
     }
 }
 
-var vlQueueGridBuilt = false;
+var valLastQueueType = null;
 function buildRecordGrid(type) {
     displayGlobalDiv('vl-queue-div');
 
-    currentOverlayRecordsMap = {};
-
-    if(!vlQueueGridBuilt) {
+    if(valLastQueueType != type) {
+        valLastQueueType = type;
+        resetVlQueueGridLayout();
         var defs = (type == 'bib') ? bibAttrDefs : authAttrDefs;
+        attrDefMap[type] = {};
         for(var i = 0; i < defs.length; i++) {
             var def = defs[i]
-            attrDefMap[def.code()] = def.id();
+            attrDefMap[type][def.code()] = def.id();
             var col = {
                 name:def.description(), 
                 field:'attr.' + def.code(),
@@ -584,7 +586,6 @@
             };
             vlQueueGridLayout[0].cells[0].push(col);
         }
-        vlQueueGridBuilt = true;
     }
 
     var storeData;
@@ -598,13 +599,14 @@
         null, store, {rowsPerPage: 100, clientSort: true, query:{id:'*'}});
     vlQueueGrid.setModel(model);
 
-    if(vlQueueGridColumePicker) {
+
+    if(vlQueueGridColumePicker[type]) {
         vlQueueGrid.update();
     } else {
-        vlQueueGridColumePicker = 
+        vlQueueGridColumePicker[type] = 
             new openils.GridColumnPicker(vlQueueGridColumePickerDialog, 
-                vlQueueGrid, vlQueueGridLayout, authtoken, 'vandelay.queue');
-        vlQueueGridColumePicker.load();
+                vlQueueGrid, vlQueueGridLayout, authtoken, 'vandelay.queue.'+type);
+        vlQueueGridColumePicker[type].load();
     }
 }
 
@@ -661,8 +663,31 @@
 
 var handleRetrieveRecords = function() {
     buildRecordGrid(currentType);
+    vlFetchQueueSummary(currentQueueId, currentType, 
+        function(summary) {
+            dojo.byId('vl-queue-summary-name').innerHTML = summary.queue.name();
+            dojo.byId('vl-queue-summary-total-count').innerHTML = summary.total +'';
+            dojo.byId('vl-queue-summary-import-count').innerHTML = summary.imported + '';
+        }
+    );
 }
 
+function vlFetchQueueSummary(qId, type, onload) {
+    fieldmapper.standardRequest(
+        ['open-ils.vandelay', 'open-ils.vandelay.'+type+'_queue.summary.retrieve'],
+        {   async: true,
+            params: [authtoken, qId],
+            oncomplete : function(r) {
+                var summary = r.recv().content();
+                if(e = openils.Event.parse(summary))
+                    return alert(e);
+                return onload(summary);
+            }
+        }
+    );
+}
+    
+
 function vlImportSelectedRecords() {
     displayGlobalDiv('vl-generic-progress-with-total');
     var records = [];
@@ -684,15 +709,21 @@
                 var resp = r.recv().content();
                 if(e = openils.Event.parse(resp))
                     return alert(e);
-                vlControlledProgressBar.update({maximum:resp.total, progress:resp.progress});
-            },
-            oncomplete: function() {
-                return retrieveQueuedRecords(currentType, currentQueueId, handleRetrieveRecords);
-            }
+                if(resp.complete) {
+                    return retrieveQueuedRecords(currentType, currentQueueId, handleRetrieveRecords);
+                } else {
+                    vlControlledProgressBar.update({maximum:resp.total, progress:resp.progress});
+                }
+            }, 
         }
     );
 }
 
+function vlImportAllRecords() {
+    vlImportRecordQueue(currentType, currentQueueId, false,
+        function(){displayGlobalDiv('vl-queue-div');});
+}
+
 function vlImportRecordQueue(type, queueId, noMatchOnly, onload) {
     displayGlobalDiv('vl-generic-progress-with-total');
     var method = 'open-ils.vandelay.bib_queue.import';

Modified: trunk/Open-ILS/web/vandelay/vandelay.xml
===================================================================
--- trunk/Open-ILS/web/vandelay/vandelay.xml	2008-10-09 16:11:21 UTC (rev 10809)
+++ trunk/Open-ILS/web/vandelay/vandelay.xml	2008-10-09 18:59:18 UTC (rev 10810)
@@ -22,7 +22,7 @@
     <head>
         <title>&vandelay.vandelay;</title>
         <link type='text/css' rel='stylesheet' href="/vandelay/vandelay.css"/>
-        <script type="text/javascript" djConfig="parseOnLoad: true,isDebug:false" src="/js/dojo/dojo/dojo.js"></script>
+        <script type="text/javascript" djConfig="parseOnLoad: true,isDebug:true" src="/js/dojo/dojo/dojo.js"></script>
         <script type="text/javascript" src='/js/dojo/openils/MarcXPathParser.js'></script>
         <script type="text/javascript" src='/vandelay/vandelay.js'></script>
     </head>



More information about the open-ils-commits mailing list