View | Details | Raw Unified | Return to bug 5994
Collapse All | Expand All

(-)a/C4/Auth.pm (-1 / +1 lines)
Lines 837-843 sub checkauth { Link Here
837
				# and the number of lists to be displayed of each type in the 'Lists' button drop down
837
				# and the number of lists to be displayed of each type in the 'Lists' button drop down
838
				my $row_count = 10; # FIXME:This probably should be a syspref
838
				my $row_count = 10; # FIXME:This probably should be a syspref
839
				my ($total, $totshelves, $barshelves, $pubshelves);
839
				my ($total, $totshelves, $barshelves, $pubshelves);
840
				($barshelves, $totshelves) = C4::VirtualShelves::GetRecentShelves(1, $row_count, $borrowernumber);
840
				($barshelves, $totshelves) = C4::VirtualShelves::GetRecentShelves(1, undef, $borrowernumber);
841
				$total->{'bartotal'} = $totshelves;
841
				$total->{'bartotal'} = $totshelves;
842
				($pubshelves, $totshelves) = C4::VirtualShelves::GetRecentShelves(2, $row_count, undef);
842
				($pubshelves, $totshelves) = C4::VirtualShelves::GetRecentShelves(2, $row_count, undef);
843
				$total->{'pubtotal'} = $totshelves;
843
				$total->{'pubtotal'} = $totshelves;
(-)a/C4/VirtualShelves.pm (-3 / +5 lines)
Lines 201-211 sub GetRecentShelves ($$$) { Link Here
201
	my ($mincategory, $row_count, $owner) = @_;
201
	my ($mincategory, $row_count, $owner) = @_;
202
    my (@shelflist);
202
    my (@shelflist);
203
	my $total = _shelf_count($owner, $mincategory);
203
	my $total = _shelf_count($owner, $mincategory);
204
	my @params = ($owner, $mincategory, 0, $row_count);	 #FIXME: offset is hardcoded here, but could be passed in for enhancements
204
	my @params = ($owner, $mincategory);	
205
	push @params, $row_count if (defined $row_count);
205
	shift @params if (not defined $owner);
206
	shift @params if (not defined $owner);
206
	my $query = "SELECT * FROM virtualshelves";
207
	my $query = "SELECT * FROM virtualshelves";
207
	$query .= ((defined $owner) ? " WHERE owner = ? AND category = ?" : " WHERE category >= ? ");
208
	$query .= ((defined $owner) ? " WHERE owner = ? AND category = ?" : " WHERE category >= ? ");
208
	$query .= " ORDER BY lastmodified DESC LIMIT ?, ?";
209
	$query .= " ORDER BY lastmodified DESC";
210
	$query .= " LIMIT ?" if (defined $row_count);
209
	my $sth = $dbh->prepare($query);
211
	my $sth = $dbh->prepare($query);
210
	$sth->execute(@params);
212
	$sth->execute(@params);
211
	@shelflist = $sth->fetchall_arrayref({});
213
	@shelflist = $sth->fetchall_arrayref({});
Lines 534-540 sub RefreshShelvesSummary ($$$) { Link Here
534
	my $session = C4::Auth::get_session($sessionID);
536
	my $session = C4::Auth::get_session($sessionID);
535
	my ($total, $totshelves, $barshelves, $pubshelves);
537
	my ($total, $totshelves, $barshelves, $pubshelves);
536
538
537
	($barshelves, $totshelves) = GetRecentShelves(1, $row_count, $loggedinuser);
539
	($barshelves, $totshelves) = GetRecentShelves(1, undef, $loggedinuser);
538
	$total->{'bartotal'} = $totshelves;
540
	$total->{'bartotal'} = $totshelves;
539
	($pubshelves, $totshelves) = GetRecentShelves(2, $row_count, undef);
541
	($pubshelves, $totshelves) = GetRecentShelves(2, $row_count, undef);
540
	$total->{'pubtotal'} = $totshelves;
542
	$total->{'pubtotal'} = $totshelves;
(-)a/catalogue/search.pl (-1 / +1 lines)
Lines 672-678 if ($query_desc || $limit_desc) { Link Here
672
672
673
my $row_count = 10; # FIXME:This probably should be a syspref
673
my $row_count = 10; # FIXME:This probably should be a syspref
674
my ($pubshelves, $total) = GetRecentShelves(2, $row_count, undef);
674
my ($pubshelves, $total) = GetRecentShelves(2, $row_count, undef);
675
my ($barshelves, $total) = GetRecentShelves(1, $row_count, $borrowernumber);
675
my ($barshelves, $total) = GetRecentShelves(1, undef, $borrowernumber);
676
676
677
my @pubshelves = @{$pubshelves};
677
my @pubshelves = @{$pubshelves};
678
my @barshelves = @{$barshelves};
678
my @barshelves = @{$barshelves};
(-)a/opac/opac-addbybiblionumber.pl (-1 / +1 lines)
Lines 102-108 else { Link Here
102
    my %shelvesloop;
102
    my %shelvesloop;
103
    #grab each type of shelf, open (type 3) should not be limited by user.
103
    #grab each type of shelf, open (type 3) should not be limited by user.
104
    foreach my $shelftype (1,2,3) {
104
    foreach my $shelftype (1,2,3) {
105
        my ($shelflist) = GetRecentShelves($shelftype, $limit, $shelftype == 3 ? undef : $loggedinuser);
105
        my ($shelflist) = GetRecentShelves($shelftype, $shelftype == 1 ? undef : $limit, $shelftype == 3 ? undef : $loggedinuser);
106
        for my $shelf (@{ $shelflist->[0] }) {
106
        for my $shelf (@{ $shelflist->[0] }) {
107
            push(@shelvesloop, $shelf->{shelfnumber});
107
            push(@shelvesloop, $shelf->{shelfnumber});
108
            $shelvesloop{$shelf->{shelfnumber}} = $shelf->{shelfname};
108
            $shelvesloop{$shelf->{shelfnumber}} = $shelf->{shelfname};
(-)a/virtualshelves/addbybiblionumber.pl (-2 / +1 lines)
Lines 153-159 if ( $shelfnumber || ( $shelfnumber == -1 ) ) { # the shelf already exist. Link Here
153
}
153
}
154
else {    # this shelf doesn't already exist.
154
else {    # this shelf doesn't already exist.
155
    my $limit = 10;
155
    my $limit = 10;
156
    my ($shelflist);
156
    my ($shelflist) = GetRecentShelves(1, undef, $loggedinuser);
157
    my @shelvesloop;
157
    my @shelvesloop;
158
    my %shelvesloop;
158
    my %shelvesloop;
159
159
160
- 

Return to bug 5994