Rework online resource display to not show results for records with ISSNs
authordbs <dbs@6d9bc8c9-1ec2-4278-b937-99fde70a366f>
Mon, 13 Sep 2010 20:28:33 +0000 (20:28 +0000)
committerdbs <dbs@6d9bc8c9-1ec2-4278-b937-99fde70a366f>
Mon, 13 Sep 2010 20:28:33 +0000 (20:28 +0000)
TODO: Pull ResolverResolver into the mix

git-svn-id: svn://svn.open-ils.org/ILS-Contrib/conifer/branches/rel_1_6_1@991 6d9bc8c9-1ec2-4278-b937-99fde70a366f

web/opac/skin/lul/xml/result/result_table.xml

index 59d4fbf..2df62bd 100644 (file)
                <tr name="local_callnumber_list" class="result_table_title_cell hide_me">
                        <td colspan="2">&result.localCallNumbers;
                                <!-- Prevent records with dozens of items attached from filling the screen -->
-                               <span type='opac/slot-data+marcxml-full' query='volumes'>
+                               <span type='opac/slot-data+marcxml-full' query='record'>
                                        <span class='hide_me' debug='true' type='opac/slot-format'><![CDATA[
-                                               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;
-                                                       }
-                                                       dojo.query('copy', vol).forEach(function (cp) {
-                                                               if (cp.getAttribute('deleted') == 't') {
-                                                                       return;
+                                               dojo.query('volumes', item).forEach(function(volume) {
+                                                       var item_cnt = 0;
+                                                       var max_items = 4;
+
+                                                       dojo.query('volume', volume).forEach(function(vol) {
+                                                               if (item_cnt >= max_items) {
+                                                                       return output.innerHTML;
                                                                }
-                                                               var loc_id;
-                                                               var vol_appended = false;
-                                                               dojo.query('location', cp).forEach(function (location) {
-                                                                       loc_id = parseInt(location.getAttribute('ident'));
-                                                                       if (loc_id != 8 && loc_id != 20) {
-                                                                               if (!vol_appended) {
-                                                                                       dojo.create('b', { "innerHTML": vol.getAttribute('label') }, output);
-                                                                                       vol_appended = true;
+                                                               dojo.query('copy', vol).forEach(function (cp) {
+                                                                       if (cp.getAttribute('deleted') == 't') {
+                                                                               return;
+                                                                       }
+                                                                       var loc_id;
+                                                                       var vol_appended = false;
+                                                                       dojo.query('location', cp).forEach(function (location) {
+                                                                               loc_id = parseInt(location.getAttribute('ident'));
+                                                                               if (loc_id != 8 && loc_id != 20) {
+                                                                                       if (!vol_appended) {
+                                                                                               dojo.create('b', { "innerHTML": vol.getAttribute('label') }, output);
+                                                                                               vol_appended = true;
+                                                                                       }
+                                                                                       var pfx = dojo.doc.createTextNode(' - ');
+                                                                                       output.appendChild(pfx);
+                                                                                       dojo.create('b', { "innerHTML": dojox.xml.parser.textContent(location) }, output);
                                                                                }
-                                                                               var pfx = dojo.doc.createTextNode(' - ');
+                                                                       });
+                                                                       if (loc_id == 8 || loc_id == 20) {
+                                                                               return;
+                                                                       }
+                                                                       dojo.query('status', cp).forEach(function (status) {
+                                                                               var pfx = dojo.doc.createTextNode(' (');
                                                                                output.appendChild(pfx);
-                                                                               dojo.create('b', { "innerHTML": dojox.xml.parser.textContent(location) }, output);
+                                                                               dojo.create('b', { "innerHTML": dojox.xml.parser.textContent(status) }, output);
+                                                                               var sfx = dojo.doc.createTextNode(')');
+                                                                               output.appendChild(sfx);
+                                                                       });
+                                                                       dojo.create('br', null, output);
+
+                                                                       item_cnt++;
+                                                                       if (item_cnt >= max_items) {
+                                                                               output.appendChild(dojo.doc.createTextNode('... more items in full record'));
                                                                        }
                                                                });
-                                                               if (loc_id == 8 || loc_id == 20) {
-                                                                       return;
-                                                               }
-                                                               dojo.query('status', cp).forEach(function (status) {
-                                                                       var pfx = dojo.doc.createTextNode(' (');
-                                                                       output.appendChild(pfx);
-                                                                       dojo.create('b', { "innerHTML": dojox.xml.parser.textContent(status) }, output);
-                                                                       var sfx = dojo.doc.createTextNode(')');
-                                                                       output.appendChild(sfx);
-                                                               });
-                                                               dojo.create('br', null, output);
-
-                                                               item_cnt++;
-                                                               if (item_cnt >= max_items) {
-                                                                       output.appendChild(dojo.doc.createTextNode('... more items in full record'));
-                                                               }
                                                        });
                                                });
-                                               return output.innerHTML;
+                                               dojo.query('volumes volume uris uri', item).forEach(function(link) {
+                                                       var found_issn = false;
+                                                       dojo.query('datafield[tag="022"]', item).forEach(function () {
+                                                               found_issn = true;
+                                                       });
+                                                       if (found_issn) {
+                                                               return;
+                                                       }
+                                                       var uri = new Object;
+                                                       uri.href = link.getAttribute('href');
+                                                       uri.label = link.getAttribute('label');
+                                                       uri.use = link.getAttribute('use_restriction');
+                                                       if (uri.href == uri.label) {
+                                                               if (uri.use && uri.use != uri.label) {
+                                                                       uri.label = uri.use;
+                                                                       uri.use = null;
+                                                               }
+                                                       }
+                                                       var link = dojo.create('a', {"class":"search_link", "href": uri.href});
+                                                       var link_text = dojo.doc.createTextNode(uri.label);
+                                                       link.appendChild(link_text);
+                                                       output.appendChild(link);
+
+                                                       if (uri.use) {
+                                                               var use_text = dojo.doc.createTextNode(' (' + uri.use + ')');
+                                                               output.appendChild(use_text);
+                                                       }
+                                                       dojo.create('br', null, output);
+                                               });
+                                               if (output) {
+                                                       return output.innerHTML;
+                                               }
                                        ]]></span>
                                </span>
 
-                               <!-- Be lenient in what we accept -->
-                       <span type='opac/slot-data+marcxml-full' query='volumes volume uris uri'>
-                               <span class='hide_me' type='opac/slot-format'><![CDATA[
-                                       var output = dojo.create('span'); 
-                                       var uri = new Object;
-                                       uri.href = item.getAttribute('href');
-                                       uri.label = item.getAttribute('label');
-                                       uri.use = item.getAttribute('use_restriction');
-                                       if (uri.href == uri.label) {
-                                               if (uri.use && uri.use != uri.label) {
-                                                       uri.label = uri.use;
-                                                       uri.use = null;
-                                               }
-                                       }
-                                       var link = dojo.create('a', {"class":"search_link", "href": uri.href});
-                                       var link_text = dojo.doc.createTextNode(uri.label);
-                                       link.appendChild(link_text);
-                                       output.appendChild(link);
-
-                                       if (uri.use) {
-                                               var use_text = dojo.doc.createTextNode(' (' + uri.use + ')');
-                                               output.appendChild(use_text);
-                                       }
-                                       dojo.create('br', null, output);
-                                       return output.innerHTML;
-                               ]]></span>
-                       </span>
-
                        </td>
                </tr>
 
                       style='padding-left: 40px;' >
                    <a class='search_page_nav_link' id='search_home_link2' 
                       title="&rdetail.page.results;">&rdetail.start;</a><a class='search_page_nav_link' 
-                      id='prev_link2' title='&rdetail.page.previous;'>&rdetail.page.previous.symbol; &rdetail.page.previous;</a>
+                      id='prev_link2' title='&rdetail.page.previous;'>&rdetail.page.previous.symbol;</a>
             
                    <span class='search_page_nav_link' id='page_numbers2'> </span>
                       <a  class='search_page_nav_link' id='next_link2' 
-                         title='&rdetail.page.next;'>&rdetail.page.next; &rdetail.page.next.symbol;</a>
+                         title='&rdetail.page.next;'>&rdetail.page.next.symbol;</a>
                       <!--
                       <a class='search_page_nav_link' 
                          id='end_link2' title="&rdetail.page.last;">&rdetail.end;</a>