[Koha-patches] [PATCH] [bug #2766] Just add the record in the new shelf

Nahuel Angelinetti nahuel.angelinetti at biblibre.com
Fri Nov 7 09:33:07 CET 2008


At the moment, the script doesn't add the biblio record in the just created shelf, but it should.
This patch fix this, and add the record in the shelf.
---
 opac/opac-addbybiblionumber.pl |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/opac/opac-addbybiblionumber.pl b/opac/opac-addbybiblionumber.pl
index 9fe02ee..148441f 100755
--- a/opac/opac-addbybiblionumber.pl
+++ b/opac/opac-addbybiblionumber.pl
@@ -50,6 +50,9 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
 
 if ($newvirtualshelf) {
 	$shelfnumber = AddShelf(  $newvirtualshelf, $loggedinuser, $category );
+    if(@biblionumber){
+        AddToShelfFromBiblio(@biblionumber,$shelfnumber);
+    }
 	RefreshShelvesSummary($query->cookie("CGISESSID"),$loggedinuser,($loggedinuser == -1 ? 20 : 10));
 	print $query->header;
 	print "<html><body onload=\"window.opener.location.reload(true);self.close();\"></body></html>";
@@ -95,13 +98,13 @@ else {
 	my ($shelflist) = GetRecentShelves(1, $limit, $loggedinuser);
     my @shelvesloop;
     my %shelvesloop;
-    for my $shelf ( @{${@$shelflist}[0]} ) {
+    for my $shelf ( @{ $shelflist->[0] } ) {
         push( @shelvesloop, $shelf->{shelfnumber} );
 		$shelvesloop{$shelf->{shelfnumber}} = $shelf->{shelfname};
 	}
 	# then open shelves...
 	my ($shelflist) = GetRecentShelves(3, $limit, undef);
-    for my $shelf ( @{${@$shelflist}[0]} ) {
+    for my $shelf ( @{ $shelflist->[0] } ) {
         push( @shelvesloop, $shelf->{shelfnumber} );
 		$shelvesloop{$shelf->{shelfnumber}} = $shelf->{shelfname};
 	}
-- 
1.5.6.3




More information about the Koha-patches mailing list