TTpac: Capture and show all ISBNs on record details page
authorBill Erickson <berick@esilibrary.com>
Wed, 10 Aug 2011 19:22:46 +0000 (15:22 -0400)
committerBill Erickson <berick@esilibrary.com>
Wed, 10 Aug 2011 19:22:46 +0000 (15:22 -0400)
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Open-ILS/web/templates/default/opac/parts/misc_util.tt2
Open-ILS/web/templates/default/opac/parts/record/summary.tt2
Open-ILS/web/templates/default/opac/parts/result/table.tt2

index 0a24b28..03382de 100644 (file)
@@ -3,7 +3,12 @@
     #   get_marc_attrs( { marc_xml => doc } )
     BLOCK get_marc_attrs;
         xml = args.marc_xml;
-        args.isbn = xml.findnodes('//*[@tag="020"]/*[@code="a"]').shift.textContent;
+
+        args.isbns = [];
+        FOR isbn IN xml.findnodes('//*[@tag="020"]/*[@code="a"]');
+            args.isbns.push(isbn.textContent);
+        END;
+
         args.upc = xml.findnodes('//*[@tag="024"]/*[@code="a"]').textContent;
         args.issn = xml.findnodes('//*[@tag="022"]/*[@code="a"]').textContent;
         args.title = xml.findnodes('//*[@tag="245"]/*[@code="a"]').textContent;
@@ -30,7 +35,7 @@
         args.marc_cn = xml.findnodes('//*[@tag="092" or @tag="099"]/*').textContent;
 
         # clean up the ISBN
-        args.isbn_clean = args.isbn.replace('\ .*', '');
+        args.isbn_clean = args.isbns.0.replace('\ .*', '');
 
         args.holdings = [];
         FOR holding IN xml.findnodes('//*[local-name()="volumes"]/*[local-name()="volume"]');
index 96748e4..2473bc4 100644 (file)
                     <table border="0" cellpadding="0" width="100%">
                         <tr>
                             <td nowrap='nowrap' valign="top">
-                                [% IF attrs.isbn %]<strong id="rdetail_isbn_lbl">[% l("ISBN") %]</strong>[% END %]
+                                [% IF attrs.isbns.0 %]<strong id="rdetail_isbn_lbl">[% l("ISBN") %]</strong>[% END %]
+                            </td>
+                            <td valign="top" id='rdetail_isbn'>
+                                [% FOR isbn IN attrs.isbns %][% IF !loop.first; %]<br/>[% END; isbn; END %]
                             </td>
-                            <td valign="top" id='rdetail_isbn'>[% attrs.isbn %]</td>
                             <td nowrap='nowrap' valign="top">
                                 [% IF attrs.phys_desc %]<strong id="rdetail_phys_lbl">[% l("Physical Description") %]</strong>[% END %]
                             </td>
index 6fc3b2e..b79a536 100644 (file)
                                                             </td>
                                                             <td>[% attrs.publisher; %]</td>
                                                         </tr>
-                                                        <tr name="results_isbn_tr" class="[% attrs.isbn ? '' : 'hide_me' %]">
+                                                        <tr name="results_isbn_tr" class="[% attrs.isbns.0 ? '' : 'hide_me' %]">
                                                             <td valign="top">
                                                                 <strong>[% l('ISBN:') %]</strong>
                                                             </td>
-                                                            <td>[% attrs.isbn %]</td>
+                                                            <td>[% attrs.isbns.0 %]</td>
                                                         </tr>
                                                         <tr name="results_edition_tr" class="[% attrs.edition ? '' : 'hide_me' %]">
                                                             <td valign="top">