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

(-)a/C4/Biblio.pm (-1 / +1 lines)
Lines 1448-1454 sub GetAuthorisedValueDesc { Link Here
1448
        #---- itemtypes
1448
        #---- itemtypes
1449
        if ( $tagslib->{$tag}->{$subfield}->{'authorised_value'} eq "itemtypes" ) {
1449
        if ( $tagslib->{$tag}->{$subfield}->{'authorised_value'} eq "itemtypes" ) {
1450
            my $itemtype = Koha::ItemTypes->find( $value );
1450
            my $itemtype = Koha::ItemTypes->find( $value );
1451
            return $itemtype ? db_t('itemtype', $itemtype->itemtype) : q||;
1451
            return $itemtype ? $itemtype->translated_description : q||;
1452
        }
1452
        }
1453
1453
1454
        if ( $tagslib->{$tag}->{$subfield}->{'authorised_value'} eq "cn_source" ) {
1454
        if ( $tagslib->{$tag}->{$subfield}->{'authorised_value'} eq "cn_source" ) {
(-)a/C4/Items.pm (-1 / +1 lines)
Lines 1723-1729 sub PrepareItemrecordDisplay { Link Here
1723
                        push @authorised_values, "";
1723
                        push @authorised_values, "";
1724
                        while ( my $itemtype = $itemtypes->next ) {
1724
                        while ( my $itemtype = $itemtypes->next ) {
1725
                            push @authorised_values, $itemtype->itemtype;
1725
                            push @authorised_values, $itemtype->itemtype;
1726
                            $authorised_lib{$itemtype->itemtype} = db_t('itemtype', $itemtype->itemtype);
1726
                            $authorised_lib{$itemtype->itemtype} = $itemtype->translated_description;
1727
                        }
1727
                        }
1728
                        if ($defaultvalues && $defaultvalues->{'itemtype'}) {
1728
                        if ($defaultvalues && $defaultvalues->{'itemtype'}) {
1729
                            $defaultvalue = $defaultvalues->{'itemtype'};
1729
                            $defaultvalue = $defaultvalues->{'itemtype'};
(-)a/Koha/ItemType.pm (+14 lines)
Lines 22-27 use C4::Koha qw( getitemtypeimagelocation ); Link Here
22
use C4::Languages;
22
use C4::Languages;
23
use Koha::Database;
23
use Koha::Database;
24
use Koha::CirculationRules;
24
use Koha::CirculationRules;
25
use Koha::I18N;
25
26
26
use base qw(Koha::Object Koha::Object::Limit::Library);
27
use base qw(Koha::Object Koha::Object::Limit::Library);
27
28
Lines 35-40 Koha::ItemType - Koha Item type Object class Link Here
35
36
36
=cut
37
=cut
37
38
39
=head3 translation_description
40
41
  my $translated_description = Koha::ItemType->translated_description;
42
43
Returns a localized string for the Koha::ItemType description field.
44
45
=cut
46
47
sub translated_description {
48
    my ( $self ) = @_;
49
    return dt_t('itemtype', $self->itemtype);
50
}
51
38
=head3 image_location
52
=head3 image_location
39
53
40
=cut
54
=cut
(-)a/authorities/authorities.pl (-1 / +1 lines)
Lines 88-94 sub build_authorized_values_list { Link Here
88
          unless ( $tagslib->{$tag}->{$subfield}->{mandatory}
88
          unless ( $tagslib->{$tag}->{$subfield}->{mandatory}
89
            && ( $value || $tagslib->{$tag}->{$subfield}->{defaultvalue} ) );
89
            && ( $value || $tagslib->{$tag}->{$subfield}->{defaultvalue} ) );
90
            push @authorised_values, $itemtype->itemtype;
90
            push @authorised_values, $itemtype->itemtype;
91
            $authorised_lib{$itemtype->itemtype} = db_t('itemtype', $itemtype->itemtype);
91
            $authorised_lib{$itemtype->itemtype} = $itemtype->translated_description;
92
        }
92
        }
93
    }
93
    }
94
    else { # "true" authorised value
94
    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 282-288 my @itemtypes; Link Here
282
foreach my $itemtype ( Koha::ItemTypes->search->as_list ) {
282
foreach my $itemtype ( Koha::ItemTypes->search->as_list ) {
283
    push @itemtypes, {
283
    push @itemtypes, {
284
        value => $itemtype->itemtype,
284
        value => $itemtype->itemtype,
285
        label => db_t('itemtype', $itemtype->itemtype),
285
        label => $itemtype->translated_description,
286
    };
286
    };
287
}
287
}
288
288
(-)a/cataloguing/addbiblio.pl (-1 / +1 lines)
Lines 196-202 sub build_authorized_values_list { Link Here
196
        my $itemtypes = Koha::ItemTypes->search;
196
        my $itemtypes = Koha::ItemTypes->search;
197
        while ( $itemtype = $itemtypes->next ) {
197
        while ( $itemtype = $itemtypes->next ) {
198
            push @authorised_values, $itemtype->itemtype;
198
            push @authorised_values, $itemtype->itemtype;
199
            $authorised_lib{$itemtype->itemtype} = db_t('itemtype', $itemtype->itemtype);
199
            $authorised_lib{$itemtype->itemtype} = $itemtype->translated_description;
200
        }
200
        }
201
        $value = $itemtype unless ($value);
201
        $value = $itemtype unless ($value);
202
    }
202
    }
(-)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 231-237 foreach my $itemtype ( keys %{$itemtypes} ) { Link Here
231
    # If 'iscat' (see ITEMTYPECAT) then there is no itemtype and the description is not translated
231
    # If 'iscat' (see ITEMTYPECAT) then there is no itemtype and the description is not translated
232
    my $description = $itemtypes->{$itemtype}->{iscat}
232
    my $description = $itemtypes->{$itemtype}->{iscat}
233
      ? $itemtypes->{$itemtype}->{description}
233
      ? $itemtypes->{$itemtype}->{description}
234
      : db_t('itemtype', Koha::ItemTypes->find($itemtype)->itemtype);
234
      : Koha::ItemTypes->find($itemtype)->translated_description;
235
    $itemtypes->{$itemtype}->{description} = $description || $itemtypes->{$itemtype}->{description} || q{};
235
    $itemtypes->{$itemtype}->{description} = $description || $itemtypes->{$itemtype}->{description} || q{};
236
}
236
}
237
237
(-)a/reports/reserves_stats.pl (-1 / +1 lines)
Lines 309-315 sub display_value { Link Here
309
    my $display_value =
309
    my $display_value =
310
        ( $crit =~ /ccode/ )         ? $ccodes->{$value}
310
        ( $crit =~ /ccode/ )         ? $ccodes->{$value}
311
      : ( $crit =~ /location/ )      ? $locations->{$value}
311
      : ( $crit =~ /location/ )      ? $locations->{$value}
312
      : ( $crit =~ /itemtype/ )      ? db_t('itemtype', Koha::ItemTypes->find( $value )->itemtype)
312
      : ( $crit =~ /itemtype/ )      ? Koha::ItemTypes->find( $value )->translated_description
313
      : ( $crit =~ /branch/ )        ? Koha::Libraries->find($value)->branchname
313
      : ( $crit =~ /branch/ )        ? Koha::Libraries->find($value)->branchname
314
      : ( $crit =~ /reservestatus/ ) ? reservestatushuman($value)
314
      : ( $crit =~ /reservestatus/ ) ? reservestatushuman($value)
315
      :                                $value;    # default fallback
315
      :                                $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