From: Dan Scott Date: Wed, 28 Mar 2012 02:33:31 +0000 (-0400) Subject: TPAC: Suppress copy counts for libraries that own zero copies X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=29a1f4178f83fe57942d07afd33d62b2a8268c21;p=evergreen%2Fpines.git TPAC: Suppress copy counts for libraries that own zero copies Rather than slavishly showing the copy counts for libraries even when the library has no copies to show, avoid wasting the precious display space and suppress the output. This was a problem for both search scope libraries and preferred library in the search results, and for just preferred library in record details. This commit makes the behaviour consistent, in favour of suppressing the display of copy counts when there's nothing to display. Signed-off-by: Dan Scott Signed-off-by: Jason Stephenson --- 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 47f8f447f8..a573161cc8 100644 --- a/Open-ILS/src/templates/opac/parts/record/copy_counts.tt2 +++ b/Open-ILS/src/templates/opac/parts/record/copy_counts.tt2 @@ -27,6 +27,7 @@ ou_id = attrs.plib_copy_counts.$depth.org_unit; UNLESS depth < 0 || displayed_ous.exists(ou_name); %] + [%- IF attrs.plib_copy_counts.$depth.count > 0; %]
  • [% l('[_1] of [quant,_2,copy,copies] available at [_3].', attrs.plib_copy_counts.$depth.available, @@ -37,5 +38,6 @@ l('(Show preferred library)'); %]
  • [%- END %] + [%- END %] diff --git a/Open-ILS/src/templates/opac/parts/result/copy_counts.tt2 b/Open-ILS/src/templates/opac/parts/result/copy_counts.tt2 index 943066ec99..d95d3a7c33 100644 --- a/Open-ILS/src/templates/opac/parts/result/copy_counts.tt2 +++ b/Open-ILS/src/templates/opac/parts/result/copy_counts.tt2 @@ -4,6 +4,7 @@ WHILE depth < depths; ou_name = ctx.get_aou(attrs.copy_counts.$depth.org_unit).name; displayed_ous.$ou_name = 1; + IF attrs.copy_counts.$depth.count > 0; %]
    [% l('[_1] of [quant,_2,copy,copies] available at [_3].', @@ -12,7 +13,8 @@ ou_name) | html %]
    -[%- depth = depth + 1; +[%- END; + depth = depth + 1; END; depth = attrs.plib_copy_counts.size - 1; @@ -20,6 +22,7 @@ UNLESS displayed_ous.exists(ou_name); %] +[%- IF attrs.plib_copy_counts.$depth.count > 0; %]
    [% l('[_1] of [quant,_2,copy,copies] available at [_3].', attrs.plib_copy_counts.$depth.available, @@ -28,3 +31,4 @@ %] [% l('(Preferred)') %]
    [%- END %] +[%- END %]