'vl-attr-editor-div',
'vl-marc-export-div',
'vl-profile-editor-div',
- 'vl-item-attr-editor-div'
+ 'vl-item-attr-editor-div',
+ 'vl-import-error-div'
];
var authtoken;
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
+ links += '<a href="javascript:void(0);" onclick="vlLoadErrorUI(' + id + ');"><b>Record</b></a><br/>'; // TODO I18N
if(Number(count))
- links += '<a href="javascript:void(0);" onclick="vlLoadErrorUI(' + id + ');"><b>Items ('+count+')</b></a>'; // XXX I18N
+ links += '<a href="javascript:void(0);" onclick="vlLoadErrorUI(' + id + ');">Items ('+count+')</a>'; // TODO I18N
return links;
}
+//var vlItemErrorColumnPicker;
+function vlLoadErrorUI(id) {
+
+ displayGlobalDiv('vl-import-error-div');
+ openils.Util.show('vl-import-error-grid-some');
+ openils.Util.hide('vl-import-error-grid-all');
+
+ var rec = queuedRecordsMap[id];
+
+ /* TODO: show record attrs and whether it failed import */
+
+ var errorItems = rec.import_items().filter(function(i) {return i.import_error()});
+ if(errorItems) {
+ storeData = vqbr.toStoreData(errorItems);
+ var store = new dojo.data.ItemFileReadStore({data:storeData});
+ vlImportErrorGrid.setStore(store);
+ vlImportErrorGrid.update();
+ }
+}
+
+function vlGetOrg(rowIdx, item) {
+ if(!item) return '';
+ var value = this.grid.store.getValue(item, this.field);
+ if(value) return fieldmapper.aou.findOrgUnit(value).shortname();
+ return '';
+}
+
function vlFormatViewMatchMARC(id) {
return '<a href="javascript:void(0);" onclick="vlLoadMARCHtml(' + id + ', true, '+
'function(){displayGlobalDiv(\'vl-match-div\');});">' + this.name + '</a>';
--- /dev/null
+<h1>Import Errors</h1><br/>
+
+<div dojoType="dijit.layout.ContentPane" layoutAlign='client'>
+ <button dojoType='dijit.form.Button'
+ onclick="displayGlobalDiv('vl-queue-div');">↖ &vandelay.back.to.import.queue;</button>
+</div>
+
+<div dojoType="dijit.layout.ContentPane" layoutAlign='client'>
+ <table id='import-error-table'>
+ </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>
+<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>
+
<div dojoType="dijit.layout.ContentPane" layoutAlign='client' id='vl-item-attr-editor-div' class='hidden content'>
[% INCLUDE 'default/vandelay/inc/item_attrs.tt2' %]
</div>
+<div dojoType="dijit.layout.ContentPane" layoutAlign='client' id='vl-import-error-div' class='hidden content'>
+ [% INCLUDE 'default/vandelay/inc/import_errors.tt2' %]
+</div>
[% END %]