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

Evergreen Git git at git.evergreen-ils.org
Wed Dec 14 14:15:03 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  b2255089e3f4431c314e7b83a3c851af023443bd (commit)
      from  5b4b7003d59238ba04d745b21adbb1d8c2005b2f (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 b2255089e3f4431c314e7b83a3c851af023443bd
Author: Dan Scott <dscott at laurentian.ca>
Date:   Tue Dec 6 02:16:16 2011 -0500

    TPAC: Add prefixes and suffixes to call number displays
    
    Call numbers can be associated with prefixes and suffixes meant for
    display purposes; display these with the call numbers in search results
    and record details.
    
    Thanks to Lebbeous and Bill for the assist in sorting out the remaining
    portion of the hairy json_query for the record display.
    
    Signed-off-by: Dan Scott <dscott at laurentian.ca>
    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 0f714c9..113da1d 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}'});
+    my (undef, @rec_data) = $self->get_records_and_facets([$rec_id], undef, {flesh => '{holdings_xml,mra,acp,acnp,acns}'});
     $ctx->{bre_id} = $rec_data[0]->{id};
     $ctx->{marc_xml} = $rec_data[0]->{marc_xml};
 
@@ -152,13 +152,24 @@ sub mk_copy_query {
                 {column => 'id', alias => 'call_number'}
             ],
             circ => ['due_date'],
+            acnp => [
+                {column => 'label', alias => 'call_number_prefix_label'},
+                {column => 'id', alias => 'call_number_prefix'}
+            ],
+            acns => [
+                {column => 'label', alias => 'call_number_suffix_label'},
+                {column => 'id', alias => 'call_number_suffix'}
+            ]
         },
 
         from => {
             acp => {
-                acn => {
-                    join => {bre => {filter => {id => $rec_id }}},
-                    filter => {deleted => 'f'}
+                acn => { 
+                    join => { 
+                        acnp => { fkey => 'prefix' },
+                        acns => { fkey => 'suffix' }
+                    },
+                    filter => [{deleted => 'f'}, {record => $rec_id}],
                 },
                 circ => { # If the copy is circulating, retrieve the open circ
                     type => 'left',
@@ -170,7 +181,9 @@ sub mk_copy_query {
             }
         },
 
-        where => {'+acp' => {deleted => 'f' }},
+        where => {
+            '+acp' => {deleted => 'f' }
+        },
 
         order_by => [
             {class => 'aou', field => 'name'}, 
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 93f90b6..cfaef71 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Search.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Search.pm
@@ -257,7 +257,7 @@ sub load_rresults {
     my ($facets, @data) = $self->get_records_and_facets(
         $rec_ids, $results->{facet_key}, 
         {
-            flesh => '{holdings_xml,mra,acp}',
+            flesh => '{holdings_xml,mra,acp,acnp,acns}',
             site => $site,
             depth => $depth
         }
@@ -362,7 +362,7 @@ sub item_barcode_shortcut {
         }
 
         my ($facets, @data) = $self->get_records_and_facets(
-            $rec_ids, undef, {flesh => "{holdings_xml,mra}"}
+            $rec_ids, undef, {flesh => "{holdings_xml,mra,acnp,acns}"}
         );
 
         $self->ctx->{records} = [@data];
@@ -449,7 +449,7 @@ sub marc_expert_search {
     }
 
     my ($facets, @data) = $self->get_records_and_facets(
-        $self->ctx->{ids}, undef, {flesh => "{holdings_xml,mra}"}
+        $self->ctx->{ids}, undef, {flesh => "{holdings_xml,mra,acnp,acns}"}
     );
 
     $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 db30d6b..6efc585 100644
--- a/Open-ILS/src/templates/opac/parts/misc_util.tt2
+++ b/Open-ILS/src/templates/opac/parts/misc_util.tt2
@@ -96,6 +96,19 @@
 
             # Check volume visibility - could push this into XPath
             vol.label = volume.getAttribute('label');
+
+            # Prepend prefix, if any
+            prefix = volume.findnodes('./*[local-name()="call_number_prefix"][@ident!="-1"]');
+            IF prefix.getAttribute('label') != '';
+                vol.label = prefix.getAttribute('label') _ " " _ vol.label;
+            END;
+
+            # Append prefix, if any
+            suffix = volume.findnodes('./*[local-name()="call_number_suffix"][@ident!="-1"]');
+            IF suffix.getAttribute('label') != '';
+                vol.label = vol.label _ " " _ suffix.getAttribute('label');
+            END;
+
             vol.id = volume.getAttribute('id');
             NEXT IF volume.getAttribute('opac_visible') == 'false';
             NEXT IF volume.getAttribute('deleted') == 'true';
diff --git a/Open-ILS/src/templates/opac/parts/record/summary.tt2 b/Open-ILS/src/templates/opac/parts/record/summary.tt2
index 540c30d..d2e7cd1 100644
--- a/Open-ILS/src/templates/opac/parts/record/summary.tt2
+++ b/Open-ILS/src/templates/opac/parts/record/summary.tt2
@@ -118,7 +118,19 @@ IF num_uris > 0;
     <tbody class="copy_details_table">
         [%- last_cn = 0;
         FOR copy_info IN ctx.copies;
-            NEXT IF copy_info.call_number_label == '##URI##' %]
+            callnum = copy_info.call_number_label;
+            NEXT IF callnum == '##URI##';
+
+            callnum_prefix = copy_info.call_number_prefix_label;
+            IF callnum_prefix != "";
+                callnum = callnum_prefix _ " " _ callnum;
+            END;
+
+            callnum_suffix = copy_info.call_number_suffix_label;
+            IF callnum_suffix != "";
+                callnum = callnum  _ " " _ callnum_suffix;
+            END;
+        -%]
         <tr>
             <td header='copy_header_library'>
             [%-
@@ -126,7 +138,7 @@ IF num_uris > 0;
                 org_name | html
             -%]
             </td>
-            <td header='copy_header_callnumber'>[% copy_info.call_number_label | html %]</td>
+            <td header='copy_header_callnumber'>[% callnum | html %]</td>
             <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 %]

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

Summary of changes:
 .../perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm |   23 +++++++++++++++----
 .../perlmods/lib/OpenILS/WWW/EGCatLoader/Search.pm |    6 ++--
 Open-ILS/src/templates/opac/parts/misc_util.tt2    |   13 +++++++++++
 .../src/templates/opac/parts/record/summary.tt2    |   16 ++++++++++++-
 4 files changed, 48 insertions(+), 10 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list