TPAC: Display public copy notes on record details user/dbs/lp1013817_example_squash
authorDavid Busby <code@edoceo.com>
Sat, 2 Feb 2013 00:22:54 +0000 (16:22 -0800)
committerDan Scott <dscott@laurentian.ca>
Thu, 7 Feb 2013 17:49:47 +0000 (12:49 -0500)
Public copy notes should be displayed on the TPAC record details page.
Loop over the returned copies and gathers any copy notes for display,
then display the notes in the TPAC record details page.

Signed-off-by: David Busby <code@edoceo.com>
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm
Open-ILS/src/templates/opac/parts/record/copy_table.tt2

index a4af2c6..d655b70 100644 (file)
@@ -78,6 +78,16 @@ sub load_record {
     $ctx->{marc_xml} = $rec_data[0]->{marc_xml};
 
     $ctx->{copies} = $copy_rec->gather(1);
+
+    # Add Copy Notes to Each Copy?
+    foreach my $copy (@{$ctx->{copies}}) {
+        $copy->{notes} = $U->simplereq(
+            'open-ils.circ',
+            'open-ils.circ.copy_note.retrieve.all',
+            {itemid => $copy->{id}, pub => 1 }
+        );
+    }
+
     $self->timelog("past store copy retrieval call");
     $ctx->{copy_limit} = $copy_limit;
     $ctx->{copy_offset} = $copy_offset;
index b806f5c..02ca127 100644 (file)
@@ -143,6 +143,13 @@ END;
                     '-';
                 END %]</td>
         </tr>
+        <!-- @edoceo The Copy Notes Dump -->
+        [% IF copy_info.notes; %]
+            [% FOREACH note IN copy_info.notes; %]
+                <tr><td>&nbsp;</td><td colspan="2" style="color: #00593d;"><strong>[% note.title | html %]:</strong> [% note.value | html %]</td></tr>
+            [% END %]
+        [% END %]
+
         [%- END %]
         <tr>
         [%- IF ctx.copy_offset > 0 AND NOT serial_holdings;