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

(-)a/C4/Search.pm (-9 / +10 lines)
Lines 2071-2077 sub searchResults { Link Here
2071
            foreach my $code ( keys %subfieldstosearch ) {
2071
            foreach my $code ( keys %subfieldstosearch ) {
2072
                $item->{$code} = $field->subfield( $subfieldstosearch{$code} );
2072
                $item->{$code} = $field->subfield( $subfieldstosearch{$code} );
2073
            }
2073
            }
2074
            $item->{description} = $itemtypes{ $item->{itype} }{translated_description};
2074
            $item->{description} = $itemtypes{ $item->{itype} }{translated_description} if $item->{itype};
2075
2075
2076
	        # OPAC hidden items
2076
	        # OPAC hidden items
2077
            if ($is_opac) {
2077
            if ($is_opac) {
Lines 2134-2140 sub searchResults { Link Here
2134
         # items not on loan, but still unavailable ( lost, withdrawn, damaged )
2134
         # items not on loan, but still unavailable ( lost, withdrawn, damaged )
2135
            else {
2135
            else {
2136
2136
2137
                $item->{notforloan}=1 if !$item->{notforloan}  && $itemtypes{ C4::Context->preference("item-level_itypes")? $item->{itype}: $oldbiblio->{itemtype} }->{notforloan};
2137
                my $itemtype = C4::Context->preference("item-level_itypes")? $item->{itype}: $oldbiblio->{itemtype};
2138
                $item->{notforloan} = 1 if !$item->{notforloan} &&
2139
                    $itemtype && $itemtypes{ $itemtype }->{notforloan};
2138
2140
2139
                # item is on order
2141
                # item is on order
2140
                if ( $item->{notforloan} < 0 ) {
2142
                if ( $item->{notforloan} < 0 ) {
Lines 2184-2192 sub searchResults { Link Here
2184
                    $withdrawn_count++        if $item->{withdrawn};
2186
                    $withdrawn_count++        if $item->{withdrawn};
2185
                    $itemlost_count++        if $item->{itemlost};
2187
                    $itemlost_count++        if $item->{itemlost};
2186
                    $itemdamaged_count++     if $item->{damaged};
2188
                    $itemdamaged_count++     if $item->{damaged};
2187
                    $item_in_transit_count++ if $transfertwhen ne '';
2189
                    $item_in_transit_count++ if $transfertwhen && $transfertwhen ne '';
2188
                    $item_onhold_count++     if $reservestatus eq 'Waiting';
2190
                    $item_onhold_count++     if $reservestatus eq 'Waiting';
2189
                    $item->{status} = $item->{withdrawn} . "-" . $item->{itemlost} . "-" . $item->{damaged} . "-" . $item->{notforloan};
2191
                    $item->{status} = ($item->{withdrawn}//q{}) . "-" . ($item->{itemlost}//q{}) . "-" . ($item->{damaged}//q{}) . "-" . ($item->{notforloan}//q{});
2190
2192
2191
                    # can place a hold on a item if
2193
                    # can place a hold on a item if
2192
                    # not lost nor withdrawn
2194
                    # not lost nor withdrawn
Lines 2210-2218 sub searchResults { Link Here
2210
                    $other_items->{$key}->{onhold} = ($reservestatus) ? 1 : 0;
2212
                    $other_items->{$key}->{onhold} = ($reservestatus) ? 1 : 0;
2211
                    $other_items->{$key}->{notforloan} = GetAuthorisedValueDesc('','',$item->{notforloan},'','',$notforloan_authorised_value) if $notforloan_authorised_value and $item->{notforloan};
2213
                    $other_items->{$key}->{notforloan} = GetAuthorisedValueDesc('','',$item->{notforloan},'','',$notforloan_authorised_value) if $notforloan_authorised_value and $item->{notforloan};
2212
                    $other_items->{$key}->{count}++ if $item->{$hbranch};
2214
                    $other_items->{$key}->{count}++ if $item->{$hbranch};
2213
                    $other_items->{$key}->{location} = $shelflocations->{ $item->{location} };
2215
                    $other_items->{$key}->{location} = $shelflocations->{ $item->{location} } if $item->{location};
2214
                    $other_items->{$key}->{description} = $item->{description};
2216
                    $other_items->{$key}->{description} = $item->{description};
2215
                    $other_items->{$key}->{imageurl} = getitemtypeimagelocation( $search_context->{'interface'}, $itemtypes{ $item->{itype} }->{imageurl} );
2217
                    $other_items->{$key}->{imageurl} = getitemtypeimagelocation( $search_context->{'interface'}, $itemtypes{ $item->{itype}//q{} }->{imageurl} );
2216
                }
2218
                }
2217
                # item is available
2219
                # item is available
2218
                else {
2220
                else {
Lines 2222-2229 sub searchResults { Link Here
2222
                    foreach (qw(branchname itemcallnumber description)) {
2224
                    foreach (qw(branchname itemcallnumber description)) {
2223
                        $available_items->{$prefix}->{$_} = $item->{$_};
2225
                        $available_items->{$prefix}->{$_} = $item->{$_};
2224
                    }
2226
                    }
2225
                    $available_items->{$prefix}->{location} = $shelflocations->{ $item->{location} };
2227
                    $available_items->{$prefix}->{location} = $shelflocations->{ $item->{location} } if $item->{location};
2226
                    $available_items->{$prefix}->{imageurl} = getitemtypeimagelocation( $search_context->{'interface'}, $itemtypes{ $item->{itype} }->{imageurl} );
2228
                    $available_items->{$prefix}->{imageurl} = getitemtypeimagelocation( $search_context->{'interface'}, $itemtypes{ $item->{itype}//q{} }->{imageurl} );
2227
                }
2229
                }
2228
            }
2230
            }
2229
        }    # notforloan, item level and biblioitem level
2231
        }    # notforloan, item level and biblioitem level
2230
- 

Return to bug 24367