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 <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
$subscription->{expirationdate} = $expirationdate;
next if $expirationdate !~ /\d{4}-\d{2}-\d{2}/; # next if not in ISO format.
next if $subscription->{closed};
$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;
or ( !ref $flags->{serials} and $flags->{serials} == 1 ) )
{
$subscription->{cannotedit} = 0;
my $branchname;
my $branches_loop;
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 ) )
{
or ( ref $flags->{serials} and $flags->{serials}->{superserials} )
or ( !ref $flags->{serials} and $flags->{serials} == 1 ) )
{