shading sfx info, bringing status to results screen
authorartunit <artunit@6d9bc8c9-1ec2-4278-b937-99fde70a366f>
Sat, 18 Sep 2010 03:50:15 +0000 (03:50 +0000)
committerartunit <artunit@6d9bc8c9-1ec2-4278-b937-99fde70a366f>
Sat, 18 Sep 2010 03:50:15 +0000 (03:50 +0000)
git-svn-id: svn://svn.open-ils.org/ILS-Contrib/conifer/branches/rel_1_6_1@998 6d9bc8c9-1ec2-4278-b937-99fde70a366f

web/opac/skin/uwin/css/layout.css
web/opac/skin/uwin/xml/rdetail/rdetail_summary.xml
web/opac/skin/uwin/xml/result/result_table.xml

index c2b590a..5523aa7 100644 (file)
@@ -112,6 +112,7 @@ table { border-collapse: collapse; }
 .result_table_subtbody { height: 100%; width: 100%; }
 /* make title slightly larger */
 .result_table_title_cell { font-weight: bold; text-align: left; }
+.result_table_sfx_cell {  background: #EBEBEB;  font-weight: bold; text-align: left; }
 .result_table_format_cell { font-size: medium; text-align: left;} 
 
 /* style dan's supercool live status stuff */
index 9d2369f..397b97e 100644 (file)
@@ -91,7 +91,7 @@
                        </tr>
                        <tr class='hide_me' id='tag022'>
                                <td nowrap='nowrap' class='rdetail_desc' id='issn_title'>&common.issn;</td>                     
-                               <td type='opac/slot-data' query='datafield[tag=022]' class='rdetail_item' id='rdetail_issn'>
+                               <td type='opac/slot-data' query='datafield[tag=022]' class='rdetail_ite' id='rdetail_issn'>
                                    <script type='opac/slot-format'><![CDATA[
                                        dojo.query('#tag022').removeClass('hide_me');
                                        var issn_raw = dojo.trim(dojox.data.dom.textContent(item));
                                                        //uwin has a lot of duplicates for some reason
                                                        if (url_list.indexOf(resolverInfo) == -1) {
                                                                if (first_issn) {
-                                                                       dojo.query('#rdetail_online *').orphan();
+                                                                       dojo.query('#rdetail_sfx *').orphan();
                                                                        first_issn = false;
                                                                }
 
                                                                        + '">' + entry.public_name + '</a> - '
                                                                        + entry.target_coverage 
                                                                        + (entry.target_embargo ? (' / ' + entry.target_embargo) : '') 
-                                                                       + '</div>', 'rdetail_online');
-                                                               dojo.query('#rdetail_online_row').removeClass('hide_me');
+                                                                       + '</div>', 'rdetail_sfx');
+                                                               dojo.query('#rdetail_sfx_row').removeClass('hide_me');
                                                                url_list += resolverInfo;
                                                        }//if url_list
                                                });
                                ]]></script>
                        </td>
                </tr>
+                <tr id='rdetail_sfx_row' class="hide_me">
+                               <td nowrap='nowrap' class='rdetail_desc'>SFX</td>
+                        <!-- *** Example of how to use the openils.BibTemplate infrastructure to augment the stock
+                             *** summary screen with complex information, such as location-specific URIs (856$9). -->
+                        <td class='rdetail_item result_table_sfx_cell' id='rdetail_sfx'>
+                        </td>
+                </tr>
                <tr class='hide_me' id='rdetail_online_row'>
                        <!-- *** Example of how to use the openils.BibTemplate infrastructure to augment the stock
                             *** summary screen with complex information, such as location-specific URIs (856$9). -->
index 762bd01..8d31f29 100644 (file)
                                                                </td>
                                                        </tr>
 
+
+                <tr id='rdetail_online_row' class="result_table_sfx_cell hide_me">
+                        <!-- *** Example of how to use the openils.BibTemplate infrastructure to augment the stock
+                             *** summary screen with complex information, such as location-specific URIs (856$9). -->
+                        <td class='rdetail_item' id='rdetail_online'> 
+                        </td>
+                </tr>
+
                <tr name="local_callnumber_list" class="result_table_title_cell hide_me">
                        <td colspan="1">&result.localCallNumbers;
