use the more explicit get_foo instead of find_foo for pub/cache object lookup
authorberick <berick@esilibrary.com>
Wed, 20 Apr 2011 13:57:34 +0000 (09:57 -0400)
committerBill Erickson <berick@esilibrary.com>
Wed, 20 Jul 2011 18:34:32 +0000 (14:34 -0400)
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Search.pm
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Util.pm
Open-ILS/web/templates/default/opac/myopac/hold_history.tt2
Open-ILS/web/templates/default/opac/myopac/holds.tt2
Open-ILS/web/templates/default/opac/parts/place_hold.tt2
Open-ILS/web/templates/default/opac/parts/record/summary.tt2

index 5c6046d..9577121 100644 (file)
@@ -80,7 +80,7 @@ sub _prepare_biblio_search {
     my $site;
     my $org = $cgi->param('loc');
     if (defined($org) and $org ne '' and ($org ne $ctx->{aou_tree}->()->id) and not $query =~ /site\(\S+\)/) {
-        $site = $ctx->{find_aou}->($org)->shortname;
+        $site = $ctx->{get_aou}->($org)->shortname;
         $query .= " site($site)";
     }
 
@@ -93,7 +93,7 @@ sub _prepare_biblio_search {
     my $depth;
     if (defined($cgi->param('depth')) and not $query =~ /depth\(\d+\)/) {
         $depth = defined $cgi->param('depth') ?
-            $cgi->param('depth') : $ctx->{find_aou}->($site)->ou_type->depth;
+            $cgi->param('depth') : $ctx->{get_aou}->($site)->ou_type->depth;
         $query .= " depth($depth)";
     }
 
index 456f9c3..282d0e1 100644 (file)
@@ -41,7 +41,7 @@ sub init_ro_object_cache {
         $eclass =~ s/::/_/g;
 
         my $list_key = "${hint}_list";
-        my $find_key = "find_$hint";
+        my $get_key = "get_$hint";
 
         $ro_object_subs->{$list_key} = sub {
             my $method = "retrieve_all_$eclass";
@@ -51,7 +51,7 @@ sub init_ro_object_cache {
     
         $cache{map}{$hint} = {} unless $cache{map}{$hint};
 
-        $ro_object_subs->{$find_key} = sub {
+        $ro_object_subs->{$get_key} = sub {
             my $id = shift;
             return $cache{map}{$hint}{$id} if $cache{map}{$hint}{$id}; 
             ($cache{map}{$hint}{$id}) = grep { $_->$ident_field eq $id } @{$ro_object_subs->{$list_key}->()};
@@ -76,7 +76,7 @@ sub init_ro_object_cache {
             sub flesh_aout {
                 my $node = shift;
                 my $ro_object_subs = shift;
-                $node->ou_type( $ro_object_subs->{find_aout}->($node->ou_type) );
+                $node->ou_type( $ro_object_subs->{get_aout}->($node->ou_type) );
                 $cache{map}{aou}{$node->id} = $node;
                 flesh_aout($_, $ro_object_subs) foreach @{$node->children};
             };
@@ -89,7 +89,7 @@ sub init_ro_object_cache {
     };
 
     # Add a special handler for the tree-shaped org unit cache
-    $ro_object_subs->{find_aou} = sub {
+    $ro_object_subs->{get_aou} = sub {
         my $org_id = shift;
         $ro_object_subs->{aou_tree}->(); # force the org tree to load
         return $cache{map}{aou}{$org_id};
@@ -190,7 +190,7 @@ sub get_records_and_facets {
     if ($facet_key) {
         $facets = $facet_req->gather(1);
         $facets->{$_} = {
-            cmf => $self->ctx->{find_cmf}->($_),
+            cmf => $self->ctx->{get_cmf}->($_),
             data => $facets->{$_}
         } for keys %$facets;    # quick-n-dirty
     } else {
index 999d6b7..ac8d99c 100644 (file)
@@ -81,7 +81,7 @@
                         </div>
                     </td>
                     <td width="136">
-                        [% ctx.find_aou(ahr.pickup_lib).name %]
+                        [% ctx.get_aou(ahr.pickup_lib).name %]
                     </td>
                     <td width="104">
                         [% IF ahr.frozen == 't' AND ahr.thaw_date;
index ec18831..1a7c814 100644 (file)
                         </div>
                     </td>
                     <td width="136">
-                        [% ctx.find_aou(ahr.pickup_lib).name %]
+                        [% ctx.get_aou(ahr.pickup_lib).name %]
                     </td>
                     <td width="104">
                         <!-- <input
index 1c2f8b5..fc4dce0 100644 (file)
@@ -62,7 +62,7 @@
                 value="[% ctx.referer | replace('^http:', 'https:') | html %]" />
             <h1>Place Hold</h1>
             <p>
-                [% | l(attrs.title, ctx.find_aou(ctx.default_pickup_lib).name) %]
+                [% | l(attrs.title, ctx.get_aou(ctx.default_pickup_lib).name) %]
                 You would like to place a hold on <strong><q>[_1]</q></strong> to be picked up at [_2].
                 If this is correct, press <strong>SUBMIT</strong>.
                 [% END %]
index 79eb75b..015f533 100644 (file)
         <tr>
             <td>[%
                 # XXX KCLS-specific kludging
-                org_name = ctx.find_aou(copy_info.circ_lib).name;
+                org_name = ctx.get_aou(copy_info.circ_lib).name;
                 dir = org_name | lower | replace('[^\w]', '') |
                     replace('.+320th', '320th'); %]
                 <a href="http://www.kcls.org/[% dir %]/"
             [% IF ctx.is_staff %]
             <td>
                 [% copy_info.age_protect ?
-                    ctx.find_crahp(copy_info.age_protect).name : l('None') %]
+                    ctx.get_crahp(copy_info.age_protect).name : l('None') %]
             </td>
             <td>[% date.format(
                 ctx.parse_datetime(copy_info.create_date),