Bugzilla – Attachment 69951 Details for
Bug 19671
Circulation wizard / issues_stats.pl does not populate itemtype descriptions correctly
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19671: Map itemtypes to hash for correct display in issues_stats.pl
Bug-19671-Map-itemtypes-to-hash-for-correct-displa.patch (text/plain), 2.85 KB, created by
Jonathan Druart
on 2017-12-20 16:19:02 UTC
(
hide
)
Description:
Bug 19671: Map itemtypes to hash for correct display in issues_stats.pl
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2017-12-20 16:19:02 UTC
Size:
2.85 KB
patch
obsolete
>From c057dc52f1cc59a25d2768cf1675c1c44e70154f Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 20 Dec 2017 13:17:50 -0300 >Subject: [PATCH] Bug 19671: Map itemtypes to hash for correct display in > issues_stats.pl > >To test: >1 - Run the circulation wizard with itemtypes as columns, shelving >locations as rows - display on screen >2 - Note all itemtype values are blank >3 - Switch rows/columns - same issue >4 - Apply patch >5 - Re-run reports >6 - Itemtypes should display correctly >--- > reports/issues_stats.pl | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) > >diff --git a/reports/issues_stats.pl b/reports/issues_stats.pl >index 75c54baac6..200104e6ae 100755 >--- a/reports/issues_stats.pl >+++ b/reports/issues_stats.pl >@@ -88,6 +88,8 @@ $sep = "\t" if ($sep eq 'tabulation'); > $template->param(do_it => $do_it, > ); > >+our $itemtypes = Koha::ItemTypes->search_with_localization->unblessed; >+ > our @patron_categories = Koha::Patron::Categories->search_limited({}, {order_by => ['description']}); > > our $locations = { map { ( $_->{authorised_value} => $_->{lib} ) } Koha::AuthorisedValues->get_descriptions_by_koha_field( { frameworkcode => '', kohafield => 'items.location' }, { order_by => ['description'] } ) }; >@@ -151,9 +153,6 @@ my @values; > my %labels; > my %select; > >-# create itemtype arrayref for <select>. >-our $itemtypes = Koha::ItemTypes->search_with_localization; >- > # location list > my @locations; > foreach (sort keys %$locations) { >@@ -355,12 +354,13 @@ sub calculate { > $sth->execute; > } > >+ my $itemtypes_map = { map { $_->{itemtype} => $_ } @{ $itemtypes } }; > while ( my ($celvalue) = $sth->fetchrow ) { > my %cell = ( rowtitle => $celvalue, totalrow => 0 ); # we leave 'rowtitle' as hash key (used when filling the table), and add coltitle_display > $cell{rowtitle_display} = > ( $line =~ /ccode/ ) ? $ccodes->{$celvalue} > : ( $line =~ /location/ ) ? $locations->{$celvalue} >- : ( $line =~ /itemtype/ ) ? $itemtypes->{$celvalue}->{description} >+ : ( $line =~ /itemtype/ ) ? $itemtypes_map->{$celvalue}->{translated_description} > : $celvalue; # default fallback > if ( $line =~ /sort1/ ) { > foreach (@$Bsort1) { >@@ -449,7 +449,7 @@ sub calculate { > $cell{coltitle_display} = > ( $column =~ /ccode/ ) ? $ccodes->{$celvalue} > : ( $column =~ /location/ ) ? $locations->{$celvalue} >- : ( $column =~ /itemtype/ ) ? $itemtypes->{$celvalue}->{description} >+ : ( $column =~ /itemtype/ ) ? $itemtypes_map->{$celvalue}->{translated_description} > : $celvalue; # default fallback > if ( $column =~ /sort1/ ) { > foreach (@$Bsort1) { >-- >2.11.0
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 19671
:
69247
|
69951
|
71433
|
71535