From f72c9a7fb17f48e5997503a24c1556e008427b31 Mon Sep 17 00:00:00 2001 From: Garry Collum Date: Tue, 2 Feb 2010 15:31:49 -0500 Subject: [PATCH] Bug 2505: Enables warnings in opac-readingrecord.pl Enables warnings and fixes the resulting warnings in opac-readingrecord.pl. The "description" variable in opac-readingrecord.tmpl was pulling a value from another source, probably an included template. Change the name to 'itypedescription' to resolve the conflict. Signed-off-by: Galen Charlton --- .../prog/en/modules/opac-readingrecord.tmpl | 2 +- opac/opac-readingrecord.pl | 23 ++++++++++--------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-readingrecord.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/opac-readingrecord.tmpl index f8de9a43f5..ec566a91be 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-readingrecord.tmpl +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-readingrecord.tmpl @@ -61,7 +61,7 @@ TMPL_ELSE -->Title -" title="" alt="" /> +" title="" alt="" /> (Checked out) diff --git a/opac/opac-readingrecord.pl b/opac/opac-readingrecord.pl index 595467b16e..e3c0da0652 100755 --- a/opac/opac-readingrecord.pl +++ b/opac/opac-readingrecord.pl @@ -17,6 +17,7 @@ use strict; +use warnings; use CGI; @@ -48,22 +49,21 @@ $template->param($borr); my $itemtypes = GetItemTypes(); # get the record -my $order = $query->param('order'); -my $order2 = $order; -if ( $order2 eq '' ) { - $order2 = "date_due desc"; +my $order = $query->param('order') || ''; +if ( $order eq '' ) { + $order = "date_due desc"; $template->param( orderbydate => 1 ); } -if ( $order2 eq 'title' ) { +if ( $order eq 'title' ) { $template->param( orderbytitle => 1 ); } -if ( $order2 eq 'author' ) { +if ( $order eq 'author' ) { $template->param( orderbyauthor => 1 ); } -my $limit = $query->param('limit'); +my $limit = $query->param('limit') || 50; if ( $limit eq 'full' ) { $limit = 0; } @@ -71,9 +71,8 @@ else { $limit = 50; } -my ( $count, $issues ) = GetAllIssues( $borrowernumber, $order2, $limit ); +my ( $count, $issues ) = GetAllIssues( $borrowernumber, $order, $limit ); -my $borr = GetMemberDetails( $borrowernumber ); my @bordat; $bordat[0] = $borr; $template->param( BORROWER_INFO => \@bordat ); @@ -94,8 +93,10 @@ for ( my $i = 0 ; $i < $count ; $i++ ) { $line{returndate} = format_date( $issues->[$i]->{'returndate'} ); $line{volumeddesc} = $issues->[$i]->{'volumeddesc'}; $line{counter} = $i + 1; - $line{'description'} = $itemtypes->{ $issues->[$i]->{'itemtype'} }->{'description'}; - $line{imageurl} = getitemtypeimagelocation( 'opac', $itemtypes->{ $issues->[$i]->{'itemtype'} }->{'imageurl'} ); + if($issues->[$i]->{'itemtype'}) { + $line{'itypedescription'} = $itemtypes->{ $issues->[$i]->{'itemtype'} }->{'description'}; + $line{imageurl} = getitemtypeimagelocation( 'opac', $itemtypes->{ $issues->[$i]->{'itemtype'} }->{'imageurl'} ); + } push( @loop_reading, \%line ); } -- 2.39.5