View | Details | Raw Unified | Return to bug 24975
Collapse All | Expand All

(-)a/C4/Biblio.pm (-1 / +1 lines)
Lines 1414-1420 sub GetAuthorisedValueDesc { Link Here
1414
            my $itypes = $cache->get_from_cache( $cache_key, { unsafe => 1 } );
1414
            my $itypes = $cache->get_from_cache( $cache_key, { unsafe => 1 } );
1415
            if ( !$itypes ) {
1415
            if ( !$itypes ) {
1416
                $itypes =
1416
                $itypes =
1417
                  { map { $_->itemtype => db_t('itemtype', $itemtype->itemtype) }
1417
                  { map { $_->itemtype => $_->translated_description }
1418
                      Koha::ItemTypes->search()->as_list };
1418
                      Koha::ItemTypes->search()->as_list };
1419
                $cache->set_in_cache( $cache_key, $itypes );
1419
                $cache->set_in_cache( $cache_key, $itypes );
1420
            }
1420
            }
(-)a/C4/Items.pm (-1 / +1 lines)
Lines 1464-1470 sub PrepareItemrecordDisplay { Link Here
1464
                        push @authorised_values, "";
1464
                        push @authorised_values, "";
1465
                        while ( my $itemtype = $itemtypes->next ) {
1465
                        while ( my $itemtype = $itemtypes->next ) {
1466
                            push @authorised_values, $itemtype->itemtype;
1466
                            push @authorised_values, $itemtype->itemtype;
1467
                            $authorised_lib{$itemtype->itemtype} = db_t('itemtype', $itemtype->itemtype);
1467
                            $authorised_lib{$itemtype->itemtype} = $itemtype->translated_description;
1468
                        }
1468
                        }
1469
                        if ($defaultvalues && $defaultvalues->{'itemtype'}) {
1469
                        if ($defaultvalues && $defaultvalues->{'itemtype'}) {
1470
                            $defaultvalue = $defaultvalues->{'itemtype'};
1470
                            $defaultvalue = $defaultvalues->{'itemtype'};
(-)a/Koha/ItemType.pm (+14 lines)
Lines 23-28 use C4::Languages; Link Here
23
use Koha::Caches;
23
use Koha::Caches;
24
use Koha::Database;
24
use Koha::Database;
25
use Koha::CirculationRules;
25
use Koha::CirculationRules;
26
use Koha::I18N;
26
27
27
use base qw(Koha::Object Koha::Object::Limit::Library);
28
use base qw(Koha::Object Koha::Object::Limit::Library);
28
29
Lines 79-84 sub delete { Link Here
79
    $self->SUPER::delete(@_);
80
    $self->SUPER::delete(@_);
80
}
81
}
81
82
83
=head3 translation_description
84
85
  my $translated_description = Koha::ItemType->translated_description;
86
87
Returns a localized string for the Koha::ItemType description field.
88
89
=cut
90
91
sub translated_description {
92
    my ( $self ) = @_;
93
    return dt_t('itemtype', $self->itemtype);
94
}
95
82
=head3 image_location
96
=head3 image_location
83
97
84
=cut
98
=cut
(-)a/authorities/authorities.pl (-1 / +1 lines)
Lines 73-79 sub build_authorized_values_list { Link Here
73
          unless ( $tagslib->{$tag}->{$subfield}->{mandatory}
73
          unless ( $tagslib->{$tag}->{$subfield}->{mandatory}
74
            && ( $value || $tagslib->{$tag}->{$subfield}->{defaultvalue} ) );
74
            && ( $value || $tagslib->{$tag}->{$subfield}->{defaultvalue} ) );
75
            push @authorised_values, $itemtype->itemtype;
75
            push @authorised_values, $itemtype->itemtype;
76
            $authorised_lib{$itemtype->itemtype} = db_t('itemtype', $itemtype->itemtype);
76
            $authorised_lib{$itemtype->itemtype} = $itemtype->translated_description;
77
        }
77
        }
78
    }
78
    }
