From f435d83c0c5283f49cf4089b17c298860e6168ac Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Fri, 26 Aug 2016 08:01:07 +0200 Subject: [PATCH] Bug 15758: [QA Follow-up] Remove onlymine from Plugin/Branches.pm Hard to miss that one: Template process failed: plugin error - Bareword "C4::Branch::onlymine" not allowed while "strict subs" in use at Koha/Template/Plugin/Branches.pm line 59. Compilation failed in require at /usr/lib/perl5/Template/Plugins.pm line 206. Removed OnlyMine from Plugin/Branches. Replaced by a template var in cleanborrowers; it was used only once. Signed-off-by: Marcel de Rooy Signed-off-by: Kyle M Hall --- C4/Context.pm | 13 +++++++++++-- Koha/Template/Plugin/Branches.pm | 4 ---- .../prog/en/modules/tools/cleanborrowers.tt | 2 +- tools/cleanborrowers.pl | 1 + 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/C4/Context.pm b/C4/Context.pm index c84230dd5a..5f49bbedd6 100644 --- a/C4/Context.pm +++ b/C4/Context.pm @@ -1035,6 +1035,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') @@ -1043,9 +1053,8 @@ sub only_my_library { && C4::Context->userenv->{branch}; } - - 1; + __END__ =head1 ENVIRONMENT diff --git a/Koha/Template/Plugin/Branches.pm b/Koha/Template/Plugin/Branches.pm index 3f62f1e834..3d17edc53b 100644 --- a/Koha/Template/Plugin/Branches.pm +++ b/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}; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/cleanborrowers.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/cleanborrowers.tt index ae7df4edb5..7ff66d6e89 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/cleanborrowers.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/cleanborrowers.tt @@ -60,7 +60,7 @@
-[% IF !Branches.OnlyMine %] +[% IF !OnlyMine %]
Select a library :