* correct POD - returns *public* lists that bib belongs to * use fetchall_arrayref to return results in one fell swoop * corrected indentation
Signed-off-by: Galen Charlton <[email protected]> --- C4/VirtualShelves.pm | 22 ++++++++++++---------- 1 files changed, 12 insertions(+), 10 deletions(-) diff --git a/C4/VirtualShelves.pm b/C4/VirtualShelves.pm index 5047550..06bd3a3 100644 --- a/C4/VirtualShelves.pm +++ b/C4/VirtualShelves.pm @@ -535,20 +535,22 @@ sub DelShelf { =item GetBibShelves -This finds all the lists that this bib record is in. +This finds all the public lists that this bib record is in. =cut sub GetBibliosShelves { - my ( $biblionumber ) = @_; - my $dbh = C4::Context->dbh; - my $sth = $dbh->prepare('SELECT vs.shelfname, vs.shelfnumber FROM virtualshelves vs LEFT JOIN virtualshelfcontents vc ON (vs.shelfnumber= vc.shelfnumber) WHERE vs.category != 1 AND vc.biblionumber= ?'); - $sth->execute( $biblionumber ); - my @lists; - while (my $data = $sth->fetchrow_hashref){ - push @lists,$data; - } - return \...@lists; + my ( $biblionumber ) = @_; + my $dbh = C4::Context->dbh; + my $sth = $dbh->prepare(' + SELECT vs.shelfname, vs.shelfnumber + FROM virtualshelves vs + JOIN virtualshelfcontents vc ON (vs.shelfnumber= vc.shelfnumber) + WHERE vs.category != 1 + AND vc.biblionumber= ? + '); + $sth->execute( $biblionumber ); + return $sth->fetchall_arrayref({}); } =item RefreshShelvesSummary -- 1.6.3.3 _______________________________________________ Koha-patches mailing list [email protected] http://lists.koha.org/mailman/listinfo/koha-patches
