# 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)){
$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 = ?");
if (!$type){
$branches{$branch->{'branchcode'}}=$branch;
}
- }
+
return (\%branches);
}