+                               <span 
+                                       type='opac/slot-data' query='datafield[tag=022]' class='hide_me'>
+                                       <!--
+                                       type='opac/slot-data' query='datafield[tag=022]' class='hide_me'>
+                                       type='opac/slot-data' query='datafield[tag=022] subfield[code=a]'>
+                                       -->
+                                       <span class='hide_me' debug='true' type='opac/slot-format'><![CDATA[
+                                               var output = dojo.create('span'); 
+                                               var list = dojo.query( 'subfield:[code=a]', item );
+                                               var text = '';
+                                               for (var i =0; i < list.length; i++) {
+                                                       //text += dojox.data.dom.textContent(list[i]) + ' ';
+                                                       var issn = dojox.data.dom.textContent(list[i]) + '';
+                                                       issn = issn.replace(/^(\s|.)*?(\d{4}).(\d{3,4}[xX]?)(\s|.)*/, "$2-$3");
+                                                       /*
+                                                       */
+                                                       if (issn.length> 0) {
+                                                       var ses = new OpenSRF.ClientSession('open-ils.resolver');
+                                                       var req = ses.request('open-ils.resolver.resolve_holdings.raw', 'issn', issn, 'http://sfx.scholarsportal.info/windsor');
+                                                       req.oncomplete = function(r) {
+
+                                                       dojo.forEach(r.recv().content(), function(entry) {
+                                                               var resolverInfo = entry.public_name + "_" + entry.target_coverage;
+                                                               if (url_list.indexOf(resolverInfo) == -1) {
+                                                                       url_list += resolverInfo;
+                                                               try {
+                                                               /*
+                                                                dojo.place('<div style="width: 100%">'
+                                                                        + ' <a class="search_link" href="' + entry.target_url
+                                                                        + '">' + entry.public_name + '</a> - '
+                                                                        + entry.target_coverage
+                                                                        + (entry.target_embargo ? (' / ' + entry.target_embargo) : '')
+                                                                        + '</div>', 'rdetail_online');
+                                                               */
+                                                               /*
+                                                               dojo.create('div',{ innerHTML: ' <a class=\"search_link\" href=\"' + entry.target_url
+                                                                        + '\">' + entry.public_name + '</a> - '
+                                                                        + entry.target_coverage
+                                                                        + (entry.target_embargo ? (' / ' + entry.target_embargo) : '')
+                                                                       },'rdetail_online',"replace");
+                                                               */
+                                                               var output = dojo.create('div',null,'rdetail_online',"first");
+                                                               var link = dojo.create('a', {"class":"search_link", "href":  entry.target_url});
+                                                               var link_text = dojo.doc.createTextNode(entry.public_name);
+                                                               link.appendChild(link_text);
+                                                               output.appendChild(link);
+                                                               var coverage_text = dojo.doc.createTextNode(' - ' + entry.target_coverage
+                                                                       + (entry.target_embargo ? (' / ' + entry.target_embargo) : ''));
+                                                               output.appendChild(coverage_text);
+
+                                                               
+                                                               /*
+                                                                       },'rdetail_online',"first");
+                                                                dojo.query('#rdetail_online_row').removeClass('hide_me');
+                                                               */
+                                                                dojo.query('#rdetail_online_row').removeClass('hide_me');
+                                                               } catch (e) {
+                                                                       alert("-> " + e);
+                                                               }
+
+                                                               }
+                                                       });
+                                                       }
+                                                       req.send();
+                                                       }
+                                               }
+                                               return '<span> ' + issn + '</span><br/>';
+                                       ]]></span>
+                               </span>
                                <!-- Prevent records with dozens of items attached from filling the screen -->
                                <span type='opac/slot-data+marcxml-full' query='volumes'>
                                        <span class='hide_me' debug='true' type='opac/slot-format'><![CDATA[
+                                               var output = dojo.create('span'); 
+
                                                var item_cnt = 0;
                                                var max_items = 4;
 
-                                               var output = dojo.create('span'); 
 
+                                               /*
+                                               */
+
+                                               /*
+                                               */
                                                dojo.query('volume', item).forEach(function(vol) {
                                                        if (item_cnt >= max_items) {
                                                                return output.innerHTML;
                                                                                                output);
                                                                                        vol_appended = true;
                                                                                }
-                                                                               /*
-                                                                               var pfx = dojo.doc.createTextNode(' - ');
-                                                                               output.appendChild(pfx);
-                                                                               */
                                                                                dojo.create('span', { className: 'live_separator_cell',
                                                                                                "innerHTML": ' - '}, 
                                                                                        output);
                                                                }
                                                        });
                                                });
-                                               return output.innerHTML;
+
+                                               //if (issn.length == 0)
+                                                       return output.innerHTML;
                                        ]]></span>
                                </span>
 
                config.names.result.format_cell = 'result_table_format_cell';
                config.names.result.format_link = 'resource_link'
                config.names.result.format_pic = 'format_pic'
+               var url_list = "";
+
        </script>
 
 </div>