Allow GetBranchesLoop to intuit IndependantBranches if not specified in argument.
authorJoe Atzberger <joe.atzberger@liblime.com>
Thu, 18 Dec 2008 03:35:21 +0000 (21:35 -0600)
committerHenri-Damien LAURENT <henridamien.laurent@biblibre.com>
Tue, 26 May 2009 19:15:00 +0000 (21:15 +0200)
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
Signed-off-by: Henri-Damien LAURENT <henridamien.laurent@biblibre.com>
C4/Branch.pm

index cd81368..9ec155a 100644 (file)
@@ -133,9 +133,9 @@ sub GetBranches {
     return ( \%branches );
 }
 
-sub GetBranchesLoop ($$) {  # since this is what most pages want anyway
+sub GetBranchesLoop ($;$) {  # since this is what most pages want anyway
     my $branch   = shift or return undef;
-    my $onlymine = shift || 0;
+    my $onlymine = shift || C4::Context->preference("IndependantBranches");
     my $branches = GetBranches($onlymine);
     my @loop;
     foreach (sort { $branches->{$a}->{branchname} cmp $branches->{$b}->{branchname} } keys %$branches) {