var count = chunk.split(':')[2];
var links = '';
if(rec)
- links += '<a href="javascript:void(0);" onclick="vlLoadErrorUI(' + id + ');"><b>Record</b></a><br/>'; // TODO I18N
+ links += '<a href="javascript:void(0);" onclick="vlLoadErrorUI(' + id + ');">Record</a><br/>'; // TODO I18N
if(Number(count))
links += '<a href="javascript:void(0);" onclick="vlLoadErrorUI(' + id + ');">Items ('+count+')</a>'; // TODO I18N
return links;
function vlLoadErrorUI(id) {
displayGlobalDiv('vl-import-error-div');
- openils.Util.show('vl-import-error-grid-some');
openils.Util.hide('vl-import-error-grid-all');
+ openils.Util.show('vl-import-error-record');
var rec = queuedRecordsMap[id];
- /* TODO: show record attrs and whether it failed import */
+ dojo.byId('vl-error-id').innerHTML = rec.id();
+ dojo.forEach( // TODO sane authority rec. fields
+ ['title', 'author', 'isbn', 'issn', 'upc'],
+ function(field) {
+ var attr = getRecAttrFromCode(rec, field);
+ var eid = 'vl-error-' + field;
+ if(attr) {
+ openils.Util.show(dojo.byId(eid).parentNode, 'table-row');
+ dojo.byId(eid).innerHTML = attr.attr_value();
+ } else {
+ openils.Util.hide(dojo.byId(eid).parentNode);
+ }
+ }
+ )
+ dojo.byId('vl-error-import-error').innerHTML = rec.import_error();
+ dojo.byId('vl-error-error-detail').innerHTML = rec.error_detail();
var errorItems = rec.import_items().filter(function(i) {return i.import_error()});
- if(errorItems) {
+ if(errorItems.length) {
+ openils.Util.show('vl-import-error-grid-some');
storeData = vqbr.toStoreData(errorItems);
var store = new dojo.data.ItemFileReadStore({data:storeData});
vlImportErrorGrid.setStore(store);
</div>
<div dojoType="dijit.layout.ContentPane" layoutAlign='client'>
- <table id='import-error-table'>
+ <table id='vl-import-error-record' class='hidden'>
+ <tbody>
+ <tr><td>ID</td><td id='vl-error-id'/></tr>
+ <tr><td>Import Error</td><td id='vl-error-import-error'/></tr>
+ <tr><td>Error Detail</td><td id='vl-error-error-detail'/></tr>
+ <tr><td>Title</td><td id='vl-error-title'/></tr>
+ <tr><td>Author</td><td id='vl-error-author'/></tr>
+ <tr><td>ISBN</td><td id='vl-error-isbn'/></tr>
+ <tr><td>ISSN</td><td id='vl-error-issn'/></tr>
+ <tr><td>UPC</td><td id='vl-error-upc'/></tr>
+ </tbody>
</table>
</div>
-<div dojoType="dijit.layout.ContentPane" layoutAlign='client' class='hidden' id='vl-import-error-grid-some'>
- <table jsId="vlImportErrorGrid"
- dojoType="openils.widget.AutoGrid"
- autoHeight='true'
- fieldOrder="['barcode', 'call_number', 'owning_lib', 'import_error', 'error_detail']"
- query="{id: '*'}"
- hidePaginator='true'
- showColumnPicker='true'
- columnPickerPrefix='"vandelay.item.import_error"'
- fmClass='vii'>
- <thead>
- <th field='owning_lib' get='vlGetOrg'/>
- <th field='circ_lib' get='vlGetOrg'/>
- </thead>
- </table>
+<div dojoType="dijit.layout.ContentPane" layoutAlign='client'>
+ <div class='hidden' id='vl-import-error-grid-some'>
+ <h3>Item Import Errors</h3>
+ <table jsId="vlImportErrorGrid"
+ dojoType="openils.widget.AutoGrid"
+ autoHeight='true'
+ fieldOrder="['barcode', 'call_number', 'owning_lib', 'import_error', 'error_detail']"
+ query="{id: '*'}"
+ hidePaginator='true'
+ showColumnPicker='true'
+ columnPickerPrefix='"vandelay.item.import_error"'
+ fmClass='vii'>
+ <thead>
+ <th field='owning_lib' get='vlGetOrg'/>
+ <th field='circ_lib' get='vlGetOrg'/>
+ </thead>
+ </table>
+ </div>
</div>
-<div dojoType="dijit.layout.ContentPane" layoutAlign='client' class='hidden' id='vl-import-error-grid-all'>
- <table jsId="vlAllImportErrorGrid"
- dojoType="openils.widget.AutoGrid"
- autoHeight='true'
- fieldOrder="['barcode', 'call_number', 'owning_lib', 'import_error', 'error_detail']"
- query="{id: '*'}"
- showPaginator='true'
- showColumnPicker='true'
- columnPickerPrefix='"vandelay.item.import_error"'
- fmClass='vii'>
- <thead>
- <th field='owning_lib' get='vlGetOrg'/>
- <th field='circ_lib' get='vlGetOrg'/>
- </thead>
- </table>
+<div dojoType="dijit.layout.ContentPane" layoutAlign='client'>
+ <div class='hidden' id='vl-import-error-grid-all'>
+ <h3>Item Import Errors</h3>
+ <table jsId="vlAllImportErrorGrid"
+ dojoType="openils.widget.AutoGrid"
+ autoHeight='true'
+ fieldOrder="['barcode', 'call_number', 'owning_lib', 'import_error', 'error_detail']"
+ query="{id: '*'}"
+ showPaginator='true'
+ showColumnPicker='true'
+ columnPickerPrefix='"vandelay.item.import_error"'
+ fmClass='vii'>
+ <thead>
+ <th field='owning_lib' get='vlGetOrg'/>
+ <th field='circ_lib' get='vlGetOrg'/>
+ </thead>
+ </table>
+ </div>
</div>