From 95d7594438e2998d10e40876bd8249c08f04ae1c Mon Sep 17 00:00:00 2001 From: Chris Nighswonger Date: Wed, 25 Jun 2008 18:34:50 -0500 Subject: [PATCH] Bugfix correcting 'New List' behavior on opac-search.pl Signed-off-by: Galen Charlton Signed-off-by: Joshua Ferraro --- opac/opac-addbybiblionumber.pl | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/opac/opac-addbybiblionumber.pl b/opac/opac-addbybiblionumber.pl index 6104b5c820..194aa67f2a 100755 --- a/opac/opac-addbybiblionumber.pl +++ b/opac/opac-addbybiblionumber.pl @@ -28,6 +28,7 @@ use CGI; use C4::VirtualShelves; use C4::Auth; use C4::Output; +use C4::Auth qw/get_session/; my $query = new CGI; my @biblionumber = $query->param('biblionumber'); @@ -49,7 +50,10 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( $shelfnumber = AddShelf( $newvirtualshelf, $loggedinuser, $category ) if $newvirtualshelf; # verify user is authorized to perform the action on the shelf... -my $authorized = 1 if ( (ShelfPossibleAction( $loggedinuser, $selectedshelf )) ); +my $authorized = 1; +if ($selectedshelf) { + $authorized = 0 unless ShelfPossibleAction( $loggedinuser, $selectedshelf ); +} # multiple bibs might come in as '/' delimited string (from where, i don't see), or as array. @@ -61,7 +65,7 @@ if (scalar(@biblionumber) == 1) { if ($shelfnumber && ($shelfnumber != -1)) { for my $bib (@biblionumber){ &AddToShelfFromBiblio($bib,$shelfnumber); - } + } print $query->header; print "
Please close this window to continue.
"; exit; -- 2.11.0