From cad8ffe4fe66bf569c5f7030f677f12d9da046a8 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Wed, 6 Mar 2013 16:02:37 -0500 Subject: [PATCH] TPAC my-list call number includes child orgs For my-list call number display, if the most relevant call number is a child of any of the context org units (physical/pref/search), it is considered relevant for purposes of call number display. Signed-off-by: Bill Erickson Signed-off-by: Ben Shum --- Open-ILS/src/templates/opac/myopac/lists.tt2 | 14 ++++++++------ Open-ILS/src/templates/opac/parts/anon_list.tt2 | 15 ++++++++------- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/Open-ILS/src/templates/opac/myopac/lists.tt2 b/Open-ILS/src/templates/opac/myopac/lists.tt2 index b43ad42ca9..0b2977dc93 100644 --- a/Open-ILS/src/templates/opac/myopac/lists.tt2 +++ b/Open-ILS/src/templates/opac/myopac/lists.tt2 @@ -292,12 +292,14 @@ copy = attrs.holdings.0; IF copy; # only show a relevant call number - org = ctx.get_aou_by_shortname(copy.owner); - IF org.id == ctx.search_ou OR - org.id == ctx.pref_ou OR - org.id == ctx.user.home_ou OR - org.id == ctx.physical_loc; - l('[_1] ([_2])', copy.label, org.name) | html; + copy_org = ctx.get_aou_by_shortname(copy.owner); + FOR ctx_org IN [ctx.pref_ou, ctx.search_ou, ctx.home_ou, ctx.physical_loc]; + NEXT UNLESS ctx_org; + ctx_org = ctx.get_aou(ctx_org); + IF ctx.org_within_scope(ctx_org, copy_org, ctx_org.ou_type.depth); + l('[_1] ([_2])', copy.label, copy_org.name) | html; + LAST; + END; END; END; %] diff --git a/Open-ILS/src/templates/opac/parts/anon_list.tt2 b/Open-ILS/src/templates/opac/parts/anon_list.tt2 index cd39bbc4eb..252f4ae05a 100644 --- a/Open-ILS/src/templates/opac/parts/anon_list.tt2 +++ b/Open-ILS/src/templates/opac/parts/anon_list.tt2 @@ -65,13 +65,14 @@ [% copy = attrs.holdings.0; IF copy; - # only show a relevant call number - org = ctx.get_aou_by_shortname(copy.owner); - IF org.id == ctx.search_ou OR - org.id == ctx.pref_ou OR - org.id == ctx.user.home_ou OR - org.id == ctx.physical_loc; - l('[_1] ([_2])', copy.label, org.name) | html; + copy_org = ctx.get_aou_by_shortname(copy.owner); + FOR ctx_org IN [ctx.pref_ou, ctx.search_ou, ctx.home_ou, ctx.physical_loc]; + NEXT UNLESS ctx_org; + ctx_org = ctx.get_aou(ctx_org); + IF ctx.org_within_scope(ctx_org, copy_org, ctx_org.ou_type.depth); + l('[_1] ([_2])', copy.label, copy_org.name) | html; + LAST; + END; END; END; %] -- 2.43.2