inspect queue now gives option to inspect completed queues as well. added marc2html...
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 23 Sep 2008 21:49:35 +0000 (21:49 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 23 Sep 2008 21:49:35 +0000 (21:49 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@10693 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/vandelay/vandelay.html
Open-ILS/web/vandelay/vandelay.js

index 615d694..0fe4855 100644 (file)
     </head>
     <body class="tundra tall">
       <div dojoType="dijit.layout.LayoutContainer" orientation="vertical" class="tall">
     </head>
     <body class="tundra tall">
       <div dojoType="dijit.layout.LayoutContainer" orientation="vertical" class="tall">
-        <div dojoType="dijit.Toolbar" id='toolbar' layoutAlign="top">
-            <div dojoType="dijit.form.Button" iconClass="dijitEditorIcon dijitEditorIconCopy" 
-                onclick='displayGlobalDiv("vl-marc-upload-div");' showLabel="true">Import Records</div>
-            <div dojoType="dijit.form.Button" iconClass="dijitEditorIcon dijitEditorIconCopy" 
-                onclick='vlShowQueueSelect();' showLabel="true">Inspect Queue</div>
+
+
+        <!-- navigation toolbar -->
+        <div dojoType="dijit.layout.ContentPane" layoutAlign='top'>
+            <div dojoType="dijit.Toolbar" id='toolbar'>
+                <div dojoType="dijit.form.Button" iconClass="dijitEditorIcon dijitEditorIconCopy" 
+                    onclick='displayGlobalDiv("vl-marc-upload-div");' showLabel="true">Import Records</div>
+                <div dojoType="dijit.form.Button" iconClass="dijitEditorIcon dijitEditorIconCopy" 
+                    onclick='vlShowQueueSelect();' showLabel="true">Inspect Queue</div>
+            </div>
         </div>
 
         </div>
 
-        <div id="vl-generic-progress" class='progress'>
+        <div dojoType="dijit.layout.ContentPane" layoutAlign='client' id="vl-generic-progress" class='progress'>
             <div dojoType="dijit.ProgressBar" style="width:300px" indeterminate="true"></div>
         </div>
             <div dojoType="dijit.ProgressBar" style="width:300px" indeterminate="true"></div>
         </div>
-        <div id="vl-generic-progress-with-total" class='hidden progress'>
+        <div dojoType="dijit.layout.ContentPane" layoutAlign='client' id="vl-generic-progress-with-total" class='hidden progress'>
             <div dojoType="dijit.ProgressBar" jsId='vlControlledProgressBar' style="width:300px"></div>
         </div>
 
             <div dojoType="dijit.ProgressBar" jsId='vlControlledProgressBar' style="width:300px"></div>
         </div>
 
-        <div id='vl-marc-upload-status-div' class='hidden'>
+        <div dojoType="dijit.layout.ContentPane" layoutAlign='client' id='vl-marc-upload-status-div' class='hidden'>
             <h1>Upload Status</h1><br/>
             <div id='vl-upload-status-uploading'><h3>Uploading...</h3></div>
             <div id='vl-upload-status-processing' class='hidden'>
             <h1>Upload Status</h1><br/>
             <div id='vl-upload-status-uploading'><h3>Uploading...</h3></div>
             <div id='vl-upload-status-processing' class='hidden'>
@@ -74,7 +79,7 @@
         </div>
 
         <!-- MARC upload form -->
         </div>
 
         <!-- MARC upload form -->
-        <div dojoType="dijit.layout.ContentPane" layoutAlign="client" id='vl-marc-upload-div' class='hidden'>
+        <div dojoType="dijit.layout.ContentPane" layoutAlign='client' id='vl-marc-upload-div' class='hidden'>
             <h1>Evergreen MARC File Upload</h1><br/>
             <form id="vl-marc-upload-form" enctype="multipart/form-data">
                 <input type='hidden' name='ses' id='vl-ses-input'/>
             <h1>Evergreen MARC File Upload</h1><br/>
             <form id="vl-marc-upload-form" enctype="multipart/form-data">
                 <input type='hidden' name='ses' id='vl-ses-input'/>
         </div>
 
         <!-- record queue grid -->
         </div>
 
         <!-- record queue grid -->
-        <div dojoType="dijit.layout.ContentPane" layoutAlign="client" id='vl-queue-div' class='tall hidden'>
+        <div dojoType="dijit.layout.ContentPane" layoutAlign='client' id='vl-queue-div' class='tall hidden'>
             <h1>Record Queue</h1><br/>
             <script>
                 var vlQueueGridLayout;
             <h1>Record Queue</h1><br/>
             <script>
                 var vlQueueGridLayout;
                         cells : [[
                             {name: '<input id="vl-queue-grid-row-selector" type="checkbox" onclick="vlToggleQueueGridSelect();"/>', 
                                 get: vlQueueGridDrawSelectBox },
                         cells : [[
                             {name: '<input id="vl-queue-grid-row-selector" type="checkbox" onclick="vlToggleQueueGridSelect();"/>', 
                                 get: vlQueueGridDrawSelectBox },
+                            {   name: 'View MARC', 
+                                get: vlGetViewMARC, 
+                                value:'<a href="javascript:void(0);" onclick="vlLoadMARCHtml(RECID, false, function(){displayGlobalDiv(\'vl-queue-div\');});">View MARC</a>'
+                            },
                             {name: 'Import Time', field:'import_time', get:vlGetDateTimeField, selectableColumn:true}
                         ]]
                     }];
                 }
             </script>
                             {name: 'Import Time', field:'import_time', get:vlGetDateTimeField, selectableColumn:true}
                         ]]
                     }];
                 }
             </script>
