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

(-)a/C4/Search.pm (+1 lines)
Lines 539-544 sub getRecords { Link Here
539
                                    && ref( $itemtypes->{$one_facet} ) eq
539
                                    && ref( $itemtypes->{$one_facet} ) eq
540
                                    "HASH" )
540
                                    "HASH" )
541
                                {
541
                                {
542
                                    # FIXME This must call $itemtype->translation_key actually
542
                                    $facet_label_value = db_t('itemtype', $itemtypes->{$one_facet}->{itemtype});
543
                                    $facet_label_value = db_t('itemtype', $itemtypes->{$one_facet}->{itemtype});
543
                                }
544
                                }
544
                            }
545
                            }
(-)a/catalogue/moredetail.pl (-5 / +5 lines)
Lines 139-148 my $ccodes = Link Here
139
my $copynumbers =
139
my $copynumbers =
140
  { map { $_->{authorised_value} => $_->{lib} } Koha::AuthorisedValues->get_descriptions_by_koha_field( { frameworkcode => $fw, kohafield => 'items.copynumber' } ) };
140
  { map { $_->{authorised_value} => $_->{lib} } Koha::AuthorisedValues->get_descriptions_by_koha_field( { frameworkcode => $fw, kohafield => 'items.copynumber' } ) };
141
141
142
my $itemtypes = { map { $_->{itemtype} => $_ } @{ Koha::ItemTypes->search->unblessed } };
142
my $itemtypes = { map { $_->itemtype => $_ } @{ Koha::ItemTypes->search->as_list } };
143
144
$data->{itemtype} = $itemtypes->{ $data->{itemtype} };
143
145
144
$data->{'itemtypename'} = db_t('itemtype', $itemtypes->{ $data->{'itemtype'} }->{itemtype})
145
  if $data->{itemtype} && exists $itemtypes->{ $data->{itemtype} };
