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

(-)a/C4/VirtualShelves.pm (-3 / +7 lines)
Lines 203-217 sub GetRecentShelves { Link Here
203
    my @params;
203
    my @params;
204
    my $selection;
204
    my $selection;
205
    if (defined $owner) {
205
    if (defined $owner) {
206
        @params = ($owner, $mincategory, $row_count);
206
        @params = ($owner, $mincategory);
207
        $selection = ' WHERE owner = ? AND category = ?';
207
        $selection = ' WHERE owner = ? AND category = ?';
208
    } else {
208
    } else {
209
        @params = ( $mincategory, $row_count);
209
        @params = ( $mincategory);
210
        $selection = ' WHERE category >= ? ';
210
        $selection = ' WHERE category >= ? ';
211
    }
211
    }
212
    my $query = 'SELECT * FROM virtualshelves';
212
    my $query = 'SELECT * FROM virtualshelves';
213
    $query .= $selection;
213
    $query .= $selection;
214
    $query .= ' ORDER BY lastmodified DESC LIMIT ?';
214
    $query .= ' ORDER BY lastmodified DESC';
215
    if ($row_count){
216
	$query .= ' LIMIT ?';
217
	push @params,$row_count;
218
    }
215
    my $sth = $dbh->prepare($query);
219
    my $sth = $dbh->prepare($query);
216
    $sth->execute(@params);
220
    $sth->execute(@params);
217
    my $shelflist = $sth->fetchall_arrayref({});
221
    my $shelflist = $sth->fetchall_arrayref({});
(-)a/virtualshelves/addbybiblionumber.pl (-3 / +2 lines)
Lines 152-165 if ( $shelfnumber || ( $shelfnumber == -1 ) ) { # the shelf already exist. Link Here
152
    }
152
    }
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);
157
    my @shelvesloop;
157
    my @shelvesloop;
158
    my %shelvesloop;
158
    my %shelvesloop;
159
159
160
    #grab each type of shelf, open (type 3) should not be limited by user.
160
    #grab each type of shelf, open (type 3) should not be limited by user.
161
    foreach my $shelftype (1,2,3) {
161
    foreach my $shelftype (1,2,3) {
162
	    my ($shelflist) = GetRecentShelves($shelftype, $limit, $shelftype == 3 ? undef : $loggedinuser);
162
	    my ($shelflist) = GetRecentShelves($shelftype, undef, $shelftype == 3 ? undef : $loggedinuser);
163
	    for my $shelf (@{ $shelflist }) {
163
	    for my $shelf (@{ $shelflist }) {
164
		    push(@shelvesloop, $shelf->{shelfnumber});
164
		    push(@shelvesloop, $shelf->{shelfnumber});
165
		    $shelvesloop{$shelf->{shelfnumber}} = $shelf->{shelfname};
165
		    $shelvesloop{$shelf->{shelfnumber}} = $shelf->{shelfname};
166
- 

Return to bug 6555