[open-ils-commits] r13145 - in trunk/Open-ILS/web: js/ui/default/vandelay templates/default/vandelay/inc (erickson)

svn at svn.open-ils.org svn at svn.open-ils.org
Tue May 12 13:02:51 EDT 2009


Author: erickson
Date: 2009-05-12 13:02:48 -0400 (Tue, 12 May 2009)
New Revision: 13145

Modified:
   trunk/Open-ILS/web/js/ui/default/vandelay/vandelay.js
   trunk/Open-ILS/web/templates/default/vandelay/inc/matches.tt2
   trunk/Open-ILS/web/templates/default/vandelay/inc/queue.tt2
Log:
pile of dojo-1.3 compability fixes.  more to come

Modified: trunk/Open-ILS/web/js/ui/default/vandelay/vandelay.js
===================================================================
--- trunk/Open-ILS/web/js/ui/default/vandelay/vandelay.js	2009-05-12 14:48:35 UTC (rev 13144)
+++ trunk/Open-ILS/web/js/ui/default/vandelay/vandelay.js	2009-05-12 17:02:48 UTC (rev 13145)
@@ -516,14 +516,20 @@
 }
 
 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 '<a href="javascript:void(0);" onclick="vlLoadMatchUI(' + id + ');">' + this.name + '</a>';
+}
+
 function getAttrValue(rowIdx, item) {
     if(!item) return '';
     var attrCode = this.field.split('.')[1];
@@ -554,15 +560,27 @@
 }
 
 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 '<a href="javascript:void(0);" onclick="vlLoadMARCHtml(' + id + ', false, '+
+        'function(){displayGlobalDiv(\'vl-queue-div\');});">' + this.name + '</a>';
+}
+
 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 = '<input type="checkbox" name="vl-overlay-target-RECID" '+
+        'onclick="vlHandleOverlayTargetSelected(ID, GRIDID);" gridid="GRIDID" match="ID"/>';
+    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 @@
     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 @@
 }
 
 var valLastQueueType = null;
+var vlQueueGridLayout = null;
 function buildRecordGrid(type) {
     displayGlobalDiv('vl-queue-div');
 
@@ -618,9 +638,11 @@
         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 @@
         }
     }
 
+    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 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 "<div><input type='checkbox' id='"+domId+"'/></div>";

