Lines 2049-2055
sub searchResults {
Link Here
|
2049 |
my $items_count = scalar(@fields); |
2049 |
my $items_count = scalar(@fields); |
2050 |
my $maxitems_pref = C4::Context->preference('maxItemsinSearchResults'); |
2050 |
my $maxitems_pref = C4::Context->preference('maxItemsinSearchResults'); |
2051 |
my $maxitems = $maxitems_pref ? $maxitems_pref - 1 : 1; |
2051 |
my $maxitems = $maxitems_pref ? $maxitems_pref - 1 : 1; |
2052 |
my @hiddenitems; # hidden itemnumbers based on OpacHiddenItems syspref |
|
|
2053 |
|
2052 |
|
2054 |
# loop through every item |
2053 |
# loop through every item |
2055 |
foreach my $field (@fields) { |
2054 |
foreach my $field (@fields) { |
Lines 2071-2077
sub searchResults {
Link Here
|
2071 |
# hidden based on OpacHiddenItems syspref |
2070 |
# hidden based on OpacHiddenItems syspref |
2072 |
my @hi = C4::Items::GetHiddenItemnumbers($item); |
2071 |
my @hi = C4::Items::GetHiddenItemnumbers($item); |
2073 |
if (scalar @hi) { |
2072 |
if (scalar @hi) { |
2074 |
push @hiddenitems, @hi; |
|
|
2075 |
$hideatopac_count++; |
2073 |
$hideatopac_count++; |
2076 |
next; |
2074 |
next; |
2077 |
} |
2075 |
} |
Lines 2088-2094
sub searchResults {
Link Here
|
2088 |
$item->{'branchname'} = $branches{$item->{$otherbranch}}; |
2086 |
$item->{'branchname'} = $branches{$item->{$otherbranch}}; |
2089 |
} |
2087 |
} |
2090 |
|
2088 |
|
2091 |
my $prefix = $item->{$hbranch} . '--' . $item->{location} . $item->{itype} . $item->{itemcallnumber}; |
2089 |
my $prefix = $item->{$hbranch} . '--' . $item->{location} . $item->{itype} . $item->{itemcallnumber}; |
2092 |
# For each grouping of items (onloan, available, unavailable), we build a key to store relevant info about that item |
2090 |
# For each grouping of items (onloan, available, unavailable), we build a key to store relevant info about that item |
2093 |
my $userenv = C4::Context->userenv; |
2091 |
my $userenv = C4::Context->userenv; |
2094 |
if ( $item->{onloan} |
2092 |
if ( $item->{onloan} |
Lines 2098-2109
sub searchResults {
Link Here
|
2098 |
{ |
2096 |
{ |
2099 |
$onloan_count++; |
2097 |
$onloan_count++; |
2100 |
my $key = $prefix . $item->{onloan} . $item->{barcode}; |
2098 |
my $key = $prefix . $item->{onloan} . $item->{barcode}; |
|
|
2099 |
$onloan_items->{$key} = { %$item }; |
2101 |
$onloan_items->{$key}->{due_date} = $item->{onloan}; |
2100 |
$onloan_items->{$key}->{due_date} = $item->{onloan}; |
2102 |
$onloan_items->{$key}->{count}++ if $item->{$hbranch}; |
2101 |
$onloan_items->{$key}->{count}++ if $item->{$hbranch}; |
2103 |
$onloan_items->{$key}->{branchname} = $item->{branchname}; |
|
|
2104 |
$onloan_items->{$key}->{location} = $shelflocations->{ $item->{location} }; |
2102 |
$onloan_items->{$key}->{location} = $shelflocations->{ $item->{location} }; |
2105 |
$onloan_items->{$key}->{itemcallnumber} = $item->{itemcallnumber}; |
|
|
2106 |
$onloan_items->{$key}->{description} = $item->{description}; |
2107 |
$onloan_items->{$key}->{imageurl} = |
2103 |
$onloan_items->{$key}->{imageurl} = |
2108 |
getitemtypeimagelocation( $search_context, $itemtypes{ $item->{itype} }->{imageurl} ); |
2104 |
getitemtypeimagelocation( $search_context, $itemtypes{ $item->{itype} }->{imageurl} ); |
2109 |
|
2105 |
|
Lines 2189-2213
sub searchResults {
Link Here
|
2189 |
$other_count++; |
2185 |
$other_count++; |
2190 |
|
2186 |
|
2191 |
my $key = $prefix . $item->{status}; |
2187 |
my $key = $prefix . $item->{status}; |
2192 |
foreach (qw(withdrawn itemlost damaged branchname itemcallnumber)) { |
2188 |
$other_items->{$key} = { %$item }; |
2193 |
$other_items->{$key}->{$_} = $item->{$_}; |
|
|
2194 |
} |
2195 |
$other_items->{$key}->{intransit} = ( $transfertwhen ne '' ) ? 1 : 0; |
2189 |
$other_items->{$key}->{intransit} = ( $transfertwhen ne '' ) ? 1 : 0; |
2196 |
$other_items->{$key}->{onhold} = ($reservestatus) ? 1 : 0; |
2190 |
$other_items->{$key}->{onhold} = ($reservestatus) ? 1 : 0; |
2197 |
$other_items->{$key}->{notforloan} = GetAuthorisedValueDesc('','',$item->{notforloan},'','',$notforloan_authorised_value) if $notforloan_authorised_value and $item->{notforloan}; |
2191 |
$other_items->{$key}->{notforloan} = GetAuthorisedValueDesc('','',$item->{notforloan},'','',$notforloan_authorised_value) if $notforloan_authorised_value and $item->{notforloan}; |
2198 |
$other_items->{$key}->{count}++ if $item->{$hbranch}; |
2192 |
$other_items->{$key}->{count}++ if $item->{$hbranch}; |
2199 |
$other_items->{$key}->{location} = $shelflocations->{ $item->{location} }; |
2193 |
$other_items->{$key}->{location} = $shelflocations->{ $item->{location} }; |
2200 |
$other_items->{$key}->{description} = $item->{description}; |
|
|
2201 |
$other_items->{$key}->{imageurl} = getitemtypeimagelocation( $search_context, $itemtypes{ $item->{itype} }->{imageurl} ); |
2194 |
$other_items->{$key}->{imageurl} = getitemtypeimagelocation( $search_context, $itemtypes{ $item->{itype} }->{imageurl} ); |
2202 |
} |
2195 |
} |
2203 |
# item is available |
2196 |
# item is available |
2204 |
else { |
2197 |
else { |
2205 |
$can_place_holds = 1; |
2198 |
$can_place_holds = 1; |
2206 |
$available_count++; |
2199 |
$available_count++; |
|
|
2200 |
$available_items->{$prefix} = { %$item }; |
2207 |
$available_items->{$prefix}->{count}++ if $item->{$hbranch}; |
2201 |
$available_items->{$prefix}->{count}++ if $item->{$hbranch}; |
2208 |
foreach (qw(branchname itemcallnumber description)) { |
|
|
2209 |
$available_items->{$prefix}->{$_} = $item->{$_}; |
2210 |
} |
2211 |
$available_items->{$prefix}->{location} = $shelflocations->{ $item->{location} }; |
2202 |
$available_items->{$prefix}->{location} = $shelflocations->{ $item->{location} }; |
2212 |
$available_items->{$prefix}->{imageurl} = getitemtypeimagelocation( $search_context, $itemtypes{ $item->{itype} }->{imageurl} ); |
2203 |
$available_items->{$prefix}->{imageurl} = getitemtypeimagelocation( $search_context, $itemtypes{ $item->{itype} }->{imageurl} ); |
2213 |
} |
2204 |
} |
Lines 2236-2242
sub searchResults {
Link Here
|
2236 |
# XSLT processing of some stuff |
2227 |
# XSLT processing of some stuff |
2237 |
# we fetched the sysprefs already before the loop through all retrieved record! |
2228 |
# we fetched the sysprefs already before the loop through all retrieved record! |
2238 |
if (!$scan && $xslfile) { |
2229 |
if (!$scan && $xslfile) { |
2239 |
$oldbiblio->{XSLTResultsRecord} = XSLTParse4Display($oldbiblio->{biblionumber}, $marcrecord, $xslsyspref, 1, \@hiddenitems, $sysxml, $xslfile, $lang); |
2230 |
$oldbiblio->{XSLTResultsRecord} = XSLTParse4Display($oldbiblio->{biblionumber}, $marcrecord, $xslsyspref, [@available_items_loop, @onloan_items_loop, @other_items_loop], 1, $sysxml, $xslfile, $lang); |
2240 |
# the last parameter tells Koha to clean up the problematic ampersand entities that Zebra outputs |
2231 |
# the last parameter tells Koha to clean up the problematic ampersand entities that Zebra outputs |
2241 |
} |
2232 |
} |
2242 |
|
2233 |
|