From 73036b9dfb8ab4550703a92298457d515cdcdbf7 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Fri, 10 Jun 2011 16:16:21 -0400 Subject: [PATCH] Showing hold/copy summary in details page Signed-off-by: Bill Erickson --- .../src/perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm | 13 +++++++++++++ .../web/templates/default/opac/parts/record/summary.tt2 | 17 ++++++++++------- 2 files changed, 23 insertions(+), 7 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 7b56ee4d8b..02fd651c03 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm @@ -37,6 +37,7 @@ sub load_record { $ctx->{copy_offset} = $copy_offset; $ctx->{have_holdings_to_show} = 0; + $self->get_hold_copy_summary($rec_id, $org); # XXX TODO we'll also need conditional logic to show MFHD-based holdings if ( @@ -185,4 +186,16 @@ sub get_expanded_holdings { } +sub get_hold_copy_summary { + my ($self, $rec_id, $org) = @_; + + my $req1 = OpenSRF::AppSession->create('open-ils.search')->request( + 'open-ils.search.biblio.record.copy_count', $org, $rec_id); + + $self->ctx->{record_hold_count} = $U->simplereq( + 'open-ils.circ', 'open-ils.circ.bre.holds.count', $rec_id); + + $self->ctx->{copy_summary} = $req1->recv->content; +} + 1; diff --git a/Open-ILS/web/templates/default/opac/parts/record/summary.tt2 b/Open-ILS/web/templates/default/opac/parts/record/summary.tt2 index c34cf9a15f..582b98b594 100644 --- a/Open-ILS/web/templates/default/opac/parts/record/summary.tt2 +++ b/Open-ILS/web/templates/default/opac/parts/record/summary.tt2 @@ -12,13 +12,6 @@ src='[% ctx.media_prefix %]/opac/extras/ac/jacket/medium/[% ident %]' /> [% END %]
-
-
[% l("Image provided by") %]
-
- [% l("Amazon") %] -
-
@@ -98,6 +91,16 @@ [% attrs.pubdate %] + + +
+
+ [% l("[quant,_1,Hold,Holds] with [quant,_2,total copy,total copies]", + ctx.record_hold_count, ctx.copy_summary.0.count) %] +
+
[% l('[quant,_1,Copy,Copies] available', ctx.copy_summary.0.available) %]
+
+ -- 2.11.0