From 8068171fb28657807e01316ea20ff2a509a11211 Mon Sep 17 00:00:00 2001 From: Henri-Damien LAURENT Date: Fri, 28 Aug 2009 23:47:38 +0200 Subject: [PATCH] Bug Fixing Merge and addbybiblionumber.pl --- C4/VirtualShelves.pm | 20 +++++++++++++++++++ .../en/modules/virtualshelves/shelves.tmpl | 2 +- virtualshelves/addbybiblionumber.pl | 7 +++---- 3 files changed, 24 insertions(+), 5 deletions(-) diff --git a/C4/VirtualShelves.pm b/C4/VirtualShelves.pm index 06bd3a347e..9488555c94 100644 --- a/C4/VirtualShelves.pm +++ b/C4/VirtualShelves.pm @@ -604,6 +604,26 @@ sub _shelf_count ($$) { return $total; } +sub _biblionumber_sth { + my ($shelf) = @_; + my $query = 'select biblionumber from virtualshelfcontents where shelfnumber = ?'; + my $dbh = C4::Context->dbh; + my $sth = $dbh->prepare($query) + or die $dbh->errstr; + $sth->execute( $shelf ) + or die $sth->errstr; + $sth; +} + +sub each_biblionumbers (&$) { + my ($code,$shelf) = @_; + my $ref = _biblionumber_sth($shelf)->fetchall_arrayref; + map { + $_=$$_[0]; + $code->(); + } @$ref; +} + 1; __END__ diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tmpl index 5c9687cf45..5d037a2812 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tmpl @@ -121,7 +121,7 @@ function placeHold () {
- " /> + " />
diff --git a/virtualshelves/addbybiblionumber.pl b/virtualshelves/addbybiblionumber.pl index ee199ece42..623d1d628f 100755 --- a/virtualshelves/addbybiblionumber.pl +++ b/virtualshelves/addbybiblionumber.pl @@ -63,7 +63,6 @@ use C4::Circulation; use C4::Auth; #use it only to debug ! -use CGI::Carp qw/fatalsToBrowser/; use warnings; sub AddBibliosToShelf { @@ -81,11 +80,11 @@ sub AddBibliosToShelf { my $query = new CGI; # If set, then single item case. -my $biblionumber = $query->param('biblionumber'); +my @biblionumber = $query->param('biblionumber'); # If set, then multiple item case. -my $biblionumbers = $query->param('biblionumbers'); +my $biblionumbers = $query->param('biblionumbers'); my $shelfnumber = $query->param('shelfnumber'); my $newvirtualshelf = $query->param('newvirtualshelf'); my $category = $query->param('category'); @@ -151,7 +150,7 @@ else { # this shelf doesn't already exist. $shelvesloop{$shelf->{shelfnumber}} = $shelf->{shelfname}; } # then open shelves... - my ($shelflist) = GetRecentShelves(3, $limit, undef); + ($shelflist) = GetRecentShelves(3, $limit, undef); for my $shelf ( @{ $shelflist->[0] } ) { push( @shelvesloop, $shelf->{shelfnumber} ); $shelvesloop{$shelf->{shelfnumber}} = $shelf->{shelfname}; -- 2.39.5