X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;f=C4%2FVirtualShelves.pm;h=c74ecb3ef871473908658ec1dda0b70b48687973;hb=20fd03724aca67beb98b09dbf2275a81a1f8a3a7;hp=df54de87c3d0dbb4e3ed4f413f9bbb39335c58a1;hpb=bd73c9f9ce8d161a1ed0f2e1205e5c0c8eecb0ae;p=koha_gimpoz diff --git a/C4/VirtualShelves.pm b/C4/VirtualShelves.pm index df54de87c3..c74ecb3ef8 100644 --- a/C4/VirtualShelves.pm +++ b/C4/VirtualShelves.pm @@ -26,10 +26,7 @@ use warnings; use Carp; use C4::Context; -use C4::Circulation; use C4::Debug; -use C4::Members; -require C4::Auth; use vars qw($VERSION @ISA @EXPORT @EXPORT_OK); @@ -203,15 +200,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({}); @@ -462,7 +463,8 @@ sub ShelfPossibleAction { my $sth = $dbh->prepare($query); $sth->execute($shelfnumber); my ( $owner, $category ) = $sth->fetchrow; - my $borrower = GetMemberDetails($user); + require C4::Members; + my $borrower = C4::Members::GetMemberDetails($user); return 0 if not defined($user); return 1 if ( $category >= 3); # open list return 1 if (($category >= 2) and @@ -555,7 +557,7 @@ This function is used in conjunction with the 'Lists' button in masthead.inc. =cut sub RefreshShelvesSummary ($$$) { - + require C4::Auth; my ($sessionID, $loggedinuser, $row_count) = @_; my $session = C4::Auth::get_session($sessionID); my ($total, $totshelves, $barshelves, $pubshelves);