From: Thomas Berezansky Date: Tue, 14 Aug 2012 14:50:11 +0000 (-0400) Subject: Physical Location Fixes/Enhancements X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=3c4ae14df412d70c445027eff74d4c144418670c;p=working%2FEvergreen.git Physical Location Fixes/Enhancements Teach the physical location retrieval function about using an ENV var. This allows a subdomain to force a specific physical location, say by adding to their apache config: SetEnv physical_loc 4 Rewriterules could also be used for more dynamic configuration. Also, as a fix: Have preferred library use the stored physical location instead of assuming that CGI has the setting all the time. Signed-off-by: Thomas Berezansky --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm index 7f8a9a8a98..15ffb57296 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm @@ -310,9 +310,12 @@ sub staff_saved_searches_set_expansion_state { # physical_loc (i.e. "original location") passed in as a URL # param will replace any existing physical_loc stored as a cookie. +# If specified via ENV that rules over all and we don't set cookies. sub get_physical_loc { my $self = shift; + return $ENV{physical_loc} if($ENV{physical_loc}); + if(my $physical_loc = $self->cgi->param('physical_loc')) { $self->apache->headers_out->add( "Set-Cookie" => $self->cgi->cookie( diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Util.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Util.pm index 498a04f472..5f27425c27 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Util.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Util.pm @@ -377,8 +377,8 @@ sub _get_pref_lib { return $ctx->{user}->home_ou; } - if ($self->cgi->param('physical_loc')) { - return $self->cgi->param('physical_loc'); + if ($ctx->{physical_loc}) { + return $ctx->{physical_loc}; } }