-            <div id='vl-queue-div-grid' class='tall'>
+            <div id='vl-queue-div-grid' class='tall' dojoType="dijit.layout.ContentPane" layoutAlign='client'>
+
                 <!-- column picker dialog -->
                 <div dojoType="dijit.Dialog" jsId='vlQueueGridColumePickerDialog' title="Column Picker" execute="alert(2);">
                     <table class='form_table'>
                 <!-- column picker dialog -->
                 <div dojoType="dijit.Dialog" jsId='vlQueueGridColumePickerDialog' title="Column Picker" execute="alert(2);">
                     <table class='form_table'>
                 </div>
 
                 <!-- queue grid navigation row -->
                 </div>
 
                 <!-- queue grid navigation row -->
-                <table width='100%' style='margin-bottom:0px;'>
-                    <tr>
-                        <td align='left'>
-                            <button dojoType='dijit.form.Button' onclick='vlImportSelectedRecords();'>Import Selected</button>
-                            <button dojoType='dijit.form.Button' onclick='
-                                if(confirm("Are you sure want to delete this queue?")) {
-                                    vlDeleteQueue(currentType, currentQueueId, 
-                                        function() { displayGlobalDiv("vl-marc-upload-div"); });
-                                }'>Delete Queue</button>
-                        </td>
-                        <td align='middle'>
-                            <style>.filter_td { padding-right: 5px; border-right: 2px solid #e8e1cf; } </style>
-                            <table><tr>
-                                <td class='filter_td'>
-                                    Limit to Collision Matches
-                                    <input dojoType='dijit.form.CheckBox' jsId='vlQueueGridShowMatches' checked='checked'/>
-                                </td>
-                                <td class='filter_td' style='padding-left:5px;'>
-                                    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>
-                                </td>
-                                <td class='filter_td' style='padding-left:5px;'>
-                                    Page <input style='width:36px;' dojoType='dijit.form.TextBox' jsId='vlQueueDisplayPage' value='1'/>
-                                </td style='padding-left:5px;'>
-                                <td style='padding-left:5px;'>
-                                    <button dojoType='dijit.form.Button' 
-                                        onclick='retrieveQueuedRecords(currentType, currentQueueId, handleRetrieveRecords)'>Refresh</button>
-                                </td>
-                            </tr></table>
-                        </td>
-                        <td align='right' valign='bottom'>
-                            <span style='padding-right:4px;'>
-                                <a href='javascript:void(0);' onclick='
-                                    var page = parseInt(vlQueueDisplayPage.getValue());
-                                    if(page < 2) return;
-                                    vlQueueDisplayPage.setValue(page - 1);
-                                    retrieveQueuedRecords(currentType, currentQueueId, handleRetrieveRecords);'>&#171; Previous Page</a>
-                            </span>
-                            <span style='padding-right:10px;'>
-                                <a href='javascript:void(0);' onclick='
-                                    vlQueueDisplayPage.setValue(parseInt(vlQueueDisplayPage.getValue())+1);
-                                    retrieveQueuedRecords(currentType, currentQueueId, handleRetrieveRecords);'>Next Page &#187;</a>
-                            </span>
-                            <span style='background:#e8e1cf;padding:3px 0px 0px 6px;-moz-border-radius:6px 0px 0px 0px;'>
-                                <a href='javascript:void(0);' onclick='vlQueueGridColumePickerDialog.show();'>Select Columns</a>
-                            </span>
-                        </td>
-                    </tr>
-                </table>
+                <div dojoType="dijit.layout.ContentPane" layoutAlign='client'>
+                    <table width='100%' style='margin-bottom:0px;'>
+                        <tr>
+                            <td align='left'>
+                                <button dojoType='dijit.form.Button' onclick='vlImportSelectedRecords();'>Import Selected</button>
+                                <button dojoType='dijit.form.Button' onclick='
+                                    if(confirm("Are you sure want to delete this queue?")) {
+                                        vlDeleteQueue(currentType, currentQueueId, 
+                                            function() { displayGlobalDiv("vl-marc-upload-div"); });
+                                    }'>Delete Queue</button>
+                            </td>
+                            <td align='middle'>
+                                <style>.filter_td { padding-right: 5px; border-right: 2px solid #e8e1cf; } </style>
+                                <table><tr>
+                                    <td class='filter_td'>
+                                        Limit to Collision Matches
+                                        <input dojoType='dijit.form.CheckBox' jsId='vlQueueGridShowMatches' checked='checked'/>
+                                    </td>
+                                    <td class='filter_td' style='padding-left:5px;'>
+                                        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>
+                                    </td>
+                                    <td class='filter_td' style='padding-left:5px;'>
+                                        Page <input style='width:36px;' dojoType='dijit.form.TextBox' jsId='vlQueueDisplayPage' value='1'/>
+                                    </td style='padding-left:5px;'>
+                                    <td style='padding-left:5px;'>
+                                        <button dojoType='dijit.form.Button' 
+                                            onclick='retrieveQueuedRecords(currentType, currentQueueId, handleRetrieveRecords)'>Refresh</button>
+                                    </td>
+                                </tr></table>
+                            </td>
+                            <td align='right' valign='bottom'>
+                                <span style='padding-right:4px;'>
+                                    <a href='javascript:void(0);' onclick='
+                                        var page = parseInt(vlQueueDisplayPage.getValue());
+                                        if(page < 2) return;
+                                        vlQueueDisplayPage.setValue(page - 1);
+                                        retrieveQueuedRecords(currentType, currentQueueId, handleRetrieveRecords);'>&#171; Previous Page</a>
+                                </span>
+                                <span style='padding-right:10px;'>
+                                    <a href='javascript:void(0);' onclick='
+                                        vlQueueDisplayPage.setValue(parseInt(vlQueueDisplayPage.getValue())+1);
+                                        retrieveQueuedRecords(currentType, currentQueueId, handleRetrieveRecords);'>Next Page &#187;</a>
+                                </span>
+                                <span style='background:#e8e1cf;padding:3px 0px 0px 6px;-moz-border-radius:6px 0px 0px 0px;'>
+                                    <a href='javascript:void(0);' onclick='vlQueueGridColumePickerDialog.show();'>Select Columns</a>
+                                </span>
+                            </td>
+                        </tr>
+                    </table>
+                </div>
 
                 <!-- Queue Grid -->
 
                 <!-- Queue Grid -->
-                <div class='tall'>
-                    <div dojoType='dojox.Grid' jsId='vlQueueGrid' class='tall'> </div>
+                <div class='' style='height:90%;' dojoType="dijit.layout.ContentPane" layoutAlign='client'>
+                    <div dojoType='dojox.Grid' jsId='vlQueueGrid'> </div>
                 </div>
             </div>
         </div>
 
         <!-- Grid of record matches -->
                 </div>
             </div>
         </div>
 
         <!-- Grid of record matches -->
-        <div dojoType="dijit.layout.ContentPane" layoutAlign="client" id='vl-match-div' class='tall hidden'>
+        <div dojoType="dijit.layout.ContentPane" layoutAlign='client' id='vl-match-div' class='tall hidden'>
             <script>
                 var vlMatchGridLayout;
                 function resetVlMatchGridLayout() {
             <script>
                 var vlMatchGridLayout;
                 function resetVlMatchGridLayout() {
                             {name: 'ID', field:'id'},
                             {   name: 'View MARC', 
                                 get: vlGetViewMARC, 
                             {name: 'ID', field:'id'},
                             {   name: 'View MARC', 
                                 get: vlGetViewMARC, 
-                                value:'<a href="javascript:void(0);" onclick="vlLoadMARCHtml(RECID);">View MARC</a>'
+                                value:'<a href="javascript:void(0);" onclick="vlLoadMARCHtml(RECID, true, function(){displayGlobalDiv(\'vl-match-div\');});">View MARC</a>'
                             },
                             {name: 'Creator', get: vlGetCreator},
                             {name: 'Create Date', field:'create_date', get: vlGetDateTimeField},
                             },
                             {name: 'Creator', get: vlGetCreator},
                             {name: 'Create Date', field:'create_date', get: vlGetDateTimeField},
             </div>
         </div>
 
             </div>
         </div>
 
-        <!-- MARC as HTML for matched records -->
-        <div dojoType="dijit.layout.ContentPane" layoutAlign="client" id='vl-match-html-div' class='tall hidden'>
+        <!-- MARC as HTML -->
+        <div dojoType="dijit.layout.ContentPane" layoutAlign='client' id='vl-marc-html-div' class='tall hidden'>
             <h1>MARC Record</h1><br/>
             <div>
             <h1>MARC Record</h1><br/>
             <div>
-                <button dojoType='dijit.form.Button' 
-                    onclick='displayGlobalDiv("vl-match-div");'>Back To Matches...</button>
+                <button id='vl-marc-html-done-button' dojoType='dijit.form.Button'>Return...</button>
             </div>
             <div>
             </div>
             <div>
-                <style>#vl-match-record-html td {padding:0px;}</style>
-                <div id='vl-match-record-html'> </div>
+                <style>#vl-marc-record-html td {padding:0px;}</style>
+                <div id='vl-marc-record-html'> </div>
             </div>
         </div>
 
         <!-- Form for choosing which queue to view -->
             </div>
         </div>
 
         <!-- Form for choosing which queue to view -->
-        <div dojoType="dijit.layout.ContentPane" layoutAlign="client" id='vl-queue-select-div' class='tall hidden'>
+        <div dojoType="dijit.layout.ContentPane" layoutAlign='client' id='vl-queue-select-div' class='tall hidden'>
             <h1>Select a Queue to Inspect</h1><br/>
             <table class='form_table'>
                 <tr>
             <h1>Select a Queue to Inspect</h1><br/>
             <table class='form_table'>
                 <tr>
                 </tr>
             </table>
         </div>
                 </tr>
             </table>
         </div>
+        <div style='text-align:center;width:100%;' dojoType="dijit.layout.ContentPane" layoutAlign='bottom'>
+            I live at the bottom of the page and I'm powered by Evergreen!
+        </div>
+
       </div>
     </body>
 </html>
       </div>
     </body>
 </html>
index 9c9ac85..c88c087 100644 (file)
@@ -40,7 +40,7 @@ var globalDivs = [
     'vl-marc-upload-div',
     'vl-queue-div',
     'vl-match-div',
     'vl-marc-upload-div',
     'vl-queue-div',
     'vl-match-div',
-    'vl-match-html-div',
+    'vl-marc-html-div',
     'vl-queue-select-div',
     'vl-marc-upload-status-div'
 ];
     'vl-queue-select-div',
     'vl-marc-upload-status-div'
 ];
@@ -60,8 +60,10 @@ var userCache = {};
 var currentMatchedRecords; // set of loaded matched bib records
 var currentOverlayRecordsMap; // map of import record to overlay record
 var currentImportRecId; // when analyzing matches, this is the current import record
 var currentMatchedRecords; // set of loaded matched bib records
 var currentOverlayRecordsMap; // map of import record to overlay record
 var currentImportRecId; // when analyzing matches, this is the current import record
-var userBibQueues;
-var userAuthQueues;
+var userBibQueues = []; // only non-complete queues
+var userAuthQueues = []; // only non-complete queues
+var allUserBibQueues;
+var allUserAuthQueues;
 var selectableGridRecords;
 var cgi = new openils.CGI();
 var vlQueueGridColumePicker;
 var selectableGridRecords;
 var cgi = new openils.CGI();
 var vlQueueGridColumePicker;
@@ -127,30 +129,40 @@ function vlInit() {
         }
     );
 
         }
     );
 