146
foreach ( keys %{$data} ) {
146
foreach ( keys %{$data} ) {
147
    $template->param( "$_" => defined $data->{$_} ? $data->{$_} : '' );
147
    $template->param( "$_" => defined $data->{$_} ? $data->{$_} : '' );
148
}
148
}
Lines 155-162 foreach my $item (@items){ Link Here
155
155
156
    my $item_info = $item->unblessed;
156
    my $item_info = $item->unblessed;
157
    $item_info->{object} = $item;
157
    $item_info->{object} = $item;
158
    $item_info->{itype}                = db_t('itemtype', $itemtypes->{ $item_info->{itype} }->{itemtype}) if exists $itemtypes->{ $item_info->{itype} };
158
    $item_info->{itemtype}             = $itemtypes->{$item_info->{itype}};
159
    $item_info->{effective_itemtype} = $itemtypes->{$item->effective_itemtype};
159
    $item_info->{effective_itemtype}   = $itemtypes->{$item->effective_itemtype};
160
    $item_info->{'ccode'}              = $ccodes->{ $item->ccode } if $ccodes && $item->ccode && exists $ccodes->{ $item->ccode };
160
    $item_info->{'ccode'}              = $ccodes->{ $item->ccode } if $ccodes && $item->ccode && exists $ccodes->{ $item->ccode };
161
    if ( defined $item->copynumber ) {
161
    if ( defined $item->copynumber ) {
162
        $item_info->{'displaycopy'} = 1;
162
        $item_info->{'displaycopy'} = 1;
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt (-2 / +3 lines)
Lines 4-9 Link Here
4
[% USE Koha %]
4
[% USE Koha %]
5
[% USE Branches %]
5
[% USE Branches %]
6
[% USE Price %]
6
[% USE Price %]
7
[% USE ItemTypes %]
7
[% SET footerjs = 1 %]
8
[% SET footerjs = 1 %]
8
[% INCLUDE 'doc-head-open.inc' %]
9
[% INCLUDE 'doc-head-open.inc' %]
9
<title>Item details for [% INCLUDE 'biblio-title-head.inc' %] &rsaquo; Catalog &rsaquo; Koha</title>
10
<title>Item details for [% INCLUDE 'biblio-title-head.inc' %] &rsaquo; Catalog &rsaquo; Koha</title>
Lines 53-59 Link Here
53
                                <ol class="bibliodetails">
54
                                <ol class="bibliodetails">
54
                                    <li><span class="label">Biblionumber:</span> [% biblionumber | html %]&nbsp;</li>
55
                                    <li><span class="label">Biblionumber:</span> [% biblionumber | html %]&nbsp;</li>
55
                                    [% UNLESS ( item_level_itypes ) %]
56
                                    [% UNLESS ( item_level_itypes ) %]
56
                                        <li><span class="label">Item type:</span> [% itemtypename | html %]&nbsp;</li>
57
                                        <li><span class="label">Item type:</span> [% ItemTypes.t(itemtype.translation_key) | html %]&nbsp;</li>
57
                                    [% END %]
58
                                    [% END %]
58
                                    [% IF ( rentalcharge ) %]
59
                                    [% IF ( rentalcharge ) %]
59
                                        <li><span class="label">Rental charge:</span>[% rentalcharge | $Price %]&nbsp;</li>
60
                                        <li><span class="label">Rental charge:</span>[% rentalcharge | $Price %]&nbsp;</li>
Lines 125-131 Link Here
125
                                    <ol class="bibliodetails">
126
                                    <ol class="bibliodetails">
126
                                        <li><span class="label">Home library:</span> [% Branches.GetName( ITEM_DAT.homebranch ) | html %]&nbsp;</li>
127
                                        <li><span class="label">Home library:</span> [% Branches.GetName( ITEM_DAT.homebranch ) | html %]&nbsp;</li>
127
                                        [% IF ( item_level_itypes ) %]
128
                                        [% IF ( item_level_itypes ) %]
128
                                            <li><span class="label">Item type:</span> [% ITEM_DAT.itype | html %]&nbsp;</li>
129
                                            <li><span class="label">Item type:</span> [% ItemTypes.t(ITEM_DAT.itemtype.translation_key) | html %]&nbsp;</li>
129
                                        [% END %]
130
                                        [% END %]
130
                                        [% IF ( ITEM_DAT.ccode) %]
131
                                        [% IF ( ITEM_DAT.ccode) %]
131
                                            <li><span class="label">Collection:</span> [% ITEM_DAT.ccode | html %]</li>
132
                                            <li><span class="label">Collection:</span> [% ITEM_DAT.ccode | html %]</li>
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt (-10 / +12 lines)
Lines 6-11 Link Here
6
[% USE Branches %]
6
[% USE Branches %]
7
[% USE TablesSettings %]
7
[% USE TablesSettings %]
8
[% USE AuthorisedValues %]
8
[% USE AuthorisedValues %]
9
[% USE ItemTypes %]
9
[% SET TagsShowEnabled = ( ( Koha.Preference( 'TagsEnabled' ) == 1 ) && TagsShowOnDetail ) %]
10
[% SET TagsShowEnabled = ( ( Koha.Preference( 'TagsEnabled' ) == 1 ) && TagsShowOnDetail ) %]
10
[% SET TagsInputEnabled = ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && ( Koha.Preference( 'TagsEnabled' ) == 1 ) && TagsInputOnDetail ) %]
11
[% SET TagsInputEnabled = ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && ( Koha.Preference( 'TagsEnabled' ) == 1 ) && TagsInputOnDetail ) %]
11
[% IF Koha.Preference('AmazonAssocTag') %]
12
[% IF Koha.Preference('AmazonAssocTag') %]
Lines 167-180 Link Here
167
168
168
                    [% IF ( !item_level_itypes || Koha.Preference('BiblioItemtypeInfo') ) %]
169
                    [% IF ( !item_level_itypes || Koha.Preference('BiblioItemtypeInfo') ) %]
169
                        <span class="results_summary itemtype"><span class="label">Item type: </span>
170
                        <span class="results_summary itemtype"><span class="label">Item type: </span>
170
                            [% IF ( imageurl && !Koha.Preference('OpacNoItemTypeImages') ) %]
171
                            [% IF ( !Koha.Preference('OpacNoItemTypeImages') ) %]
171
                                <img src="[% imageurl | html %]" alt="" />
172
                                [% SET image_url = itemtype.image_url %]
172
                            [% END %]
173
                                [% IF image_url %]
173
                            [% IF ( description ) %]
174
                                    <img src="[% image_url | html %]" alt="" />
174
                                <span class="itypetext">[% description | html %]</span>
175
                                [% END %]
175
                            [% ELSE %]
176
                               <span class="itypetext">[% itemtype | html %]</span>
177
                            [% END %]
176
                            [% END %]
177
                            <span class="itypetext">[% ItemTypes.t(itemtype.translation_key) | html %]</span>
178
                        </span>
178
                        </span>
179
                    [% END %]
179
                    [% END %]
180
180
Lines 1237-1248 Link Here
1237
1237
1238
                [% IF ( item_level_itypes ) %]
1238
                [% IF ( item_level_itypes ) %]
1239
                    <td class="itype">
1239
                    <td class="itype">
1240
                        [% SET itemtype_description = ItemTypes.t(ITEM_RESULT.itemtype.translation_key) %]
1240
                        [% UNLESS ( Koha.Preference('OpacNoItemTypeImages') ) %]
1241
                        [% UNLESS ( Koha.Preference('OpacNoItemTypeImages') ) %]
1241
                            [% IF ( ITEM_RESULT.imageurl ) %]
1242
                            [% SET image_url = ITEM_RESULT.itemtype.image_url %]
1242
                                <img src="[% ITEM_RESULT.imageurl | html %]" title="[% ITEM_RESULT.description | html %]" alt="[% ITEM_RESULT.description | html %]" />
1243
                            [% IF image_url %]
1244
                                <img src="[% imageurl | html %]" title="[% itemtype_description | html %]" alt="[% itemtype_description | html %]" />
1243
                            [% END %]
1245
                            [% END %]
1244
                        [% END %]
1246
                        [% END %]
1245
                       <span class="itypetext">[% ITEM_RESULT.description | html %]</span>
1247
                       <span class="itypetext">[% itemtype_description | html %]</span>
1246
                    </td>
1248
                    </td>
1247
                [% END %]
1249
                [% END %]
1248
                [% IF ( OpacLocationBranchToDisplay == 'holding' || OpacLocationBranchToDisplay == 'both' ) %]
1250
                [% IF ( OpacLocationBranchToDisplay == 'holding' || OpacLocationBranchToDisplay == 'both' ) %]
(-)a/opac/opac-detail.pl (-13 / +2 lines)
Lines 508-520 my $HideMARC = $record_processor->filters->[0]->should_hide_marc( Link Here
508
        interface     => 'opac',
508
        interface     => 'opac',
509
    } );
