From b235b4da210b052595dce77215ac06b74847c137 Mon Sep 17 00:00:00 2001 From: Katrin Fischer Date: Tue, 20 Oct 2015 16:36:06 +0200 Subject: [PATCH] [PASSED QA] Bug 8436: QA Follow-up: Activate branch filter, if IndependentBranches is off The superserials permission is only in use in combination with IndependentBranches - so it makes sense to also show the branch filter when IndependentBranches is off. Permission description: superserials Manage subscriptions from any branch (only applies when IndependentBranches is used) Also adds a missing check for superlibraian. Note: the duplicated permission check in the code is not really nice - would be good to rewrite this to be more clean. Signed-off-by: Kyle M Hall --- serials/checkexpiration.pl | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) diff --git a/serials/checkexpiration.pl b/serials/checkexpiration.pl index bb0715a..62cac74 100755 --- a/serials/checkexpiration.pl +++ b/serials/checkexpiration.pl @@ -81,7 +81,9 @@ if ($date) { $subscription->{expirationdate} = $expirationdate; next if $expirationdate !~ /\d{4}-\d{2}-\d{2}/; # next if not in ISO format. next if $subscription->{closed}; - if ( ( ref $flags->{serials} and $flags->{serials}->{superserials} ) + if ( !C4::Context->preference("IndependentBranches") + or C4::Context->IsSuperLibrarian() + or ( ref $flags->{serials} and $flags->{serials}->{superserials} ) or ( !ref $flags->{serials} and $flags->{serials} == 1 ) ) { $subscription->{cannotedit} = 0; @@ -107,7 +109,8 @@ if ($date) { my $branchname; my $branches_loop; -if ( C4::Context->IsSuperLibrarian() +if ( !C4::Context->preference("IndependentBranches") + or C4::Context->IsSuperLibrarian() or ( ref $flags->{serials} and $flags->{serials}->{superserials} ) or ( !ref $flags->{serials} and $flags->{serials} == 1 ) ) { -- 1.7.2.5