my @facets = $cgi->param('facet');
my $limit = $self->_get_search_limit;
$ctx->{search_ou} = $self->_get_search_lib();
+ $ctx->{pref_ou} = $self->_get_pref_lib() || $ctx->{search_ou};
my $offset = $page * $limit;
my $metarecord = $cgi->param('metarecord');
my $results;
{
flesh => '{holdings_xml,mra,acp,acnp,acns,bmp}',
site => $site,
- depth => $depth
+ depth => $depth,
+ pref_lib => $ctx->{pref_ou},
}
);
my $page = $self->cgi->param("page") || 0;
my $limit = $self->_get_search_limit;
$self->ctx->{search_ou} = $self->_get_search_lib();
+ $self->ctx->{pref_ou} = $self->_get_pref_lib();
my $offset = $page * $limit;
$self->ctx->{records} = [];
}
my ($facets, @data) = $self->get_records_and_facets(
- $self->ctx->{ids}, undef, {flesh => "{holdings_xml,mra,acnp,acns}"}
+ $self->ctx->{ids}, undef, {
+ flesh => "{holdings_xml,mra,acnp,acns}",
+ pref_lib => $self->ctx->{pref_ou},
+ }
);
$self->ctx->{records} = [@data];
$unapi_args->{site},
$unapi_args->{depth},
'acn=>' . $unapi_args->{flesh_depth} . ',acp=>' . $unapi_args->{flesh_depth},
+ undef, undef, $unapi_args->{pref_lib}
]}
) for @$rec_ids;
$loc = $self->cgi->param('loc');
return $loc if $loc;
+ my $pref_lib = $self->_get_pref_lib();
+ return $pref_lib if $pref_lib;
+
+ return $ctx->{aou_tree}->()->id;
+}
+
+sub _get_pref_lib {
+ my $self = shift;
+ my $ctx = $self->ctx;
+
+ # plib param takes precedence
+ my $plib = $self->cgi->param('plib');
+ return $plib if $plib;
+
if ($ctx->{user}) {
# See if the user has a search library preference
my $lset = $self->editor->search_actor_user_setting({
return $self->cgi->param('physical_loc');
}
- return $ctx->{aou_tree}->()->id;
}
# This is defensively coded since we don't do much manual reading from the