From: Dan Scott Date: Fri, 27 Jul 2012 16:34:33 +0000 (-0400) Subject: Fix OU logic for determining hold availability X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=3c23c18e1ab3a32fe86d47b9efebf72340ef4baf;p=contrib%2FConifer.git Fix OU logic for determining hold availability We'll use search_ou directly - not necessarily the best option, but better than using the search_ou value as a depth. Not sure if preferred library or physical loc would be better here; E_TOO_MANY_LOCATION_OPTIONS! Signed-off-by: Dan Scott --- diff --git a/Open-ILS/src/templates/opac/parts/misc_util.tt2 b/Open-ILS/src/templates/opac/parts/misc_util.tt2 index 524a66b94f..124d1245c7 100644 --- a/Open-ILS/src/templates/opac/parts/misc_util.tt2 +++ b/Open-ILS/src/templates/opac/parts/misc_util.tt2 @@ -238,10 +238,12 @@ FOR node IN xml.findnodes(xpath); FOR attr IN ['count', 'available', 'unshadow', 'transcendant', 'org_unit']; depth = node.getAttribute('depth'); + org_unit = node.getAttribute('org_unit'); args.copy_counts.$depth.$attr = node.getAttribute(attr); + args.org_copy_counts.$org_unit.$attr = node.getAttribute(attr); END; END; - + # Get preferred library copy count args.plib_copy_counts = {}; count_type = 'pref_lib'; diff --git a/Open-ILS/src/templates/opac/parts/record/summary.tt2 b/Open-ILS/src/templates/opac/parts/record/summary.tt2 index 0ea975c7ef..75a5964783 100644 --- a/Open-ILS/src/templates/opac/parts/record/summary.tt2 +++ b/Open-ILS/src/templates/opac/parts/record/summary.tt2 @@ -23,14 +23,14 @@
- [%- depth = ctx.search_ou - 1; IF ctx.copy_summary.$depth.available == 0 OR ctx.holds_block.enabled == 'false' %] + [%- search_ou = ctx.search_ou; IF attrs.org_copy_counts.$search_ou.available == 0 OR ctx.holds_block.enabled == 'false' %] - [% END %] + [%- END -%]
[% IF ctx.user; INCLUDE "opac/parts/bookbag_actions.tt2"; diff --git a/Open-ILS/src/templates/opac/parts/result/table.tt2 b/Open-ILS/src/templates/opac/parts/result/table.tt2 index 8fa61e44e0..3a60ed1317 100644 --- a/Open-ILS/src/templates/opac/parts/result/table.tt2 +++ b/Open-ILS/src/templates/opac/parts/result/table.tt2 @@ -216,7 +216,7 @@
- [%- depth = ctx.search_ou - 1; IF args.copy_counts.$depth.available == 0 OR ctx.holds_block.enabled == 'false' %] + [%- search_ou = ctx.search_ou; IF attrs.org_copy_counts.$search_ou.available == 0 OR ctx.holds_block.enabled == 'false' %] - [% END %] + [%- END -%]
[% IF ctx.user; INCLUDE "opac/parts/bookbag_actions.tt2";