Modified: trunk/Open-ILS/web/templates/default/vandelay/inc/matches.tt2
===================================================================
--- trunk/Open-ILS/web/templates/default/vandelay/inc/matches.tt2	2009-05-12 14:48:35 UTC (rev 13144)
+++ trunk/Open-ILS/web/templates/default/vandelay/inc/matches.tt2	2009-05-12 17:02:48 UTC (rev 13145)
@@ -7,8 +7,11 @@
                 {
                     name: '&vandelay.overlay.target;', 
                     get: vlGetOverlayTargetSelector,
+                    formatter : vlFormatOverlayTargetSelector,
+                    /*
                     value: '&lt;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'},

Modified: trunk/Open-ILS/web/templates/default/vandelay/inc/queue.tt2
===================================================================
--- trunk/Open-ILS/web/templates/default/vandelay/inc/queue.tt2	2009-05-12 14:48:35 UTC (rev 13144)
+++ trunk/Open-ILS/web/templates/default/vandelay/inc/queue.tt2	2009-05-12 17:02:48 UTC (rev 13145)
@@ -1,4 +1,4 @@
-<table class='wide'>
+<table class='wide' dojoType="dijit.layout.ContentPane" layoutAlign='client'>
     <tr>
         <td align='left'>
             <h1>&vandelay.record.queue; <span style='font-style:italic;' id='vl-queue-summary-name'/></h1><br/>
@@ -9,37 +9,9 @@
         </td>
     </tr>
 </table>
-<script>
-    var vlQueueGridLayout;
-    function resetVlQueueGridLayout() {
-        vlQueueGridLayout = [{
-            cells : [[
-                {
-                    name: '&lt;input id="vl-queue-grid-row-selector" type="checkbox" onclick="vlToggleQueueGridSelect();"/>', 
-                    get: vlQueueGridDrawSelectBox, 
-                    styles : 'text-align: center;',
-                    nonSelectable : true
-                }, {   
-                    name: '&vandelay.view.marc;', 
-                    get: vlGetViewMARC, styles : 'text-align: center;',
-                    value: '&lt;a href="javascript:void(0);" onclick="vlLoadMARCHtml(RECID, false, '+
-                        'function(){displayGlobalDiv(\'vl-queue-div\');});">&vandelay.view.marc;&lt;/a>',
-                    nonSelectable : true
-                }, {   
-                    name: '&vandelay.matches;', 
-                    get: vlGetViewMatches, styles : 'text-align: center;',
-                    value:'&lt;a href="javascript:void(0);" onclick="vlLoadMatchUI(RECID);">&vandelay.matches;&lt;/a>',
-                    nonSelectable : true
-                }, {
-                    name: '&vandelay.import.time;', field:'import_time',  styles : 'text-align: center;',
-                    get:vlGetDateTimeField, 
-                }
-            ]]
-        }];
-    }
-</script>
+
+<br/>
 <div id='vl-queue-div-grid' class='tall' dojoType="dijit.layout.ContentPane" layoutAlign='client'>
-
     <!-- queue grid navigation row -->
     <div dojoType="dijit.layout.ContentPane" layoutAlign='client'>
         <table width='100%' style='margin-bottom:0px;'>
@@ -109,24 +81,83 @@
         </table>
     </div>
 
-    <!-- Queue Grid -->
+    <!-- Bib Queue Grid -->
     <div class='hidden tall' id='vl-bib-queue-grid-wrapper'>
         <div dojoType="openils.widget.GridColumnPicker" jsid="vlBibQueueGridMenu" style="display: none;" grid='vlBibQueueGrid'>
             <div dojoType="dojox.widget.PlaceholderMenuItem" label="GridColumns"></div>
         </div>
-        <div class='tall' dojoType="dijit.layout.ContentPane" layoutAlign='client'>
-            <table dojoType='dojox.grid.DataGrid' jsId='vlBibQueueGrid' query="{id:'*'}" headerMenu='vlBibQueueGridMenu'> 
+        <div class='tall' dojoType="dijit.layout.ContentPane" layoutAlign='client' style='border:1px solid #FFF;'>
+            <table dojoType='dojox.grid.DataGrid' jsId='vlBibQueueGrid' query="{import_time:'*'}" headerMenu='vlBibQueueGridMenu' style='height:600px;'>
+                <thead>
+                    <tr>
+                        <th 
+                            field='+row_selector'
+                            get='vlQueueGridDrawSelectBox'
+                            formatter='vlQueueGridFormatSelectBox'
+                            styles='text-align: center;'
+                            nonSelectable='true'>
+                                <input id="vl-queue-grid-row-selector" type="checkbox" onclick="vlToggleQueueGridSelect();"></input>
+                        </th>
+                        <th
+                            field='+view_marc'
+                            get='vlGetViewMARC'
+                            formatter='vlFormatViewMARC' 
+                            styles='text-align: center;'
+                            nonSelectable='true'>&vandelay.view.marc;</th>
+                        <th
+                            field='+get_matches'
+                            get='vlGetViewMatches'
+                            formatter='vlFormatViewMatches'
+                            styles='text-align: center;'
+                            nonSelectable='true'>&vandelay.matches;</th>
+                        <th
+                            field='import_time'
+                            styles='text-align: center;'
+                            get='vlGetDateTimeField'>&vandelay.import.time;</th>
+                    </tr>
+                </thead>
             </table>
         </div>
     </div>
+
+    <!-- Auth Queue Grid -->
     <div class='hidden' id='vl-auth-queue-grid-wrapper'>
         <div dojoType="openils.widget.GridColumnPicker" jsid="vlAuthQueueGridMenu" style="display: none;" grid='vlAuthQueueGrid'>
             <div dojoType="dojox.widget.PlaceholderMenuItem" label="GridColumns"></div>
         </div>
         <div class='tall' dojoType="dijit.layout.ContentPane" layoutAlign='client'>
             <table dojoType='dojox.grid.DataGrid' jsId='vlAuthQueueGrid' query="{id:'*'}" headerMenu='vlAuthQueueGridMenu'> 
+                <thead>
+                    <tr>
+                        <th 
+                            field='+row_selector'
+                            get='vlQueueGridDrawSelectBox'
+                            formatter='vlQueueGridFormatSelectBox'
+                            styles='text-align: center;'
+                            nonSelectable='true'>
+                                <input id="vl-queue-grid-row-selector" type="checkbox" onclick="vlToggleQueueGridSelect();"></input>
+                        </th>
+                        <th
+                            field='+view_marc'
+                            get='vlGetViewMARC'
+                            formatter='vlFormatViewMARC' 
+                            styles='text-align: center;'
+                            nonSelectable='true'>&vandelay.view.marc;</th>
+                        <th
+                            field='+get_matches'
+                            get='vlGetViewMatches'
+                            formatter='vlFormatViewMatches'
+                            styles='text-align: center;'
+                            nonSelectable='true'>&vandelay.matches;</th>
+                        <th
+                            field='import_time'
+                            styles='text-align: center;'
+                            get='vlGetDateTimeField'>&vandelay.import.time;</th>
+                    </tr>
+                </thead>
             </table>
         </div>
     </div>
+
 </div>
 



More information about the open-ils-commits mailing list