added view for all failed item imports for a queue; next up is export options
authorberick <berick@esilibrary.com>
Mon, 2 May 2011 21:48:29 +0000 (17:48 -0400)
committerBill Erickson <berick@esilibrary.com>
Wed, 6 Jul 2011 18:50:51 +0000 (14:50 -0400)
Open-ILS/src/perlmods/lib/OpenILS/Application/Vandelay.pm
Open-ILS/web/js/ui/default/vandelay/vandelay.js
Open-ILS/web/templates/default/vandelay/inc/queue.tt2

index 4df6c1d..1d69eb4 100644 (file)
@@ -518,7 +518,9 @@ sub retrieve_queue_import_items {
                 }
             }
         },
-        order_by => {'vii' => ['record','id']}
+        order_by => {'vii' => ['record','id']},
+        limit => $limit,
+        offset => $offset
     };
 
     $query->{where} = {'+vii' => {import_error => {'!=' => undef}}}
index cd6cd82..182cf5c 100644 (file)
@@ -644,6 +644,43 @@ function vlLoadErrorUI(id) {
     }
 }
 
+function vlLoadErrorUIAll() {
+
+    displayGlobalDiv('vl-import-error-div');
+    openils.Util.hide('vl-import-error-grid-some');
+    openils.Util.show('vl-import-error-grid-all');
+    vlAllImportErrorGrid.resetStore();
+
+    vlAllImportErrorGrid.dataLoader = function() {
+
+        vlAllImportErrorGrid.showLoadProgressIndicator();
+
+        fieldmapper.standardRequest(
+            ['open-ils.vandelay', 'open-ils.vandelay.import_item.queue.retrieve'],
+            {
+                async : true,
+                params : [
+                    authtoken, currentQueueId, {   
+                        with_import_error:1, 
+                        offset : vlAllImportErrorGrid.displayOffset,
+                        limit : vlAllImportErrorGrid.displayLimit
+                    }
+                ],
+                onresponse : function(r) {
+                    var item = openils.Util.readResponse(r);
+                    if(!item) return;
+                    vlAllImportErrorGrid.store.newItem(vii.toStoreItem(item));
+                },
+                oncomplete : function() {
+                    vlAllImportErrorGrid.hideLoadProgressIndicator();
+                }
+            }
+        );
+    };
+
+    vlAllImportErrorGrid.dataLoader();
+}
+
 function vlGetOrg(rowIdx, item) {
     if(!item) return '';
     var value = this.grid.store.getValue(item, this.field);
index 25e22a2..50f74b4 100644 (file)
@@ -11,7 +11,7 @@
                             <tbody>
                                 <tr><td><a href='#' onclick='vlHandleQueueItemsAction("import")'>&vandelay.import.selected;</a></td></tr>
                                 <tr><td><a href='#' onclick='vlHandleQueueItemsAction("import_all")'>&vandelay.import.all;</a></td></tr>
-                                <tr><td><a href='#' onclick='alert("coming soon"); return;vlHandleQueueItemsAction("item_errors")'>View Item Import Failures</a></td></tr>
+                                <tr><td><a href='#' onclick='vlLoadErrorUIAll();'>View Item Import Failures</a></td></tr>
                                 <tr><td><a href='#' onclick='
                                     if(confirm("&vandelay.sure.to.delete.queue;")) {
                                         vlDeleteQueue(currentType, currentQueueId, 
     </fieldset>
 </div>
 
-<!-- queue grid navigation row -->
-<div dojoType="dijit.layout.ContentPane" layoutAlign='client'>
-    <table width='100%' style='margin-bottom:0px;'>
-        <tr>
-        <!--
-            <td align='left' valign='bottom'>
-                <select id='vl-queue-actions-selector'>
-                    <option selected='selected' disabled='disabled' value='select-actions'>&vandelay.select_actions;</option>
-                    <option value='import'>&vandelay.import.selected;</option>
-                    <option value='import_all'>&vandelay.import.all;</option>
-                    <option value='delete_queue'>&vandelay.delete.queue;</option>
-                </select>
-                <script type="text/javascript">
-                    var sel = dojo.byId('vl-queue-actions-selector');
-                    sel.onchange = function(evt) {
-                        switch(openils.Util.selectorValue(evt.target)) {
-                            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, 
-                                        function() { displayGlobalDiv('vl-marc-upload-div'); });
-                                }
-                        }
-                        evt.target.selectedIndex = 0;
-                    }
-                </script>
-            </td>
-            <td align='right' valign='bottom'>
-                <style type="text/css">.filter_span { padding-right: 5px; border-right: 2px solid #e8e1cf; } </style>
-                <span>&vandelay.results.per.page;</span>
-                <span class='filter_span'>
-                    <select jsId='vlQueueDisplayLimit' id='vl-queue-display-limit-selector'
-                        value='10' onchange='retrieveQueuedRecords();'>
-                        <option value='10'>10</option>
-                        <option value='20'>20</option>
-                        <option value='50'>50</option>
-                        <option value='100'>100</option>
-                    </select>
-                </span>
-                <span style='padding-left:5px;'>&vandelay.page;</span>
-                <input style='width:36px;' dojoType='dijit.form.TextBox' jsId='vlQueueDisplayPage' value='1'/>
-
-                <span style='padding-right:4px;'>
-                    <a href='javascript:void(0);' onclick='vlQueueGridPrevPage();'>&vandelay.prev.page;</a>
-                </span>
-                <span style='padding-right:10px;'>
-                    <a href='javascript:void(0);' onclick='vlQueueGridNextPage();'>&vandelay.next.page;</a>
-                </span>
-            </td>
-            -->
-        </tr>
-    </table>
-</div>
-
-
 <!-- Bib Queue Grid -->
 <div class='' id='vl-bib-queue-grid-wrapper' dojoType='dijit.layout.ContentPane'>
     <table dojoType='dojox.grid.DataGrid' jsId='vlBibQueueGrid' query="{id:'*'}" autoHeight='true'>