From 14431bfcfe372cc8164f4f2f8171f703be713ff5 Mon Sep 17 00:00:00 2001 From: Dan Scott Date: Sun, 8 Jan 2012 16:14:29 -0500 Subject: [PATCH] TPAC: Improve copy display in record summary In the copy counts, offer a link to display the copies at parent libraries that have available copies. For example, if you are browsing at BR1 and there are no available copies, but you see that SYS1 has available copies, clicking "(Show)" beside the SYS1 available copy count will change the search scope to SYS1 and display the copies for BR1 and BR2. Also, avoid displaying the copy table header if there are no physical copies to display (for example, if there are located URIs that make the copy show up in search results). Signed-off-by: Dan Scott --- Open-ILS/src/templates/opac/parts/record/copy_counts.tt2 | 11 ++++++++--- Open-ILS/src/templates/opac/parts/record/copy_table.tt2 | 8 +++++++- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/Open-ILS/src/templates/opac/parts/record/copy_counts.tt2 b/Open-ILS/src/templates/opac/parts/record/copy_counts.tt2 index 905789d2e7..9d85ae7cb8 100644 --- a/Open-ILS/src/templates/opac/parts/record/copy_counts.tt2 +++ b/Open-ILS/src/templates/opac/parts/record/copy_counts.tt2 @@ -4,12 +4,17 @@ [%- depths = ctx.copy_summary.size; depth = 0; WHILE depth < depths; + ou_avail = ctx.copy_summary.$depth.available; + ou_id = ctx.copy_summary.$depth.org_unit; %]
  • - [% l('[quant,_1,copy,copies] at [_2].', - ctx.copy_summary.$depth.available, - ctx.get_aou(ctx.copy_summary.$depth.org_unit).name) + [% l('[quant,_1,copy,copies] at [_2].', ou_avail, ctx.get_aou(ou_id).name) | html %] + [%- IF ou_avail > 0 && ou_id != CGI.param('loc'); %] + + [%- l('(Show)'); %] + [%- END; %]
  • [%- depth = depth + 1; END %] 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 f6af5b1c09..d67ad0a8b8 100644 --- a/Open-ILS/src/templates/opac/parts/record/copy_table.tt2 +++ b/Open-ILS/src/templates/opac/parts/record/copy_table.tt2 @@ -1,11 +1,17 @@ [%- FOREACH copy_info IN ctx.copies; + IF copy_info.call_number_label != '##URI##'; + has_copies = 'true'; + END; IF copy_info.part_label != ''; has_parts = 'true'; + END; + IF has_parts && has_copies; LAST; END; END; %] +[%- IF has_copies; %] @@ -128,4 +134,4 @@ END;
    - +[% END; %] -- 2.11.0