79
    else { # "true" authorised value
79
    else { # "true" authorised value
(-)a/catalogue/getitem-ajax.pl (-1 / +1 lines)
Lines 76-82 if($itemnumber) { Link Here
76
76
77
    my $itemtype = Koha::ItemTypes->find( $item->effective_itemtype );
77
    my $itemtype = Koha::ItemTypes->find( $item->effective_itemtype );
78
    # We should not do that here, but call ->itemtype->description when needed instea
78
    # We should not do that here, but call ->itemtype->description when needed instea
79
    $item_unblessed->{itemtype} = db_t('itemtype', $itemtype->itemtype);
79
    $item_unblessed->{itemtype} = $itemtype->translated_description;
80
}
80
}
81
81
82
my $json_text = to_json( $item_unblessed, { utf8 => 1 } );
82
my $json_text = to_json( $item_unblessed, { utf8 => 1 } );
(-)a/catalogue/itemsearch.pl (-1 / +1 lines)
Lines 283-289 my @itemtypes; Link Here
283
foreach my $itemtype ( Koha::ItemTypes->search->as_list ) {
283
foreach my $itemtype ( Koha::ItemTypes->search->as_list ) {
284
    push @itemtypes, {
284
    push @itemtypes, {
285
        value => $itemtype->itemtype,
285
        value => $itemtype->itemtype,
286
        label => db_t('itemtype', $itemtype->itemtype),
286
        label => $itemtype->translated_description,
287
    };
287
    };
288
}
288
}
289
289
(-)a/cataloguing/addbiblio.pl (-1 / +1 lines)
Lines 201-207 sub build_authorized_values_list { Link Here
201
        my $itemtypes = Koha::ItemTypes->search;
201
        my $itemtypes = Koha::ItemTypes->search;
202
        while ( $itemtype = $itemtypes->next ) {
202
        while ( $itemtype = $itemtypes->next ) {
203
            push @authorised_values, $itemtype->itemtype;
203
            push @authorised_values, $itemtype->itemtype;
204
            $authorised_lib{$itemtype->itemtype} = db_t('itemtype', $itemtype->itemtype);
204
            $authorised_lib{$itemtype->itemtype} = $itemtype->translated_description;
205
        }
205
        }
206
        $value = $itemtype unless ($value);
206
        $value = $itemtype unless ($value);
207
    }
207
    }
(-)a/circ/transferstoreceive.pl (-1 / +1 lines)
Lines 88-94 while ( my $library = $libraries->next ) { Link Here
88
            my $itemtype = Koha::ItemTypes->find( $item->effective_itemtype );
88
            my $itemtype = Koha::ItemTypes->find( $item->effective_itemtype );
89
89
90
            $getransf{'datetransfer'} = $num->{'datesent'};
90
            $getransf{'datetransfer'} = $num->{'datesent'};
91
            $getransf{'itemtype'} = db_t('itemtype', $itemtype->itemtype);
91
            $getransf{'itemtype'} = $itemtype->translated_description;
92
            %getransf = (
92
            %getransf = (
93
                %getransf,
93
                %getransf,
94
                title          => $biblio->title,
94
                title          => $biblio->title,
(-)a/opac/opac-search.pl (-1 / +1 lines)
Lines 240-246 foreach my $itemtype ( keys %{$itemtypes} ) { Link Here
240
    # If 'iscat' (see ITEMTYPECAT) then there is no itemtype and the description is not translated
240
    # If 'iscat' (see ITEMTYPECAT) then there is no itemtype and the description is not translated
241
    my $description = $itemtypes->{$itemtype}->{iscat}
241
    my $description = $itemtypes->{$itemtype}->{iscat}
242
      ? $itemtypes->{$itemtype}->{description}
242
      ? $itemtypes->{$itemtype}->{description}
243
      : db_t('itemtype', Koha::ItemTypes->find($itemtype)->itemtype);
243
      : Koha::ItemTypes->find($itemtype)->translated_description;
244
    $itemtypes->{$itemtype}->{description} = $description || $itemtypes->{$itemtype}->{description} || q{};
244
    $itemtypes->{$itemtype}->{description} = $description || $itemtypes->{$itemtype}->{description} || q{};
245
}
245
}
246
246
(-)a/reports/reserves_stats.pl (-1 / +1 lines)
Lines 299-305 sub display_value { Link Here
299
    my $display_value =
299
    my $display_value =
300
        ( $crit =~ /ccode/ )         ? $ccodes->{$value}
300
        ( $crit =~ /ccode/ )         ? $ccodes->{$value}
301
      : ( $crit =~ /location/ )      ? $locations->{$value}
301
      : ( $crit =~ /location/ )      ? $locations->{$value}
302
      : ( $crit =~ /itemtype/ )      ? db_t('itemtype', Koha::ItemTypes->find( $value )->itemtype)
302
      : ( $crit =~ /itemtype/ )      ? Koha::ItemTypes->find( $value )->translated_description
303
      : ( $crit =~ /branch/ )        ? Koha::Libraries->find($value)->branchname
303
      : ( $crit =~ /branch/ )        ? Koha::Libraries->find($value)->branchname
304
      : ( $crit =~ /reservestatus/ ) ? reservestatushuman($value)
304
      : ( $crit =~ /reservestatus/ ) ? reservestatushuman($value)
305
      :                                $value;    # default fallback
305
      :                                $value;    # default fallback
(-)a/svc/holds (-2 / +1 lines)
Lines 82-88 while ( my $h = $holds_rs->next() ) { Link Here
82
    my $itemtype_limit;
82
    my $itemtype_limit;
83
    if ( $h->itemtype ) {
83
    if ( $h->itemtype ) {
84
        my $itemtype = Koha::ItemTypes->find( $h->itemtype );
84
        my $itemtype = Koha::ItemTypes->find( $h->itemtype );
85
        $itemtype_limit = db_t('itemtype', $itemtype->itemtype);
85
        $itemtype_limit = $itemtype->translated_description;
86
    }
86
    }
87
87
88
    my $libraries = Koha::Libraries->search({}, { order_by => ['branchname'] })->unblessed;
88
    my $libraries = Koha::Libraries->search({}, { order_by => ['branchname'] })->unblessed;
89
- 

Return to bug 24975