-    fieldmapper.standardRequest(
-        ['open-ils.vandelay', 'open-ils.vandelay.bib_queue.owner.retrieve.atomic'],
-        {   async: true,
-            params: [authtoken],
-            oncomplete: function(r) {
-                var list = r.recv().content();
-                if(e = openils.Event.parse(list[0]))
-                    return alert(e);
-                userBibQueues = list;
-                checkInitDone();
+    vlRetrieveQueueList('bib', null, 
+        function(list) {
+            allUserBibQueues = list;
+            for(var i = 0; i < allUserBibQueues.length; i++) {
+                if(allUserBibQueues[i].complete() == 'f')
+                    userBibQueues.push(allUserBibQueues[i]);
             }
             }
+            checkInitDone();
         }
     );
 
         }
     );
 
+    vlRetrieveQueueList('auth', null, 
+        function(list) {
+            allUserAuthQueues = list;
+            for(var i = 0; i < allUserAuthQueues.length; i++) {
+                if(allUserAuthQueues[i].complete() == 'f')
+                    userAuthQueues.push(allUserAuthQueues[i]);
+            }
+            checkInitDone();
+        }
+    );
+}
+
+function vlRetrieveQueueList(type, filter, onload) {
+    type = (type == 'bib') ? type : 'authority';
     fieldmapper.standardRequest(
     fieldmapper.standardRequest(
-        ['open-ils.vandelay', 'open-ils.vandelay.authority_queue.owner.retrieve.atomic'],
+        ['open-ils.vandelay', 'open-ils.vandelay.'+type+'_queue.owner.retrieve.atomic'],
         {   async: true,
         {   async: true,
-            params: [authtoken],
+            params: [authtoken, null, filter],
             oncomplete: function(r) {
                 var list = r.recv().content();
                 if(e = openils.Event.parse(list[0]))
                     return alert(e);
             oncomplete: function(r) {
                 var list = r.recv().content();
                 if(e = openils.Event.parse(list[0]))
                     return alert(e);
-                userAuthQueues = list;
-                checkInitDone();
+                onload(list);
             }
         }
     );
             }
         }
     );
@@ -336,19 +348,29 @@ function vlPopulateGrid(grid, data) {
 }
 
 
 }
 
 
