[Koha-patches] [PATCH] Bug 6155 : Fixing bug with lists not showing

Chris Cormack chrisc at catalyst.net.nz
Mon Apr 11 12:05:47 CEST 2011


---
 C4/VirtualShelves/Page.pm |   17 ++++++++++-------
 1 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/C4/VirtualShelves/Page.pm b/C4/VirtualShelves/Page.pm
index df7054e..cb55b9c 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 );
     }
-- 
1.5.6.5



More information about the Koha-patches mailing list