@@ -, +, @@ --- opac/opac-search.pl | 12 ++++++++++-- 1 files changed, 10 insertions(+), 2 deletions(-) --- a/opac/opac-search.pl +++ a/opac/opac-search.pl @@ -141,9 +141,17 @@ if (C4::Context->preference('TagsEnabled')) { # load the branches -my $branches = GetBranches(); # used later in *getRecords, probably should be internalized by those functions after caching in C4::Branch is established +my $mybranch = ( C4::Context->preference('SearchMyLibraryFirst') && C4::Context->userenv && C4::Context->userenv->{branch} ) ? C4::Context->userenv->{branch} : ''; +my $branches = GetBranches(); # used later in *getRecords, probably should be internalized by those functions after caching in C4::Branch is established +my $branchloop = GetBranchesLoop( $mybranch, 0 ); +unless ($mybranch){ + foreach (@$branchloop){ + $_->{'selected'}=0; + } +} $template->param( - searchdomainloop => GetBranchCategories(undef,'searchdomain'), + branchloop => $branchloop, + searchdomainloop => GetBranchCategories( undef, 'searchdomain' ), ); # load the language limits (for search) --