From: Bill Erickson Date: Fri, 10 Jun 2011 20:16:21 +0000 (-0400) Subject: Showing hold/copy summary in details page X-Git-Tag: sprint4-merge-nov22~5128^2~72^2~4^2 X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=b1ee9ad4ef91240de7110d1748a5a3c57043da39;p=working%2FEvergreen.git Showing hold/copy summary in details page Signed-off-by: Bill Erickson --- 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) %]
+
+