From: Chris Cormack Date: Sun, 4 Sep 2011 23:27:40 +0000 (+1200) Subject: Bug 6555 : only 10 lists show in the staff client X-Git-Url: http://git.rot13.org/?a=commitdiff_plain;h=e23608a1f90b7d25068870e82a19721fd70e60a5;hp=6c0962f06b35d897fc0e1f2276182feeb3124c6f;p=koha.git Bug 6555 : only 10 lists show in the staff client Signed-off-by: Nicole C. Engard Signed-off-by: Ian Walls Signed-off-by: Chris Cormack --- diff --git a/C4/VirtualShelves.pm b/C4/VirtualShelves.pm index df54de87c3..57b86daba3 100644 --- a/C4/VirtualShelves.pm +++ b/C4/VirtualShelves.pm @@ -203,15 +203,19 @@ sub GetRecentShelves { my @params; my $selection; if (defined $owner) { - @params = ($owner, $mincategory, $row_count); + @params = ($owner, $mincategory); $selection = ' WHERE owner = ? AND category = ?'; } else { - @params = ( $mincategory, $row_count); + @params = ( $mincategory); $selection = ' WHERE category >= ? '; } my $query = 'SELECT * FROM virtualshelves'; $query .= $selection; - $query .= ' ORDER BY lastmodified DESC LIMIT ?'; + $query .= ' ORDER BY lastmodified DESC'; + if ($row_count){ + $query .= ' LIMIT ?'; + push @params,$row_count; + } my $sth = $dbh->prepare($query); $sth->execute(@params); my $shelflist = $sth->fetchall_arrayref({}); diff --git a/virtualshelves/addbybiblionumber.pl b/virtualshelves/addbybiblionumber.pl index f1ac67428f..1dbffbbc35 100755 --- a/virtualshelves/addbybiblionumber.pl +++ b/virtualshelves/addbybiblionumber.pl @@ -152,14 +152,14 @@ if ( $shelfnumber || ( $shelfnumber == -1 ) ) { # the shelf already exist. } } else { # this shelf doesn't already exist. - my $limit = 10; +# my $limit = 10; my ($shelflist); my @shelvesloop; my %shelvesloop; #grab each type of shelf, open (type 3) should not be limited by user. foreach my $shelftype (1,2,3) { - my ($shelflist) = GetRecentShelves($shelftype, $limit, $shelftype == 3 ? undef : $loggedinuser); + my ($shelflist) = GetRecentShelves($shelftype, undef, $shelftype == 3 ? undef : $loggedinuser); for my $shelf (@{ $shelflist }) { push(@shelvesloop, $shelf->{shelfnumber}); $shelvesloop{$shelf->{shelfnumber}} = $shelf->{shelfname};