bug fix: syntax error in sub getbranches
authorbtoumi <btoumi>
Wed, 7 Jun 2006 07:50:04 +0000 (07:50 +0000)
committerbtoumi <btoumi>
Wed, 7 Jun 2006 07:50:04 +0000 (07:50 +0000)
C4/Koha.pm

index 7dd57e8..3d6abb7 100644 (file)
@@ -120,6 +120,7 @@ sub getbranches {
 # returns a reference to a hash of references to branches...
         my ($type) = @_;
        my %branches;
+       my $branch;
        my $dbh = C4::Context->dbh;
        my $sth;
        if (C4::Context->preference("IndependantBranches") && (C4::Context->userenv->{flags}!=1)){
@@ -131,7 +132,7 @@ sub getbranches {
        $sth = $dbh->prepare("Select * from branches order by branchname");
        }
        $sth->execute;
-       while (my $branch=$sth->fetchrow_hashref) {
+       while ($branch=$sth->fetchrow_hashref) {
                my $nsth = $dbh->prepare("select categorycode from branchrelations where branchcode = ?");
                if ($type){
                    $nsth = $dbh->prepare("select categorycode from branchrelations where branchcode = ? and categorycode = ?");
@@ -158,7 +159,7 @@ sub getbranches {
                 if (!$type){
                    $branches{$branch->{'branchcode'}}=$branch;
                }
-       }
+
        return (\%branches);
 }