record / item import failures summar links
authorberick <berick@esilibrary.com>
Mon, 25 Apr 2011 13:58:19 +0000 (09:58 -0400)
committerBill Erickson <berick@esilibrary.com>
Wed, 6 Jul 2011 18:50:50 +0000 (14:50 -0400)
Open-ILS/web/js/ui/default/vandelay/vandelay.js
Open-ILS/web/templates/default/vandelay/inc/queue.tt2

index a54005f..7eece79 100644 (file)
@@ -369,7 +369,7 @@ function retrieveQueuedRecords(type, queueId, onload) {
     var limit = parseInt(sel.options[sel.selectedIndex].value);
     var offset = limit * parseInt(vlQueueDisplayPage.attr('value')-1);
 
-    var params =  [authtoken, queueId, {clear_marc: 1, offset: offset, limit: limit}];
+    var params =  [authtoken, queueId, {clear_marc: 1, offset: offset, limit: limit, flesh_import_items:1}];
     if(vlQueueGridShowNonImport.checked)
         params[2].non_imported = 1;
 
@@ -568,6 +568,31 @@ function vlFormatViewMatches(id) {
     return '<a href="javascript:void(0);" onclick="vlLoadMatchUI(' + id + ');">' + this.name + '</a>';
 }
 
+function vlGetViewErrors(rowIdx, item) {
+    if(item) {
+        var id = this.grid.store.getValue(item, 'id');
+        var rec = queuedRecordsMap[id];
+        // id:rec_error:item_import_error_count
+        return id + ':' + 
+            (rec.import_error() ? 1 : '') + ':' + 
+            rec.import_items().filter(function(i) {return i.import_error()}).length;
+    }
+    return -1
+}
+
+function vlFormatViewErrors(chunk) {
+    if(chunk == -1) return '';
+    var id = chunk.split(':')[0];
+    var rec = chunk.split(':')[1];
+    var count = chunk.split(':')[2];
+    var links = '';
+    if(rec) 
+        links += '<a href="javascript:void(0);" onclick="vlLoadErrorUI(' + id + ');"><b>Record</b></a><br/>'; // XXX I18N
+    if(Number(count))
+        links += '<a href="javascript:void(0);" onclick="vlLoadErrorUI(' + id + ');"><b>Items ('+count+')</b></a>'; // XXX I18N
+    return links;
+}
+
 function vlFormatViewMatchMARC(id) {
     return '<a href="javascript:void(0);" onclick="vlLoadMARCHtml(' + id + ', true, '+
         'function(){displayGlobalDiv(\'vl-match-div\');});">' + this.name + '</a>';
index e7d6eaf..5c87243 100644 (file)
                     field='+row_selector'
                     get='vlQueueGridDrawSelectBox'
                     formatter='vlQueueGridFormatSelectBox'
-                    styles='text-align: center;'
+                    styles='text-align: center;width:30px;'
                     nonSelectable='true'>
                         <input id="vl-queue-grid-row-selector" type="checkbox" onclick="vlToggleQueueGridSelect();"></input>
                 </th>
                     styles='text-align: center;'
                     nonSelectable='true'>&vandelay.matches;</th>
                 <th
+                    field='+get_errors'
+                    get='vlGetViewErrors'
+                    formatter='vlFormatViewErrors'
+                    styles='text-align: center;'
+                    nonSelectable='true'>Import Errors</th>
+                <th
                     field='import_time'
                     styles='text-align: center;'
                     get='vlGetDateTimeField'>&vandelay.import.time;</th>
                     styles='text-align: center;'
                     nonSelectable='true'>&vandelay.matches;</th>
                 <th
+                    field='+get_errors'
+                    get='vlGetViewErrors'
+                    formatter='vlFormatViewErrors'
+                    styles='text-align: center;'
+                    nonSelectable='true'>Import Errors</th>
+                <th
                     field='import_time'
                     styles='text-align: center;'
                     get='vlGetDateTimeField'>&vandelay.import.time;</th>