From: Dan Scott Date: Sun, 8 Jan 2012 21:14:29 +0000 (-0500) Subject: TPAC: Improve copy display in record summary X-Git-Tag: sprint4-merge-nov22~4635 X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=3acde47346f093c2ee13e5c5a8d3742a7bae2dde;p=working%2FEvergreen.git 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 Signed-off-by: Bill Erickson --- 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 03d5f16777..8148dd934a 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; %] @@ -132,4 +138,4 @@ END;
    - +[% END; %]