Fix for Bug 3770, 'Add to list' page only allows adding to private lists

This patch is a reformat of chad@pennmanor.net's submission to
the bug report on 2010-02-16.

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
This commit is contained in:
Owen Leonard 2010-06-03 13:54:21 -04:00 committed by Galen Charlton
parent 6af71b5f8d
commit dfb2c77435
1 changed files with 9 additions and 10 deletions

View File

@ -153,18 +153,17 @@ if ( $shelfnumber || ( $shelfnumber == -1 ) ) { # the shelf already exist.
}
else { # this shelf doesn't already exist.
my $limit = 10;
my ($shelflist) = GetRecentShelves(1, $limit, $loggedinuser);
my ($shelflist);
my @shelvesloop;
my %shelvesloop;
for my $shelf ( @{ $shelflist->[0] } ) {
push( @shelvesloop, $shelf->{shelfnumber} );
$shelvesloop{$shelf->{shelfnumber}} = $shelf->{shelfname};
}
# then open shelves...
($shelflist) = GetRecentShelves(3, $limit, undef);
for my $shelf ( @{ $shelflist->[0] } ) {
push( @shelvesloop, $shelf->{shelfnumber} );
$shelvesloop{$shelf->{shelfnumber}} = $shelf->{shelfname};
#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);
for my $shelf (@{ $shelflist->[0] }) {
push(@shelvesloop, $shelf->{shelfnumber});
$shelvesloop{$shelf->{shelfnumber}} = $shelf->{shelfname};
}
}
if(@shelvesloop gt 0){