Bug 6308 - Show number of comments - new patch
[koha_fer] / C4 / VirtualShelves.pm
index 5bddadb..6ed7549 100644 (file)
@@ -220,9 +220,9 @@ sub GetRecentShelves {
 
 =head2 GetAllShelves
 
-    ($shelflist) = GetAllShelves($owner)
+    $shelflist = GetAllShelves($owner)
 
-This function returns a references to an array of hashrefs containing all shelves sorted
+This function returns a reference to an array of hashrefs containing all shelves sorted
 by the shelf name.
 
 This function is intended to return a dataset reflecting all the shelves for
@@ -230,15 +230,12 @@ the submitted parameters.
 
 =cut
 
-sub GetAllShelves ($$) {
+sub GetAllShelves {
     my ($category,$owner) = @_;
-    my (@shelflist);
-    my @params = ($category,$owner);
-    my $query = "SELECT * FROM virtualshelves WHERE category = ? AND owner = ? ORDER BY shelfname ASC";
-    my $sth = $dbh->prepare($query);
-    $sth->execute(@params);
-    @shelflist = $sth->fetchall_arrayref({});
-    return ( \@shelflist );
+    my $query = 'SELECT * FROM virtualshelves WHERE category = ? AND owner = ? ORDER BY shelfname ASC';
+    my $sth = $dbh->prepare( $query );
+    $sth->execute( $category, $owner );
+    return $sth->fetchall_arrayref({});
 }
 
 =head2 GetShelf