From: erickson Date: Tue, 12 May 2009 17:02:48 +0000 (+0000) Subject: pile of dojo-1.3 compability fixes. more to come X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=d7e97695526b78a9467b931b099c4a92583432eb;p=contrib%2FConifer.git pile of dojo-1.3 compability fixes. more to come git-svn-id: svn://svn.open-ils.org/ILS/trunk@13145 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/web/js/ui/default/vandelay/vandelay.js b/Open-ILS/web/js/ui/default/vandelay/vandelay.js index 5a8ed06315..347463b28c 100644 --- a/Open-ILS/web/js/ui/default/vandelay/vandelay.js +++ b/Open-ILS/web/js/ui/default/vandelay/vandelay.js @@ -516,12 +516,18 @@ function getRecAttrFromCode(rec, attrCode) { } function vlGetViewMatches(rowIdx, item) { - if(!item) return ''; - var id = this.grid.store.getValue(item, 'id'); - var rec = queuedRecordsMap[id]; - if(rec.matches().length > 0) - return this.value.replace('RECID', id); - return ''; + if(item) { + var id = this.grid.store.getValue(item, 'id'); + var rec = queuedRecordsMap[id]; + if(rec.matches().length > 0) + return id; + } + return -1 +} + +function vlFormatViewMatches(id) { + if(id == -1) return ''; + return '' + this.name + ''; } function getAttrValue(rowIdx, item) { @@ -554,15 +560,27 @@ function vlGetCreator(rowIdx, item) { } function vlGetViewMARC(rowIdx, item) { - if(!item) return ''; - return this.value.replace('RECID', this.grid.store.getValue(item, 'id')); + return item && this.grid.store.getValue(item, 'id'); +} + +function vlFormatViewMARC(id) { + return '' + this.name + ''; } function vlGetOverlayTargetSelector(rowIdx, item) { - if(!item) return ''; - var _id = this.grid.store.getValue(item, '_id'); - var id = this.grid.store.getValue(item, 'id'); - var value = this.value.replace(/GRIDID/g, _id); + if(!item) return; + return this.grid.store.getValue(item, '_id') + ':' + this.grid.store.getValue(item, 'id'); +} + +function vlFormatOverlayTargetSelector(val) { + if(!val) return ''; + var parts = val.split(':'); + var _id = parts[0]; + var id = parts[1]; + var value = ''; + value = value.replace(/GRIDID/g, _id); value = value.replace(/RECID/g, currentImportRecId); value = value.replace(/ID/g, id); if(_id == currentOverlayRecordsMapGid[currentImportRecId]) @@ -570,6 +588,7 @@ function vlGetOverlayTargetSelector(rowIdx, item) { return value; } + /** * see if the user has enabled overlays for the current match set and, * if so, map the current import record to the overlay target. @@ -603,6 +622,7 @@ function vlHandleOverlayTargetSelected(recId, gridId) { } var valLastQueueType = null; +var vlQueueGridLayout = null; function buildRecordGrid(type) { displayGlobalDiv('vl-queue-div'); @@ -618,9 +638,11 @@ function buildRecordGrid(type) { vlQueueGridMenu = vlAuthQueueGridMenu; } + if(valLastQueueType != type) { valLastQueueType = type; - resetVlQueueGridLayout(); + //resetVlQueueGridLayout(); + vlQueueGridLayout = vlQueueGrid.attr('structure'); var defs = (type == 'bib') ? bibAttrDefs : authAttrDefs; attrDefMap[type] = {}; for(var i = 0; i < defs.length; i++) { @@ -636,6 +658,12 @@ function buildRecordGrid(type) { } } + dojo.forEach(vlQueueGridLayout[0].cells[0], + function(cell) { + if(cell.field.match(/^\+/)) cell.nonSelectable=true; + } + ); + var storeData; if(type == 'bib') storeData = vqbr.toStoreData(queuedRecords); @@ -688,8 +716,10 @@ function vlDeleteQueue(type, queueId, onload) { function vlQueueGridDrawSelectBox(rowIdx, item) { - if(!item) return ''; - var id = this.grid.store.getValue(item, 'id'); + return item && this.grid.store.getValue(item, 'id'); +} + +function vlQueueGridFormatSelectBox(id) { var domId = 'vl-record-list-selected-' + id; selectableGridRecords[domId] = id; return "
"; diff --git a/Open-ILS/web/templates/default/vandelay/inc/matches.tt2 b/Open-ILS/web/templates/default/vandelay/inc/matches.tt2 index cead655c3a..3c43bbb716 100644 --- a/Open-ILS/web/templates/default/vandelay/inc/matches.tt2 +++ b/Open-ILS/web/templates/default/vandelay/inc/matches.tt2 @@ -7,8 +7,11 @@ { name: '&vandelay.overlay.target;', get: vlGetOverlayTargetSelector, + formatter : vlFormatOverlayTargetSelector, + /* value: '<input type="checkbox" name="vl-overlay-target-RECID" '+ 'onclick="vlHandleOverlayTargetSelected(ID, GRIDID);" gridid="GRIDID" match="ID"/>' + */ }, {name:'&vandelay.source.match.point;', field:'src_matchpoint'}, {name:'&vandelay.dest.match.point;', field:'dest_matchpoint'}, diff --git a/Open-ILS/web/templates/default/vandelay/inc/queue.tt2 b/Open-ILS/web/templates/default/vandelay/inc/queue.tt2 index 4c35d5af85..64f483ec9d 100644 --- a/Open-ILS/web/templates/default/vandelay/inc/queue.tt2 +++ b/Open-ILS/web/templates/default/vandelay/inc/queue.tt2 @@ -1,4 +1,4 @@ - +

&vandelay.record.queue;


@@ -9,37 +9,9 @@
- -
+
+
@@ -109,24 +81,83 @@
- + + + +