Bug 14100: Fix some missing occurrences
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 14 Oct 2015 08:38:05 +0000 (09:38 +0100)
committerTomas Cohen Arazi <tomascohen@theke.io>
Tue, 27 Oct 2015 15:34:07 +0000 (12:34 -0300)
This patch fixes:
- reports/bor_issues_top.pl
- sort order
- adv search and search results
- opac-topissues.pl

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

C4/Search.pm
catalogue/search.pl
koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-topissues.inc
opac/opac-search.pl
opac/opac-topissues.pl
reports/bor_issues_top.pl

index 31e2484..5c11862 100644 (file)
@@ -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) {
index 0bd2cc6..c3ec804 100755 (executable)
@@ -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,
index 0a211d5..7324e08 100644 (file)
@@ -41,7 +41,7 @@
                                 [% ELSE %]
                                     <option value="[% itemtype.itemtype %]">
                                 [% END %]
-                                    [% itemtype.description %]
+                                    [% itemtype.translated_description %]
                                 </option>
                             [% END %]
                         </select>
index 7d21354..896a799 100755 (executable)
@@ -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'},
index 8e4e6db..ac240df 100755 (executable)
@@ -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;
index eb5482d..485095e 100755 (executable)
@@ -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;
 }