From: Owen Leonard Date: Thu, 3 Jun 2010 17:54:21 +0000 (-0400) Subject: Fix for Bug 3770, 'Add to list' page only allows adding to private lists X-Git-Url: http://git.rot13.org/?p=koha.git;a=commitdiff_plain;h=dfb2c774353ad609cb112f317feb67d74d30230d 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 --- diff --git a/virtualshelves/addbybiblionumber.pl b/virtualshelves/addbybiblionumber.pl index d53a8c4e82..7af17c8ef3 100755 --- a/virtualshelves/addbybiblionumber.pl +++ b/virtualshelves/addbybiblionumber.pl @@ -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){