From 363e0d753a1e29011abb19318df109a84629a099 Mon Sep 17 00:00:00 2001 From: Garry Collum Date: Tue, 2 Feb 2010 15:16:39 -0500 Subject: [PATCH] Bug 2505: Enables warnings in opac-readingrecord.pl Content-Type: text/plain; charset="utf-8" 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. --- .../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 f8de9a4..ec566a9 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 595467b..e3c0da0 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 ); } -- 1.5.6.5