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 <berick@esilibrary.com>
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;
%]
<li>
IF attrs.copy_counts.$depth.count > 0;
%]
<div class="result_count">
+[% 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 %]
</div>
[%- END;
depth = depth + 1;