(bug #3778) GetBranchesLoop and searchMyLibraryFirst

This fix GetBranchesLoop, if searchmylibraryfirst is disabled, getbranchesloop mustn't select any branch.
This commit is contained in:
Nahuel ANGELINETTI 2009-11-09 09:38:25 +01:00 committed by Henri-Damien LAURENT
parent bf95c2513d
commit 36ae08af32
1 changed files with 2 additions and 1 deletions

View File

@ -156,10 +156,11 @@ sub GetBranchesLoop (;$$) { # since this is what most pages want anyway
my $onlymine = @_ ? shift : onlymine();
my $branches = GetBranches($onlymine);
my @loop;
my $searchMyLibraryFirst = C4::Context->preference("SearchMyLibraryFirst");;
foreach (sort { $branches->{$a}->{branchname} cmp $branches->{$b}->{branchname} } keys %$branches) {
push @loop, {
value => $_,
selected => ($_ eq $branch) ? 1 : 0,
selected => (($_ eq $branch) && $searchMyLibraryFirst ) ? 1 : 0,
branchname => $branches->{$_}->{branchname},
};
}