@@ -, +, @@ --- Koha/Template/Plugin/Branches.pm | 8 -------- koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt | 2 +- koha-tmpl/intranet-tmpl/prog/en/modules/circ/request-article.tt | 2 +- koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt | 2 +- koha-tmpl/intranet-tmpl/prog/en/modules/tools/cleanborrowers.tt | 2 +- koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-request-article.tt | 2 +- t/db_dependent/Template/Plugin/Branches.t | 7 +------ 7 files changed, 6 insertions(+), 19 deletions(-) --- a/Koha/Template/Plugin/Branches.pm +++ a/Koha/Template/Plugin/Branches.pm @@ -37,14 +37,6 @@ sub GetName { return $b ? $b->{'branchname'} : q{}; } -sub GetLoggedInBranchcode { - my ($self) = @_; - - return C4::Context->userenv ? - C4::Context->userenv->{'branch'} : - ''; -} - sub GetURL { my ( $self, $branchcode ) = @_; --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -787,7 +787,7 @@ Hold placed on [% w.reservedate | $KohaDates %].
- [% IF ( w.branch.branchcode == Branches.GetLoggedInBranchcode() ) %][% ELSE %][% END %] + [% IF ( w.branch.branchcode == logged_in_user.branchcode ) %][% ELSE %][% END %] [% SET expires_on = w.expirationdate %] Waiting at [% w.branch.branchname | html %] [% IF expires_on %] until [% expires_on | $KohaDates %] [% END %] --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/request-article.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/request-article.tt @@ -136,7 +136,7 @@ [% FOREACH b IN Branches.all %] - [% IF b.branchcode == Branches.GetLoggedInBranchcode %] + [% IF b.branchcode == logged_in_user.library.branchcode %] [% ELSE %] --- a/t/db_dependent/Template/Plugin/Branches.t +++ a/t/db_dependent/Template/Plugin/Branches.t @@ -39,7 +39,7 @@ my $builder = t::lib::TestBuilder->new; subtest 'all() tests' => sub { - plan tests => 16; + plan tests => 14; $schema->storage->txn_begin; @@ -68,12 +68,7 @@ subtest 'all() tests' => sub { $name = $plugin->GetName(undef); is($name, '', 'received empty string as name of NULL/undefined library code'); - $library = $plugin->GetLoggedInBranchcode(); - is($library, '', 'no active library if there is no active user session'); - t::lib::Mocks::mock_userenv({ branchcode => 'MYLIBRARY' }); - $library = $plugin->GetLoggedInBranchcode(); - is($library, 'MYLIBRARY', 'GetLoggedInBranchcode() returns active library'); t::lib::Mocks::mock_preference( 'IndependentBranches', 0 ); my $libraries = $plugin->all(); --