Extracted MVLC TPac customizations user/tsbere/tpac_custs
authorThomas Berezansky <tsbere@mvlc.org>
Mon, 15 Oct 2012 19:22:41 +0000 (15:22 -0400)
committerThomas Berezansky <tsbere@mvlc.org>
Mon, 15 Oct 2012 19:22:41 +0000 (15:22 -0400)
Or at least some of them.

Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
Open-ILS/src/templates/opac/parts/misc_util.tt2
Open-ILS/src/templates/opac/parts/record/summary.tt2
Open-ILS/src/templates/opac/parts/result/table.tt2

index c188e97..ae73fd7 100644 (file)
         FOR sub IN xml.findnodes('//*[@tag="100"]/*[@code="a"]');
             args.authors.push(sub.textContent);
         END;
+        FOR sub IN xml.findnodes('//*[@tag="110"]/*[@code="a"]');
+            args.authors.push(sub.textContent);
+        END;
+        FOR sub IN xml.findnodes('//*[@tag="111"]/*[@code="a"]');
+            args.authors.push(sub.textContent);
+        END;
         args.author = (args.authors.size) ? args.authors.0 : '';
 
         # Include subfields 'abnp' to generate a more comprehensive title display in search results
-        titresults = xml.findnodes('//*[@tag="245"]/*[@code="a" or @code="b" or @code="n" or @code="p"]');
+        # MVLC added subfield s because our members want to see things like "widescreen" for some reason, and h for "electronic resource" stuff
+        titresults = xml.findnodes('//*[@tag="245"]/*[@code="a" or @code="b" or @code="n" or @code="p" or @code="s" or @code="h"]');
         titresults_content = [];
             FOR sub IN titresults; titresults_content.push(sub.textContent); END;
         args.title = titresults_content.join(" ");
         END;
         args.edition = (args.editions.size) ? args.editions.0 : '';
 
