From 98a1ea38ddefb8bca5525dda051c9d4eea8489c8 Mon Sep 17 00:00:00 2001 From: Joe Atzberger Date: Tue, 30 Dec 2008 13:42:10 -0600 Subject: [PATCH] Allow all argument forms to GetBranchesLoops. Allow arguments to be specified in the negative (i.e. 0). Allow function to be called with no arguments. This supercedes the patch titled: Allow GetBranchesLoop to intuit IndependantBranches if not specified in argument. Signed-off-by: Galen Charlton Signed-off-by: Henri-Damien LAURENT --- C4/Branch.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/C4/Branch.pm b/C4/Branch.pm index 9ec155a273..44da91d493 100644 --- a/C4/Branch.pm +++ b/C4/Branch.pm @@ -133,9 +133,9 @@ sub GetBranches { return ( \%branches ); } -sub GetBranchesLoop ($;$) { # since this is what most pages want anyway - my $branch = shift or return undef; - my $onlymine = shift || C4::Context->preference("IndependantBranches"); +sub GetBranchesLoop (;$$) { # since this is what most pages want anyway + my $branch = @_ ? shift : ''; # optional first argument is branchcode of "my branch", if preselection is wanted. + my $onlymine = @_ ? shift : C4::Context->preference("IndependantBranches"); my $branches = GetBranches($onlymine); my @loop; foreach (sort { $branches->{$a}->{branchname} cmp $branches->{$b}->{branchname} } keys %$branches) { -- 2.20.1