[Koha-patches] [PATCH] Fix for Bug 3770, 'Add to list' page only allows adding to private lists
Owen Leonard
oleonard at myacpl.org
Thu Jun 3 19:54:21 CEST 2010
This patch is a reformat of chad at pennmanor.net's submission to
the bug report on 2010-02-16.
---
virtualshelves/addbybiblionumber.pl | 19 +++++++++----------
1 files changed, 9 insertions(+), 10 deletions(-)
diff --git a/virtualshelves/addbybiblionumber.pl b/virtualshelves/addbybiblionumber.pl
index d53a8c4..7af17c8 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){
--
1.7.0.4
More information about the Koha-patches
mailing list