509
    } );
510
510
511
my $itemtypes = { map { $_->{itemtype} => $_ } @{ Koha::ItemTypes->search->unblessed } };
511
$dat->{itemtype} = Koha::ItemTypes->find($dat->{itemtype});
512
# imageurl:
513
my $itemtype = $dat->{'itemtype'};
514
if ( $itemtype ) {
515
    $dat->{'imageurl'}    = getitemtypeimagelocation( 'opac', $itemtypes->{$itemtype}->{'imageurl'} );
516
    $dat->{'description'} = db_t('itemtype', $itemtypes->{$itemtype}->{itemtype});
517
}
518
512
519
my $shelflocations =
513
my $shelflocations =
520
  { map { $_->{authorised_value} => $_->{opac_description} } Koha::AuthorisedValues->get_descriptions_by_koha_field( { frameworkcode => $dat->{frameworkcode}, kohafield => 'items.location' } ) };
514
  { map { $_->{authorised_value} => $_->{opac_description} } Koha::AuthorisedValues->get_descriptions_by_koha_field( { frameworkcode => $dat->{frameworkcode}, kohafield => 'items.location' } ) };
Lines 705-715 else { Link Here
705
              $shelflocations->{ $item->location };
699
              $shelflocations->{ $item->location };
706
        }
700
        }
707
701
708
        my $itemtype = $item->itemtype;
702
        $item_info->{itemtype} = $item->itemtype;
709
        $item_info->{'imageurl'} = getitemtypeimagelocation( 'opac',
710
            $itemtypes->{ $itemtype->itemtype }->{'imageurl'} );
711
        $item_info->{'description'} =
712
          db_t('itemtype', $itemtypes->{ $itemtype->itemtype }->{itemtype});
713
703
714
        foreach my $field (
704
        foreach my $field (
715
            qw(ccode materials enumchron copynumber itemnotes location_description uri)
705
            qw(ccode materials enumchron copynumber itemnotes location_description uri)
716
- 

Return to bug 24975