Bugzilla – Attachment 703 Details for
Bug 2505
Omnibus: Enable Perl warnings in all modules and scripts
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Proposed patch for opac-readingrecord.pl
0006-Bug-2505-Enables-warnings-in-opac-readingrecord.pl.patch (text/plain), 3.97 KB, created by
Chris Cormack
on 2010-02-02 20:25:00 UTC
(
hide
)
Description:
Proposed patch for opac-readingrecord.pl
Filename:
MIME Type:
Creator:
Chris Cormack
Created:
2010-02-02 20:25:00 UTC
Size:
3.97 KB
patch
obsolete
>From 363e0d753a1e29011abb19318df109a84629a099 Mon Sep 17 00:00:00 2001 >From: Garry Collum <gcollum@gmail.com> >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<!-- /TMPL_UNLESS --></th> > <span class="item-details"> > <!-- TMPL_VAR NAME="author" --> > </span></td> >-<!-- TMPL_UNLESS NAME="item-level_itypes" --><td><!-- TMPL_IF NAME="imageurl" --><img src="<!-- TMPL_VAR NAME="imageurl" -->" title="<!-- TMPL_VAR name="description" -->" alt="<!-- TMPL_VAR NAME="description" -->" /><!-- /TMPL_IF --> <!-- TMPL_VAR name="description" --></td><!-- /TMPL_UNLESS --> >+<!-- TMPL_UNLESS NAME="item-level_itypes" --><td><!-- TMPL_IF NAME="imageurl" --><img src="<!-- TMPL_VAR NAME="imageurl" -->" title="<!-- TMPL_VAR name="itypedescription" -->" alt="<!-- TMPL_VAR NAME="itypedescription" -->" /><!-- /TMPL_IF --> <!-- TMPL_VAR name="itypedescription" --></td><!-- /TMPL_UNLESS --> > <td><!-- TMPL_VAR NAME="itemcallnumber" --></td> > <td><!-- TMPL_IF NAME="returndate" --><!-- TMPL_VAR NAME="returndate" --><!-- TMPL_ELSE --><em>(Checked out)</em><!-- /TMPL_IF --></td> > </tr> >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 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 2505
:
686
|
687
|
688
|
689
|
690
|
691
|
692
|
693
|
694
|
695
|
696
|
697
|
698
|
699
|
700
|
701
|
702
|
703
|
704
|
705
|
706
|
707
|
708
|
709
|
2223
|
3884
|
4574
|
8209
|
8317
|
8322
|
8373
|
9034
|
9035
|
9036
|
34442