-function vlLoadMARCHtml(recId) {
+function vlLoadMARCHtml(recId, inCat, oncomplete) {
+    dijit.byId('vl-marc-html-done-button').onClick = oncomplete;
     displayGlobalDiv('vl-generic-progress');
     displayGlobalDiv('vl-generic-progress');
-    var api = ['open-ils.search', 'open-ils.search.biblio.record.html'];
-    if(currentType == 'auth')
-        api = ['open-ils.search', 'open-ils.search.authority.to_html'];
+    var api;
+    var params = [recId, 1];
+    if(inCat) {
+        api = ['open-ils.search', 'open-ils.search.biblio.record.html'];
+        if(currentType == 'auth')
+            api = ['open-ils.search', 'open-ils.search.authority.to_html'];
+    } else {
+        params = [authtoken, recId];
+        api = ['open-ils.vandelay', 'open-ils.vandelay.queued_bib_record.html'];
+        if(currentType == 'auth')
+            api = ['open-ils.vandelay', 'open-ils.vandelay.queued_authority_record.html'];
+    }
     fieldmapper.standardRequest(
         api, 
         {   async: true,
     fieldmapper.standardRequest(
         api, 
         {   async: true,
-            params: [recId, 1],
+            params: params,
             oncomplete: function(r) {
             oncomplete: function(r) {
-            displayGlobalDiv('vl-match-html-div');
+            displayGlobalDiv('vl-marc-html-div');
                 var html = r.recv().content();
                 var html = r.recv().content();
-                dojo.byId('vl-match-record-html').innerHTML = html;
+                dojo.byId('vl-marc-record-html').innerHTML = html;
             }
         }
     );
             }
         }
     );
@@ -651,7 +673,7 @@ function batchUpload() {
 
 
 function vlFleshQueueSelect(selector, type) {
 
 
 function vlFleshQueueSelect(selector, type) {
-    var data = (type == 'bib') ? vbq.toStoreData(userBibQueues) : vaq.toStoreData(userAuthQueues);
+    var data = (type == 'bib') ? vbq.toStoreData(allUserBibQueues) : vaq.toStoreData(allUserAuthQueues);
     selector.store = new dojo.data.ItemFileReadStore({data:data});
     selector.setValue(null);
     selector.setDisplayedValue('');
     selector.store = new dojo.data.ItemFileReadStore({data:data});
     selector.setValue(null);
     selector.setDisplayedValue('');