From: Mike Rylander Date: Tue, 28 Jul 2020 14:42:24 +0000 (-0400) Subject: LP#1879790: Give carousels their own context org X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=2808a6b9d48120e27b43cd923b621836908fbb03;p=working%2FEvergreen.git LP#1879790: Give carousels their own context org Before this commit, the context org unit for carousels was the same as the physical_loc environment variable, or the client-passed physcial location, or the search location, whichever was set in that order. This commit provides the ability to specify a carousel_loc environment variable in the apache vhost configuration, as an override to physical_loc. This, in turn, allows hostname-segregated branches of the org hierarchy in a resource sharing group to specify their own carousels even when they want the top of the group to be the default search location. Signed-off-by: Mike Rylander --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm index 7388d79706..2f04308307 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm @@ -297,6 +297,8 @@ sub load_common { $ctx->{original_tz} = $ENV{TZ}; $ENV{TZ} = $ctx->{client_tz}; + $ctx->{carousel_loc} = $ENV{carousel_loc}; # let templates see it + my $xul_wrapper = ($self->apache->headers_in->get('OILS-Wrapper') || '') =~ /true/; @@ -361,7 +363,7 @@ sub load_common { # FIXME - move carousel helpers to a separate file $ctx->{get_visible_carousels} = sub { - my $org_unit = $self->ctx->{physical_loc} || $self->cgi->param('loc') || $self->ctx->{aou_tree}->()->id; + my $org_unit = $self->ctx->{carousel_loc} || $self->ctx->{physical_loc} || $self->cgi->param('loc') || $self->ctx->{aou_tree}->()->id; return $U->simplereq( 'open-ils.actor', 'open-ils.actor.carousel.retrieve_by_org',