From 88f0c4cb45dde91f1e140294f18aa94112482ae8 Mon Sep 17 00:00:00 2001 From: Chris Cormack Date: Mon, 11 Apr 2011 11:36:17 +0000 Subject: [PATCH] =?utf8?q?=C2=A0Bug=206155=20:=20Fixing=20bug=20with=20lis?= =?utf8?q?ts=20not=20showing?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Magnus Enger Signed-off-by: Chris Cormack --- C4/VirtualShelves/Page.pm | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/C4/VirtualShelves/Page.pm b/C4/VirtualShelves/Page.pm index df7054e57d..cb55b9c46f 100644 --- a/C4/VirtualShelves/Page.pm +++ b/C4/VirtualShelves/Page.pm @@ -57,6 +57,8 @@ sub shelfpage ($$$$$) { $query or die "No query"; $template or die "No template"; $template->param( { loggedinuser => $loggedinuser } ); + my $edit; + my $shelves; my @paramsloop; my $totitems; my $shelfoff = ( $query->param('shelfoff') ? $query->param('shelfoff') : 1 ); @@ -163,6 +165,7 @@ sub shelfpage ($$$$$) { my ( $shelfnumber2, $shelfname, $owner, $category, $sortfield ) = GetShelf($shelfnumber); my $member = GetMember( 'borrowernumber' => $owner ); my $ownername = defined($member) ? $member->{firstname} . " " . $member->{surname} : ''; + $edit = 1; $template->param( edit => 1, shelfnumber => $shelfnumber2, @@ -312,7 +315,7 @@ sub shelfpage ($$$$$) { $stay = 0; } $showadd = 1; - $stay and $template->param( shelves => 1 ); + $stay and $template->param( shelves => 1 ) and $shelves = 1; last SWITCH; } } @@ -359,7 +362,7 @@ sub shelfpage ($$$$$) { $qhash{$_} = $query->param($_) if $query->param($_); } ( scalar keys %qhash ) and $url .= '?' . join '&', map { "$_=$qhash{$_}" } keys %qhash; - if ( $query->param('viewshelf') ) { + if ( $shelfnumber ) { $template->param( { pagination_bar => pagination_bar( $url, ( int( $totitems / $shelflimit ) ) + ( ( $totitems % $shelflimit ) > 0 ? 1 : 0 ), $itemoff, "itemoff" ) } ); } else { $template->param( @@ -373,13 +376,13 @@ sub shelfpage ($$$$$) { "BiblioDefaultView" . C4::Context->preference("BiblioDefaultView") => 1, csv_profiles => GetCsvProfilesLoop() ); - if ( $template->param('viewshelf') - or $template->param('shelves') - or $template->param('edit') ) { + if ( $shelfnumber + or $shelves + or $edit ) { $template->param( vseflag => 1 ); } - if ($template->param('shelves') or # note: this part looks duplicative, but is intentional - $template->param('edit') + if ($shelves or # note: this part looks duplicative, but is intentional + $edit ) { $template->param( seflag => 1 ); } -- 2.39.5