diff --git a/Koha/Template/Plugin/Branches.pm b/Koha/Template/Plugin/Branches.pm index 343158cc16..d1801bee9d 100644 --- a/Koha/Template/Plugin/Branches.pm +++ b/Koha/Template/Plugin/Branches.pm @@ -24,6 +24,7 @@ use base qw( Template::Plugin ); use Encode qw{encode decode}; use C4::Koha; +use C4::Context; sub GetName { my ( $self, $branchcode ) = @_; @@ -35,4 +36,10 @@ sub GetName { return $b ? encode( 'UTF-8', $b->{'branchname'} ) : q{}; } +sub GetLoggedInBranchcode { + my ($self) = @_; + + return C4::Context->userenv->{'branch'} if C4::Context->userenv; +} + 1; diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search-box.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search-box.inc index 388c467f94..8e3bf66a3b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search-box.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search-box.inc @@ -1,3 +1,4 @@ +[% USE Branches %] [% IF ( CAN_user_circulate ) %][% IF ( CircAutocompl ) %]