From 2e3d5a621ee5b05627f4586a6a29673be08c362a Mon Sep 17 00:00:00 2001 From: edoceo Date: Mon, 4 Feb 2013 20:33:29 -0800 Subject: [PATCH] this works, nice copy notes in green, handles multiple notes as well /djb Signed-off-by: edoceo Signed-off-by: Michael Peters --- .../perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm | 28 +++++++++++++++------- .../src/templates/opac/parts/record/copy_table.tt2 | 8 ++++++- 2 files changed, 26 insertions(+), 10 deletions(-) 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 c2c1c45dea..0934444657 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm @@ -1,5 +1,6 @@ package OpenILS::WWW::EGCatLoader; use strict; use warnings; +use Data::Dumper; use Apache2::Const -compile => qw(OK DECLINED FORBIDDEN HTTP_INTERNAL_SERVER_ERROR REDIRECT HTTP_BAD_REQUEST); use OpenSRF::Utils::Logger qw/$logger/; use OpenILS::Utils::CStoreEditor qw/:funcs/; @@ -78,7 +79,15 @@ sub load_record { $ctx->{marc_xml} = $rec_data[0]->{marc_xml}; $ctx->{copies} = $copy_rec->gather(1); - $ctx->{edoceo} = "Busby is Great"; + # Add Copy Notes some how 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; @@ -194,14 +203,15 @@ sub mk_copy_query { # Add Copy Notes? # Some How need to Make Notes an Array of Notes - # This makes two rows for the record, when there are two copy notes - $query->{select}->{acpn} = [ - {column => 'title', alias => 'note_title'}, - {column => 'value', alias => 'note_value'} - ]; - $query->{from}->{acp}->{acpn} = { - type => 'left' - }; + # This makes two rows for the record, when there are two copy notes - cause of the JOIN + # Also, if this is moved to around line 68 as $copy_rec it seems to not work the same? +# $query->{select}->{acpn} = [ +# {column => 'title', alias => 'note_title'}, +# {column => 'value', alias => 'note_value'} +# ]; +# $query->{from}->{acp}->{acpn} = { +# type => 'left' +# }; if($org != $self->ctx->{aou_tree}->()->id) { # no need to add the org join filter if we're not actually filtering 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 24d4436e72..7ea80979b6 100644 --- a/Open-ILS/src/templates/opac/parts/record/copy_table.tt2 +++ b/Open-ILS/src/templates/opac/parts/record/copy_table.tt2 @@ -145,7 +145,13 @@ END; '-'; END %] - [% Dumper.dump(copy_info.note_title) | html %]: [% Dumper.dump(copy_info.note_value) | html %] + + [% IF copy_info.notes; %] + [% FOREACH note IN copy_info.notes; %] +  [% note.title | html %]: [% note.value | html %] + [% END %] + [% END %] + [%- END %] [%- IF ctx.copy_offset > 0 AND NOT serial_holdings; -- 2.11.0