From 84d3f4d0724183b3b8c506f90a30993d596df9a7 Mon Sep 17 00:00:00 2001 From: Lebbeous Fogle-Weekley Date: Fri, 28 Oct 2011 13:49:42 -0400 Subject: [PATCH] Tpac: Rename orig_loc to physical_loc, for clarity's sake. This is an OPAC parameter not so much meant for use by patrons at home, but for users at machines physically located in libraries. In conjunction with OpenILS::WWW::Redirector, it helps those machines "remember" what branch they're in. Anyway, the name orig_loc doesn't make the parameter's meaning quite as clear as it could whne you encounter it in code. Signed-off-by: Lebbeous Fogle-Weekley Signed-off-by: Bill Erickson --- Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm | 20 ++++++++++---------- .../perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm | 4 ++-- .../perlmods/lib/OpenILS/WWW/EGCatLoader/Search.pm | 4 ++-- Open-ILS/src/perlmods/lib/OpenILS/WWW/Redirect.pm | 12 ++++++------ 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm index 122f08cff7..4a508207a6 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm @@ -25,7 +25,7 @@ use OpenILS::WWW::EGCatLoader::Container; my $U = 'OpenILS::Application::AppUtils'; use constant COOKIE_SES => 'ses'; -use constant COOKIE_ORIG_LOC => 'eg_orig_loc'; +use constant COOKIE_PHYSICAL_LOC => 'eg_physical_loc'; use constant COOKIE_ANON_CACHE => 'anoncache'; use constant ANON_CACHE_MYLIST => 'mylist'; @@ -220,7 +220,7 @@ sub load_common { $ctx->{unparsed_uri} = $self->apache->unparsed_uri; $ctx->{opac_root} = $ctx->{base_path} . "/opac"; # absolute base url $ctx->{is_staff} = 0; # Assume false, check for workstation id later. Was: ($self->apache->headers_in->get('User-Agent') =~ /oils_xulrunner/); - $ctx->{orig_loc} = $self->get_orig_loc; + $ctx->{physical_loc} = $self->get_physical_loc; # capture some commonly accessed pages $ctx->{home_page} = 'http://' . $self->apache->hostname . $self->ctx->{opac_root} . "/home"; @@ -252,24 +252,24 @@ sub load_common { return Apache2::Const::OK; } -# orig_loc (i.e. "original location") passed in as a URL -# param will replace any existing orig_loc stored as a cookie. -sub get_orig_loc { +# physical_loc (i.e. "original location") passed in as a URL +# param will replace any existing physical_loc stored as a cookie. +sub get_physical_loc { my $self = shift; - if(my $orig_loc = $self->cgi->param('orig_loc')) { + if(my $physical_loc = $self->cgi->param('physical_loc')) { $self->apache->headers_out->add( "Set-Cookie" => $self->cgi->cookie( - -name => COOKIE_ORIG_LOC, + -name => COOKIE_PHYSICAL_LOC, -path => $self->ctx->{base_path}, - -value => $orig_loc, + -value => $physical_loc, -expires => undef ) ); - return $orig_loc; + return $physical_loc; } - return $self->cgi->cookie(COOKIE_ORIG_LOC); + return $self->cgi->cookie(COOKIE_PHYSICAL_LOC); } diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm index 9b21d56fe4..0f714c9a1d 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm @@ -182,9 +182,9 @@ sub mk_copy_query { }; # XXX In the future, $sort_org should be understood to be an abstration - # that refers to something configurable, not necessariyl orig_loc. + # that refers to something configurable, not necessariyl physical_loc. - if (my $sort_org = $self->ctx->{orig_loc}) { + if (my $sort_org = $self->ctx->{physical_loc}) { unshift @{$query->{order_by}}, { class => 'acp', field => 'circ_lib', transform => 'numeric_eq', params => [$sort_org], direction => 'desc' diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Search.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Search.pm index eb5d7eadd1..93f90b68a6 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Search.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Search.pm @@ -300,7 +300,7 @@ sub check_1hit_redirect { $sname = 'opac.patron.jump_to_details_on_single_hit'; $org = ($ctx->{user}) ? $ctx->{user}->home_ou : - $ctx->{orig_loc} || + $ctx->{physical_loc} || $self->ctx->{aou_tree}->()->id; } @@ -491,7 +491,7 @@ sub get_staff_search_settings { } my $sss_size = $self->ctx->{get_org_setting}->( - $self->ctx->{orig_loc} || $self->ctx->{aou_tree}->()->id, + $self->ctx->{physical_loc} || $self->ctx->{aou_tree}->()->id, "opac.staff_saved_search.size", ); diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/Redirect.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/Redirect.pm index 560ccc686e..01d57f416a 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/Redirect.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/Redirect.pm @@ -66,7 +66,7 @@ sub handler { my $depth = $apache->dir_config('OILSRedirectDepth'); my $locale = $apache->dir_config('OILSRedirectLocale') || 'en-US'; my $use_tt = ($apache->dir_config('OILSRedirectTpac') || '') =~ /true/i; - my $orig_loc; + my $physical_loc; $apache->log->debug("Redirector sees client frim $user_ip"); @@ -80,7 +80,7 @@ sub handler { if ($nhostname =~ m/[^\s]/) { $hostname = $nhostname; } if($org_cache{$shortname}) { - $orig_loc = $org_cache{$shortname}; + $physical_loc = $org_cache{$shortname}; } else { @@ -89,7 +89,7 @@ sub handler { 'open-ils.actor.org_unit.retrieve_by_shortname', $shortname)->gather(1); - $org_cache{$shortname} = $orig_loc = $org->id if $org; + $org_cache{$shortname} = $physical_loc = $org->id if $org; } } @@ -98,7 +98,7 @@ sub handler { if($use_tt) { $url .= "/eg/opac/home"; - $url .= "?orig_loc=$orig_loc" if $orig_loc; + $url .= "?physical_loc=$physical_loc" if $physical_loc; =head1 potential locale/skin implementation @@ -127,8 +127,8 @@ sub handler { } else { $url .= "/opac/$locale/skin/$skin/xml/index.xml"; - if($orig_loc) { - $url .= "?ol=" . $orig_loc; + if($physical_loc) { + $url .= "?ol=" . $physical_loc; $url .= "&d=$depth" if defined $depth; } } -- 2.11.0