@@ -, +, @@ Koha::Template::Plugin::Branches --- Koha/Template/Plugin/Branches.pm | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) --- a/Koha/Template/Plugin/Branches.pm +++ a/Koha/Template/Plugin/Branches.pm @@ -78,9 +78,18 @@ sub all { sub pickup_locations { my ($self, $params) = @_; - $params->{search_params} ||= {}; - $params->{search_params}->{pickup_location} = 1; - return $self->all($params); + + my $selected = $params->{selected}; + my $libraries = Koha::Libraries->pickup_locations($params); + for my $l ( @$libraries ) { + if ( defined $selected and $l->{branchcode} eq $selected + or not defined $selected and C4::Context->userenv and $l->{branchcode} eq C4::Context->userenv->{branch} + ) { + $l->{selected} = 1; + } + } + + return $libraries; } 1; --