Bug 21249: (follow-up) Implement SearchLibraryLimit for individual library
before this patch, the limit only applies to groups of libraries Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> Signed-off-by: David Cook <dcook@prosentient.com.au> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
parent
b85b33f28c
commit
1698c36a8e
|
|
@ -399,6 +399,25 @@ if ( $params->{'multibranchlimit'} ) {
|
|||
}
|
||||
}
|
||||
|
||||
for ( my $i=0; $i<@limits; $i++ ) {
|
||||
if ( $limits[$i] =~ /^branch:/ ) {
|
||||
my $branchfield = C4::Context->preference('SearchLimitLibrary');
|
||||
if ( $branchfield eq "homebranch" ) {
|
||||
$limits[$i] =~ s/branch/homebranch/;
|
||||
}
|
||||
elsif ( $branchfield eq "holdingbranch" ) {
|
||||
$limits[$i] =~ s/branch/holdingbranch/;
|
||||
}
|
||||
else {
|
||||
my $homebranchlimit = $limits[$i];
|
||||
my $holdingbranchlimit = $limits[$i];
|
||||
$homebranchlimit =~ s/branch/homebranch/;
|
||||
$holdingbranchlimit =~ s/branch/holdingbranch/;
|
||||
$limits[$i] = "$homebranchlimit or $holdingbranchlimit";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
my $available;
|
||||
foreach my $limit(@limits) {
|
||||
if ($limit =~/available/) {
|
||||
|
|
|
|||
|
|
@ -505,6 +505,25 @@ if ( $params->{'multibranchlimit'} || ( $branch_group_limit && $branch_group_lim
|
|||
}
|
||||
}
|
||||
|
||||
for ( my $i=0; $i<@limits; $i++ ) {
|
||||
if ( $limits[$i] =~ /^branch:/ ) {
|
||||
my $branchfield = C4::Context->preference('SearchLimitLibrary');
|
||||
if ( $branchfield eq "homebranch" ) {
|
||||
$limits[$i] =~ s/branch/homebranch/;
|
||||
}
|
||||
elsif ( $branchfield eq "holdingbranch" ) {
|
||||
$limits[$i] =~ s/branch/holdingbranch/;
|
||||
}
|
||||
else {
|
||||
my $homebranchlimit = $limits[$i];
|
||||
my $holdingbranchlimit = $limits[$i];
|
||||
$homebranchlimit =~ s/branch/homebranch/;
|
||||
$holdingbranchlimit =~ s/branch/holdingbranch/;
|
||||
$limits[$i] = "$homebranchlimit or $holdingbranchlimit";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
my $available;
|
||||
foreach my $limit(@limits) {
|
||||
if ($limit =~/available/) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue