From: Bill Erickson Date: Wed, 21 Mar 2012 18:34:19 +0000 (-0400) Subject: TPac: non-inherited org unit visibility : hide copy counts X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=218722deb2a57f8b1f94869e12602c1286c10aae;p=evergreen%2Fpines.git TPac: non-inherited org unit visibility : hide copy counts Avoid showing copy counts for non-opac-visible org units in the search results and record details page. This is important when the 'opac.org_unit.non_inheritied_visibility' global flag is enabled, as org units along the tree may be non-visible. Signed-off-by: Bill Erickson Signed-off-by: Mike Rylander --- 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 a573161cc8..cd5944285f 100644 --- a/Open-ILS/src/templates/opac/parts/record/copy_counts.tt2 +++ b/Open-ILS/src/templates/opac/parts/record/copy_counts.tt2 @@ -7,7 +7,12 @@ WHILE depth < depths; ou_avail = ctx.copy_summary.$depth.available; ou_id = ctx.copy_summary.$depth.org_unit; - ou_name = ctx.get_aou(ou_id).name; + cp_org_unit = ctx.get_aou(ou_id); + IF cp_org_unit.opac_visible == 'f' AND !ctx.is_staff; + depth = depth + 1; + NEXT; + END; + ou_name = cp_org_unit.name; displayed_ous.$ou_name = 1; %]
  • 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 c183744c64..639877e9d6 100644 --- a/Open-ILS/src/templates/opac/parts/result/copy_counts.tt2 +++ b/Open-ILS/src/templates/opac/parts/result/copy_counts.tt2 @@ -7,11 +7,13 @@ IF attrs.copy_counts.$depth.count > 0; %]
    +[% IF ctx.get_aou(attrs.copy_counts.$depth.org_unit).opac_visible == 't' AND !ctx.is_staff %] [% l('[_1] of [quant,_2,copy,copies] available at [_3].', attrs.copy_counts.$depth.available, attrs.copy_counts.$depth.count, ou_name) | html %] +[% END %]
    [%- END; depth = depth + 1;