Tpac: Rename orig_loc to physical_loc, for clarity's sake.
authorLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Fri, 28 Oct 2011 17:49:42 +0000 (13:49 -0400)
committerBill Erickson <berick@esilibrary.com>
Mon, 31 Oct 2011 14:02:40 +0000 (10:02 -0400)
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 <lebbeous@esilibrary.com>
Signed-off-by: Bill Erickson <berick@esilibrary.com>

Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Search.pm
Open-ILS/src/perlmods/lib/OpenILS/WWW/Redirect.pm

index 122f08c..4a50820 100644 (file)
@@ -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);
 }
 
 
index 9b21d56..0f714c9 100644 (file)
@@ -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'
index eb5d7ea..93f90b6 100644 (file)
@@ -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",
     );
 
index 560ccc6..01d57f4 100644 (file)
@@ -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;
         }
     }