Bugzilla – Attachment 46498 Details for
Bug 15337
Koha Item Type sorted by Codes instead of Descriptions
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[PASSED QA] Bug 15337: Make itemtypes retrieved with GetItemTypes ordered by descriptions
PASSED-QA-Bug-15337-Make-itemtypes-retrieved-with-.patch (text/plain), 1.93 KB, created by
Katrin Fischer
on 2016-01-11 20:19:13 UTC
(
hide
)
Description:
[PASSED QA] Bug 15337: Make itemtypes retrieved with GetItemTypes ordered by descriptions
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2016-01-11 20:19:13 UTC
Size:
1.93 KB
patch
obsolete
>From bff8e63a1160edf9453422c73a1fc18827966779 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 5 Jan 2016 14:25:35 +0000 >Subject: [PATCH] [PASSED QA] Bug 15337: Make itemtypes retrieved with > GetItemTypes ordered by descriptions >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >Prior to this patch, the itemtypes were displayed ordered by the code >(itemtypes.itemtype DB column). >This patch will make them displayed by the description displayed (the >translated description). > >Test plan: >0/ Do not apply this patch set >1/ Confirm that the itemtypes are displayed ordered by code (when adding >an item, cataloguing/additem.pl) >2/ Confirm that t/db_dependent/Koha.t does not pass >3/ Apply the test patch >4/ Confirm that t/db_dependent/Koha.t pass >5/ Confirm that the itemtypes are not displayed by description (on >additem.pl) > >See comment #3 >Signed-off-by: Marc Véron <veron@veron.ch> > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > C4/Koha.pm | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > >diff --git a/C4/Koha.pm b/C4/Koha.pm >index 12ac19c..8959010 100644 >--- a/C4/Koha.pm >+++ b/C4/Koha.pm >@@ -249,7 +249,6 @@ sub GetItemTypes { > require C4::Languages; > my $language = C4::Languages::getlanguage(); > # returns a reference to a hash of references to itemtypes... >- my %itemtypes; > my $dbh = C4::Context->dbh; > my $query = q| > SELECT >@@ -275,12 +274,13 @@ sub GetItemTypes { > $sth->execute( $language ); > > if ( $style eq 'hash' ) { >+ my %itemtypes; > while ( my $IT = $sth->fetchrow_hashref ) { > $itemtypes{ $IT->{'itemtype'} } = $IT; > } > return ( \%itemtypes ); > } else { >- return $sth->fetchall_arrayref({}); >+ return [ sort { lc $a->{translated_description} cmp lc $b->{translated_description} } @{ $sth->fetchall_arrayref( {} ) } ]; > } > } > >-- >1.9.1
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 15337
:
46257
|
46258
|
46274
|
46275
|
46497
| 46498