From d58f2cfaf6a3951c1c224019ec911cc9ce387877 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 14 Oct 2015 09:38:05 +0100 Subject: [PATCH] Bug 14100: Fix some missing occurrences This patch fixes: - reports/bor_issues_top.pl - sort order - adv search and search results - opac-topissues.pl Signed-off-by: Katrin Fischer Signed-off-by: Tomas Cohen Arazi --- C4/Search.pm | 6 +++--- catalogue/search.pl | 2 +- .../opac-tmpl/bootstrap/en/includes/opac-topissues.inc | 2 +- opac/opac-search.pl | 4 ++-- opac/opac-topissues.pl | 1 + reports/bor_issues_top.pl | 2 +- 6 files changed, 9 insertions(+), 8 deletions(-) diff --git a/C4/Search.pm b/C4/Search.pm index 31e24849e1..5c118624da 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -570,7 +570,7 @@ sub getRecords { { $facet_label_value = $itemtypes->{$one_facet} - ->{'description'}; + ->{translated_description}; } } @@ -1948,7 +1948,7 @@ sub searchResults { # edition information, if any $oldbiblio->{edition} = $oldbiblio->{editionstatement}; - $oldbiblio->{description} = $itemtypes{ $oldbiblio->{itemtype} }->{description}; + $oldbiblio->{description} = $itemtypes{ $oldbiblio->{itemtype} }->{translated_description}; # Build summary if there is one (the summary is defined in the itemtypes table) # FIXME: is this used anywhere, I think it can be commented out? -- JF if ( $itemtypes{ $oldbiblio->{itemtype} }->{summary} ) { @@ -2060,7 +2060,7 @@ sub searchResults { foreach my $code ( keys %subfieldstosearch ) { $item->{$code} = $field->subfield( $subfieldstosearch{$code} ); } - $item->{description} = $itemtypes{ $item->{itype} }{description}; + $item->{description} = $itemtypes{ $item->{itype} }{translated_description}; # OPAC hidden items if ($is_opac) { diff --git a/catalogue/search.pl b/catalogue/search.pl index 0bd2cc6c97..c3ec804b46 100755 --- a/catalogue/search.pl +++ b/catalogue/search.pl @@ -262,7 +262,7 @@ foreach my $advanced_srch_type (@advanced_search_types) { if ($advanced_srch_type eq 'itemtypes') { # itemtype is a special case, since it's not defined in authorized values my @itypesloop; - foreach my $thisitemtype ( sort {$itemtypes->{$a}->{'description'} cmp $itemtypes->{$b}->{'description'} } keys %$itemtypes ) { + foreach my $thisitemtype ( sort {$itemtypes->{$a}->{translated_description} cmp $itemtypes->{$b}->{translated_description} } keys %$itemtypes ) { my %row =( number=>$cnt++, ccl => "$itype_or_itemtype,phr", code => $thisitemtype, diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-topissues.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-topissues.inc index 0a211d53fb..7324e08ff5 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-topissues.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-topissues.inc @@ -41,7 +41,7 @@ [% ELSE %] [% END %] diff --git a/opac/opac-search.pl b/opac/opac-search.pl index 7d21354e3b..896a7991ce 100755 --- a/opac/opac-search.pl +++ b/opac/opac-search.pl @@ -236,13 +236,13 @@ foreach my $advanced_srch_type (@advanced_search_types) { if ($advanced_srch_type eq 'itemtypes') { # itemtype is a special case, since it's not defined in authorized values my @itypesloop; - foreach my $thisitemtype ( sort {$itemtypes->{$a}->{'description'} cmp $itemtypes->{$b}->{'description'} } keys %$itemtypes ) { + foreach my $thisitemtype ( sort {$itemtypes->{$a}->{translated_description} cmp $itemtypes->{$b}->{translated_description} } keys %$itemtypes ) { next if $hidingrules->{itype} && any { $_ eq $thisitemtype } @{$hidingrules->{itype}}; next if $hidingrules->{itemtype} && any { $_ eq $thisitemtype } @{$hidingrules->{itemtype}}; my %row =( number=>$cnt++, ccl => "$itype_or_itemtype,phr", code => $thisitemtype, - description => $itemtypes->{$thisitemtype}->{'description'}, + description => $itemtypes->{$thisitemtype}->{translated_description}, imageurl=> getitemtypeimagelocation( 'opac', $itemtypes->{$thisitemtype}->{'imageurl'} ), cat => $itemtypes->{$thisitemtype}->{'iscat'}, hideinopac => $itemtypes->{$thisitemtype}->{'hideinopac'}, diff --git a/opac/opac-topissues.pl b/opac/opac-topissues.pl index 8e4e6db51a..ac240df4be 100755 --- a/opac/opac-topissues.pl +++ b/opac/opac-topissues.pl @@ -25,6 +25,7 @@ use warnings; use CGI qw ( -utf8 ); use C4::Auth; use C4::Context; +use C4::Languages; use C4::Search; use C4::Output; use C4::Koha; diff --git a/reports/bor_issues_top.pl b/reports/bor_issues_top.pl index eb5482d801..485095edff 100755 --- a/reports/bor_issues_top.pl +++ b/reports/bor_issues_top.pl @@ -125,7 +125,7 @@ my $itemtypes = GetItemTypes; my @itemtypeloop; foreach (sort {$itemtypes->{$a}->{translated_description} cmp $itemtypes->{$b}->{translated_description}} keys %$itemtypes) { my %row = (value => $_, - description => $itemtypes->{$_}->{translated_description}, + translated_description => $itemtypes->{$_}->{translated_description}, ); push @itemtypeloop, \%row; } -- 2.39.5