From f0dc7fd44f98d354a69e4b240f3687099776f77f 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 Content-Type: text/plain; charset=utf-8 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 --- 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(-) diff --git a/C4/Context.pm b/C4/Context.pm index c1cee07..d67ab13 100644 --- a/C4/Context.pm +++ b/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 diff --git a/Koha/Template/Plugin/Branches.pm b/Koha/Template/Plugin/Branches.pm index 3f62f1e..3d17edc 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 ae7df4e..7ff66d6 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 :