+        args.notes = [];
+        FOR sub IN xml.findnodes('//*[@tag="500"]/*[@code="a"]');
+            args.notes.push(sub.textContent);
+        END;
+        args.note = (args.notes.size) ? args.notes.0 : '';
+
+        args.performers = [];
+        FOR sub IN xml.findnodes('//*[@tag="511"]/*[@code="a"]');
+            args.performers.push(sub.textContent);
+        END;
+        args.performer = (args.performers.size) ? args.performers.0 : '';
+
+        args.audiences = [];
+        FOR sub IN xml.findnodes('//*[@tag="521"]/*[@code="a"]');
+            args.audiences.push(sub.textContent);
+        END;
+        args.audience = (args.audiences.size) ? args.audiences.0 : '';
+
+        args.sysdetails_hunt = [];
+        FOR sub IN xml.findnodes('//*[@tag="538"]/*[@code="a"]');
+            args.sysdetails_hunt.push(sub.textContent);
+        END;
+        args.sysdetails = (args.sysdetails_hunt.size) ? args.sysdetails_hunt.0 : '';
+
+        args.languages = [];
+        FOR sub IN xml.findnodes('//*[@tag="546"]/*[@code="a"]');
+            args.languages.push(sub.textContent);
+        END;
+        args.language = (args.languages.size) ? args.languages.0 : '';
+
         phys_content = [];
         FOR sub IN xml.findnodes(
             '//*[@tag="300"]/*[@code="a" or @code="b" or @code="c" or @code="e"]'
index b750df6..e6f1293 100644 (file)
@@ -104,21 +104,6 @@ IF num_uris > 0;
     [%- IF num_uris > 1 %]</ul>[% END %]
 </div>
 [%- END %]
-[%- # Hold/copy summary
-    IF ctx.copy_summary.0.count
-%]
-<div id="copy_hold_counts">
-[%- INCLUDE "opac/parts/record/copy_counts.tt2" %]
-    <span id="rdetail_hold_counts">
-        <h2>[% l('Current holds') %]</h2>
-        <p>
-            [%- l("[quant,_1,current hold,current holds] with [quant,_2,total copy,total copies].", 
-                ctx.record_hold_count, ctx.copy_summary.0.count) %]
-        </p>
-    </span>
-[%- INCLUDE "opac/parts/record/copy_table.tt2" copies=ctx.copies %]
-</div>
-[%- END %]
 
 <h2 id='rdetail_record_details'>[% l("Record details") %]</h2>
 <ul>
@@ -164,6 +149,66 @@ IF num_uris > 0;
     [%- END %]
 </ul>
 
+[%- IF attrs.summary || attrs.note || attrs.performer || attrs.audience || attrs.sysdetails || attrs.language %]
+<h2 id='rdetail_extra_500s_h2'>[% l('Additional Information') %]</h2>
+<ul>
+    [%- IF attrs.summary %]
+    <li>
+        <strong class='rdetail_label'>[% l('Summary:') %]</strong>
+        <span class='rdetail_value'>[% attrs.summary | html %]</span>
+    </li>
+    [%- END %]
+    [%- IF attrs.note %]
+    <li>
+        <strong class='rdetail_label'>[% l('Note:') %]</strong>
+        <span class='rdetail_value'>[% attrs.note | html %]</span>
+    </li>
+    [%- END %]
+    [%- IF attrs.performer %]
+    <li>
+        <strong class='rdetail_label'>[% l('Performer:') %]</strong>
+        <span class='rdetail_value'>[% attrs.performer | html %]</span>
+    </li>
+    [%- END %]
+    [%- IF attrs.audience %]
+    <li>
+        <strong class='rdetail_label'>[% l('Audience:') %]</strong>
+        <span class='rdetail_value'>[% attrs.audience | html %]</span>
+    </li>
+    [%- END %]
+    [%- IF attrs.sysdetails %]
+    <li>
+        <strong class='rdetail_label'>[% l('System Details') %]</strong>
+        <span class='rdetail_value'>[% attrs.sysdetails | html %]</span>
+    </li>
+    [%- END %]
+    [%- IF attrs.language %]
+    <li>
+        <strong class='rdetail_label'>[% l('Language:') %]</strong>
+        <span class='rdetail_value'>[% attrs.language | html %]</span>
+    </li>
+    [%- END %]
+</ul>
+[%- END %]
+
+[%- # Hold/copy summary
+    IF ctx.copy_summary.0.count
+%]
+<div id="copy_hold_counts">
+[%- INCLUDE "opac/parts/record/copy_counts.tt2" %]
+    <span id="rdetail_hold_counts">
+        <h2>[% l('Current holds') %]</h2>
+        <p>
+            [%- l("[quant,_1,current hold,current holds] with [quant,_2,total copy,total copies].", 
+                ctx.record_hold_count, ctx.copy_summary.0.count) %]
+        </p>
+    </span>
+[%- INCLUDE "opac/parts/record/copy_table.tt2" copies=ctx.copies %]
+</div>
+[%- END %]
+
+</div>
+
 [%- INCLUDE "opac/parts/record/subjects.tt2" %]
 [%- INCLUDE "opac/parts/record/series.tt2" %]
 [%- INCLUDE "opac/parts/record/extras.tt2" %]
index 48f8be0..6ccf63f 100644 (file)
                                                     </div>
                                                     <table cellpadding="0" cellspacing="0" border="0"
                                                         class="results_info_table">
-                                                        [% IF args.holdings.size > 0 %]
-                                                        <tr name='bib_cn_list' class='result_table_title_cell'>
-                                                            <td valign='top'>
-                                                                <strong>[% l('Call number:') %]</strong>
-                                                            </td>
-                                                            <td>[% args.holdings.0.label | html %]</td>
-                                                        </tr>
+                                                        [% IF attrs.summary %]
+                                                            <tr name="results_summary_tr">
+                                                                <td valign="top">
+                                                                    <strong>[% l('Summary:') %]</strong>
+                                                                </td>
+                                                                <td>[% attrs.summary | html %]</td>
+                                                            </tr>
+                                                        [% END %]
+                                                        [% IF attrs.phys_desc %]
+                                                            <tr name="results_phys_desc_tr">
+                                                                <td nowrap="nowrap" valign="top">
+                                                                    <strong>[% l('Phys. Desc.:') %]</strong>
+                                                                </td>
+                                                                <td>
+                                                                    [% args.phys_desc | html %]
+                                                                </td>
+                                                            </tr>
                                                         [% END %]
-
                                                         [% IF CGI.param('detail_record_view') %]
                                                         <!-- These fields are visible when viewing the results page in 'detailed' mode -->
 
                                                                 <td>[% attrs.edition | html %]</td>
                                                             </tr>
                                                         [% END %]
-                                                        [% IF attrs.phys_desc %]
-                                                            <tr name="results_phys_desc_tr">
-                                                                <td nowrap="nowrap" valign="top">
-                                                                    <strong>[% l('Phys. Desc.:') %]</strong>
-                                                                </td>
-                                                                <td>
-                                                                    [% args.phys_desc | html %]
-                                                                </td>
-                                                            </tr>
-                                                        [% END %]
                                                         [% FOR uri IN args.uris %]
                                                             <tr name='bib_uri_list' class='result_table_title_cell'>
                                                                 <td valign='top'>
                                                                     <table class='result_holdings_table'>
                                                                         <thead><tr>
                                                                             <th>[% l('Library') %]</th>
-                                                                            <th>[% l('Shelving location') %]</th>
+                                                                            <th>[% l('Collection') %]</th>
                                                                             <th>[% l('Call number') %]</th>
                                                                             [%- IF has_parts == 'true'; %]
                                                                             <th>[% l('Part') %]</th>