[open-ils-commits] [GIT] Evergreen ILS branch master updated. 3290c8297054c7e9376f3864e219f25197a543b8

Evergreen Git git at git.evergreen-ils.org
Fri Dec 23 08:49:38 EST 2011


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, master has been updated
       via  3290c8297054c7e9376f3864e219f25197a543b8 (commit)
      from  91c31e5eb7e1afcca2f020770c89bc3776696b11 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 3290c8297054c7e9376f3864e219f25197a543b8
Author: Dan Scott <dan at coffeecode.net>
Date:   Fri Dec 23 01:56:02 2011 -0500

    TPAC: Display monograph parts
    
    In search results and record details, display monograph parts if
    associated with a copy. Uses unapi for search results and json_query for
    record details. Only generates the "Part" column in the copy table if
    that record actually has a monograph part; otherwise the column is not
    generated.
    
    Signed-off-by: Dan Scott <dan at coffeecode.net>
    Signed-off-by: Thomas Berezansky <tsbere at mvlc.org>

diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm
index 113da1d..97a6fa5 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm
@@ -37,7 +37,7 @@ sub load_record {
         $self->mk_copy_query($rec_id, $org, $depth, $copy_limit, $copy_offset)
     );
 
-    my (undef, @rec_data) = $self->get_records_and_facets([$rec_id], undef, {flesh => '{holdings_xml,mra,acp,acnp,acns}'});
+    my (undef, @rec_data) = $self->get_records_and_facets([$rec_id], undef, {flesh => '{holdings_xml,bmp,mra,acp,acnp,acns}'});
     $ctx->{bre_id} = $rec_data[0]->{id};
     $ctx->{marc_xml} = $rec_data[0]->{marc_xml};
 
@@ -159,6 +159,9 @@ sub mk_copy_query {
             acns => [
                 {column => 'label', alias => 'call_number_suffix_label'},
                 {column => 'id', alias => 'call_number_suffix'}
+            ],
+            bmp => [
+                {column => 'label', alias => 'part_label'},
             ]
         },
 
@@ -177,7 +180,13 @@ sub mk_copy_query {
                 },
                 acpl => {},
                 ccs => {},
-                aou => {}
+                aou => {},
+                acpm => {
+                    type => 'left',
+                    join => {
+                        bmp => { type => 'left' }
+                    }
+                }
             }
         },
 
diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Search.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Search.pm
index f803f7f..0db757b 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Search.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Search.pm
@@ -285,7 +285,7 @@ sub load_rresults {
     my ($facets, @data) = $self->get_records_and_facets(
         $rec_ids, $results->{facet_key}, 
         {
-            flesh => '{holdings_xml,mra,acp,acnp,acns}',
+            flesh => '{holdings_xml,mra,acp,acnp,acns,bmp}',
             site => $site,
             depth => $depth
         }
@@ -400,7 +400,7 @@ sub item_barcode_shortcut {
         }
 
         my ($facets, @data) = $self->get_records_and_facets(
-            $rec_ids, undef, {flesh => "{holdings_xml,mra,acnp,acns}"}
+            $rec_ids, undef, {flesh => "{holdings_xml,mra,acnp,acns,bmp}"}
         );
 
         $self->ctx->{records} = [@data];
diff --git a/Open-ILS/src/templates/opac/parts/misc_util.tt2 b/Open-ILS/src/templates/opac/parts/misc_util.tt2
index bb3857a..b18e678 100644
--- a/Open-ILS/src/templates/opac/parts/misc_util.tt2
+++ b/Open-ILS/src/templates/opac/parts/misc_util.tt2
@@ -124,6 +124,11 @@
             ELSE;
                 copies = volume.findnodes('./*[local-name()="copies"]/*[local-name()="copy"]');
                 FOR copy IN copies;
+                    parts = copy.findnodes('./*[local-name()="monograph_parts"]/*[local-name()="monograph_part"]');
+                    FOREACH part IN parts;
+                        part_label = part.getAttribute('label');
+                        LAST IF part_label != '';
+                    END;
                     # Check copy visibility
                     cp.deleted = copy.getAttribute('deleted');    
                     cp.visible = copy.getAttribute('opac_visible');
@@ -147,12 +152,14 @@
 
                     holding = {
                         label => vol.label,
+                        part_label => part_label,
                         location => loc.textContent,
                         library => circlib.textContent,
                         status => status.textContent
                         barcode => copy.getAttribute('barcode')
                     };
                     args.holdings.push(holding);
+                    part_label = '';
                 END;
             END;
         END;
diff --git a/Open-ILS/src/templates/opac/parts/record/copy_table.tt2 b/Open-ILS/src/templates/opac/parts/record/copy_table.tt2
index 4255e13..f6af5b1 100644
--- a/Open-ILS/src/templates/opac/parts/record/copy_table.tt2
+++ b/Open-ILS/src/templates/opac/parts/record/copy_table.tt2
@@ -1,8 +1,19 @@
+[%-
+FOREACH copy_info IN ctx.copies;
+    IF copy_info.part_label != '';
+        has_parts = 'true';
+        LAST;
+    END;
+END;
+%]
 <table cellpadding="0" cellspacing="0" border="0" width="100%" id="rdetails_status">
     <thead>
         <tr>
             <th id='copy_header_library'>[% l("Location") %]</th>
             <th id='copy_header_callnmber'>[% l("Call Number") %]</th>
+            [%- IF has_parts == 'true' %]
+            <th id='copy_header_part'>[% l("Part") %]</th>
+            [%- END %]
             <th id='copy_header_barcode'>[% l("Barcode") %]</th>
             <th id='copy_header_shelfloc'>[% l("Shelving Location") %]</th>
             [%- IF ctx.is_staff %]
@@ -38,6 +49,9 @@
             -%]
             </td>
             <td header='copy_header_callnumber'>[% callnum | html %]</td>
+            [%- IF has_parts == 'true' %]
+            <td header='copy_header_part'>[% copy_info.part_label | html %]</td>
+            [%- END %]
             <td header='copy_header_barcode'>[% copy_info.barcode | html %]</td>
             <td header='copy_header_shelfloc'>[% copy_info.copy_location | html %]</td>
             [%- IF ctx.is_staff %]
diff --git a/Open-ILS/src/templates/opac/parts/result/table.tt2 b/Open-ILS/src/templates/opac/parts/result/table.tt2
index 83a877f..a5a9ea3 100644
--- a/Open-ILS/src/templates/opac/parts/result/table.tt2
+++ b/Open-ILS/src/templates/opac/parts/result/table.tt2
@@ -132,7 +132,14 @@
                                                                 <td><a href="[% uri.href %]">[% uri.link | html %]</a>[% ' - ' _ uri.note | html IF uri.note %]</td>
                                                             </tr>
                                                             [% END %]
-                                                            [% IF args.holdings.size > 0 %]
+                                                            [%- IF args.holdings.size > 0;
+                                                                FOREACH copy IN args.holdings;
+                                                                    IF copy.part_label != '';
+                                                                        has_parts = 'true';
+                                                                        LAST;
+                                                                    END;
+                                                                END;
+                                                            %]
                                                             <tr name='bib_cn_list' class='result_table_title_cell'>
                                                                 <td colspan='2'>
                                                                     <table class='result_holdings_table'>
@@ -140,6 +147,9 @@
                                                                             <th>[% l('Library') %]</th>
                                                                             <th>[% l('Shelving location') %]</th>
                                                                             <th>[% l('Call number') %]</th>
+                                                                            [%- IF has_parts == 'true'; %]
+                                                                            <th>[% l('Part') %]</th>
+                                                                            [%- END %]
                                                                             <th>[% l('Status') %]</th>
                                                                         </tr></thead>
                                                                         <tbody>
@@ -148,6 +158,9 @@
                                                                             <td>[% copy.library | html %]</td>
                                                                             <td>[% copy.location | html %]</td>
                                                                             <td>[% copy.label | html %]</td>
+                                                                            [%- IF has_parts == 'true'; %]
+                                                                            <td>[% copy.part_label %]</td>
+                                                                            [%- END %]
                                                                             <td>[% copy.status | html %]</td>
                                                                         </tr>
                                                                 [% END %]
@@ -155,7 +168,9 @@
                                                                     </table>
                                                                 </td>
                                                             </tr>
-                                                        [% END %]
+                                                            [%- has_parts = 'false';
+                                                                END;
+                                                             %]
                                                         [% END %] <!-- END detail_record_view -->
                                                     </table>
                                                     [% PROCESS "opac/parts/result/copy_counts.tt2" %]

-----------------------------------------------------------------------

Summary of changes:
 .../perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm |   13 +++++++++++--
 .../perlmods/lib/OpenILS/WWW/EGCatLoader/Search.pm |    4 ++--
 Open-ILS/src/templates/opac/parts/misc_util.tt2    |    7 +++++++
 .../src/templates/opac/parts/record/copy_table.tt2 |   14 ++++++++++++++
 Open-ILS/src/templates/opac/parts/result/table.tt2 |   19 +++++++++++++++++--
 5 files changed, 51 insertions(+), 6 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list