@@ -, +, @@ Plugin/Branches.pm --- C4/Context.pm | 13 +++++++++++-- Koha/Template/Plugin/Branches.pm | 4 ---- .../intranet-tmpl/prog/en/modules/tools/cleanborrowers.tt | 2 +- tools/cleanborrowers.pl | 1 + 4 files changed, 13 insertions(+), 7 deletions(-) --- a/C4/Context.pm +++ a/C4/Context.pm @@ -1145,6 +1145,16 @@ sub mybranch { C4::Context->userenv or return ''; return C4::Context->userenv->{branch} || ''; } + +=head2 only_my_library + + my $test = C4::Context->only_my_library; + + Returns true if you enabled IndependentBranches and the current user + does not have superlibrarian permissions. + +=cut + sub only_my_library { return C4::Context->preference('IndependentBranches') @@ -1153,9 +1163,8 @@ sub only_my_library { && C4::Context->userenv->{branch}; } - - 1; + __END__ =head1 ENVIRONMENT --- a/Koha/Template/Plugin/Branches.pm +++ a/Koha/Template/Plugin/Branches.pm @@ -55,10 +55,6 @@ sub GetURL { return $b->{branchurl}; } -sub OnlyMine { - return C4::Branch::onlymine; -} - sub all { my ( $self, $params ) = @_; my $selected = $params->{selected}; --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/cleanborrowers.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/cleanborrowers.tt @@ -60,7 +60,7 @@
-[% IF !Branches.OnlyMine %] +[% IF !OnlyMine %]
Select a library :