Lines 2037-2043
sub searchResults {
Link Here
|
2037 |
my $items_count = scalar(@fields); |
2037 |
my $items_count = scalar(@fields); |
2038 |
my $maxitems_pref = C4::Context->preference('maxItemsinSearchResults'); |
2038 |
my $maxitems_pref = C4::Context->preference('maxItemsinSearchResults'); |
2039 |
my $maxitems = $maxitems_pref ? $maxitems_pref - 1 : 1; |
2039 |
my $maxitems = $maxitems_pref ? $maxitems_pref - 1 : 1; |
2040 |
my @hiddenitems; # hidden itemnumbers based on OpacHiddenItems syspref |
|
|
2041 |
|
2040 |
|
2042 |
# loop through every item |
2041 |
# loop through every item |
2043 |
foreach my $field (@fields) { |
2042 |
foreach my $field (@fields) { |
Lines 2059-2065
sub searchResults {
Link Here
|
2059 |
# hidden based on OpacHiddenItems syspref |
2058 |
# hidden based on OpacHiddenItems syspref |
2060 |
my @hi = C4::Items::GetHiddenItemnumbers($item); |
2059 |
my @hi = C4::Items::GetHiddenItemnumbers($item); |
2061 |
if (scalar @hi) { |
2060 |
if (scalar @hi) { |
2062 |
push @hiddenitems, @hi; |
|
|
2063 |
$hideatopac_count++; |
2061 |
$hideatopac_count++; |
2064 |
next; |
2062 |
next; |
2065 |
} |
2063 |
} |
Lines 2076-2082
sub searchResults {
Link Here
|
2076 |
$item->{'branchname'} = $branches{$item->{$otherbranch}}; |
2074 |
$item->{'branchname'} = $branches{$item->{$otherbranch}}; |
2077 |
} |
2075 |
} |
2078 |
|
2076 |
|
2079 |
my $prefix = $item->{$hbranch} . '--' . $item->{location} . $item->{itype} . $item->{itemcallnumber}; |
2077 |
my $prefix = $item->{$hbranch} . '--' . $item->{location} . $item->{itype} . $item->{itemcallnumber}; |
2080 |
# For each grouping of items (onloan, available, unavailable), we build a key to store relevant info about that item |
2078 |
# For each grouping of items (onloan, available, unavailable), we build a key to store relevant info about that item |
2081 |
my $userenv = C4::Context->userenv; |
2079 |
my $userenv = C4::Context->userenv; |
2082 |
if ( $item->{onloan} |
2080 |
if ( $item->{onloan} |
Lines 2084-2095
sub searchResults {
Link Here
|
2084 |
{ |
2082 |
{ |
2085 |
$onloan_count++; |
2083 |
$onloan_count++; |
2086 |
my $key = $prefix . $item->{onloan} . $item->{barcode}; |
2084 |
my $key = $prefix . $item->{onloan} . $item->{barcode}; |
|
|
2085 |
$onloan_items->{$key} = { %$item }; |
2087 |
$onloan_items->{$key}->{due_date} = output_pref( { dt => dt_from_string( $item->{onloan} ), dateonly => 1 } ); |
2086 |
$onloan_items->{$key}->{due_date} = output_pref( { dt => dt_from_string( $item->{onloan} ), dateonly => 1 } ); |
2088 |
$onloan_items->{$key}->{count}++ if $item->{$hbranch}; |
2087 |
$onloan_items->{$key}->{count}++ if $item->{$hbranch}; |
2089 |
$onloan_items->{$key}->{branchname} = $item->{branchname}; |
|
|
2090 |
$onloan_items->{$key}->{location} = $shelflocations->{ $item->{location} }; |
2088 |
$onloan_items->{$key}->{location} = $shelflocations->{ $item->{location} }; |
2091 |
$onloan_items->{$key}->{itemcallnumber} = $item->{itemcallnumber}; |
|
|
2092 |
$onloan_items->{$key}->{description} = $item->{description}; |
2093 |
$onloan_items->{$key}->{imageurl} = |
2089 |
$onloan_items->{$key}->{imageurl} = |
2094 |
getitemtypeimagelocation( $search_context, $itemtypes{ $item->{itype} }->{imageurl} ); |
2090 |
getitemtypeimagelocation( $search_context, $itemtypes{ $item->{itype} }->{imageurl} ); |
2095 |
|
2091 |
|
Lines 2175-2199
sub searchResults {
Link Here
|
2175 |
$other_count++; |
2171 |
$other_count++; |
2176 |
|
2172 |
|
2177 |
my $key = $prefix . $item->{status}; |
2173 |
my $key = $prefix . $item->{status}; |
2178 |
foreach (qw(withdrawn itemlost damaged branchname itemcallnumber)) { |
2174 |
$other_items->{$key} = { %$item }; |
2179 |
$other_items->{$key}->{$_} = $item->{$_}; |
|
|
2180 |
} |
2181 |
$other_items->{$key}->{intransit} = ( $transfertwhen ne '' ) ? 1 : 0; |
2175 |
$other_items->{$key}->{intransit} = ( $transfertwhen ne '' ) ? 1 : 0; |
2182 |
$other_items->{$key}->{onhold} = ($reservestatus) ? 1 : 0; |
2176 |
$other_items->{$key}->{onhold} = ($reservestatus) ? 1 : 0; |
2183 |
$other_items->{$key}->{notforloan} = GetAuthorisedValueDesc('','',$item->{notforloan},'','',$notforloan_authorised_value) if $notforloan_authorised_value and $item->{notforloan}; |
2177 |
$other_items->{$key}->{notforloan} = GetAuthorisedValueDesc('','',$item->{notforloan},'','',$notforloan_authorised_value) if $notforloan_authorised_value and $item->{notforloan}; |
2184 |
$other_items->{$key}->{count}++ if $item->{$hbranch}; |
2178 |
$other_items->{$key}->{count}++ if $item->{$hbranch}; |
2185 |
$other_items->{$key}->{location} = $shelflocations->{ $item->{location} }; |
2179 |
$other_items->{$key}->{location} = $shelflocations->{ $item->{location} }; |
2186 |
$other_items->{$key}->{description} = $item->{description}; |
|
|
2187 |
$other_items->{$key}->{imageurl} = getitemtypeimagelocation( $search_context, $itemtypes{ $item->{itype} }->{imageurl} ); |
2180 |
$other_items->{$key}->{imageurl} = getitemtypeimagelocation( $search_context, $itemtypes{ $item->{itype} }->{imageurl} ); |
2188 |
} |
2181 |
} |
2189 |
# item is available |
2182 |
# item is available |
2190 |
else { |
2183 |
else { |
2191 |
$can_place_holds = 1; |
2184 |
$can_place_holds = 1; |
2192 |
$available_count++; |
2185 |
$available_count++; |
|
|
2186 |
$available_items->{$prefix} = { %$item }; |
2193 |
$available_items->{$prefix}->{count}++ if $item->{$hbranch}; |
2187 |
$available_items->{$prefix}->{count}++ if $item->{$hbranch}; |
2194 |
foreach (qw(branchname itemcallnumber description)) { |
|
|
2195 |
$available_items->{$prefix}->{$_} = $item->{$_}; |
2196 |
} |
2197 |
$available_items->{$prefix}->{location} = $shelflocations->{ $item->{location} }; |
2188 |
$available_items->{$prefix}->{location} = $shelflocations->{ $item->{location} }; |
2198 |
$available_items->{$prefix}->{imageurl} = getitemtypeimagelocation( $search_context, $itemtypes{ $item->{itype} }->{imageurl} ); |
2189 |
$available_items->{$prefix}->{imageurl} = getitemtypeimagelocation( $search_context, $itemtypes{ $item->{itype} }->{imageurl} ); |
2199 |
} |
2190 |
} |
Lines 2222-2228
sub searchResults {
Link Here
|
2222 |
# XSLT processing of some stuff |
2213 |
# XSLT processing of some stuff |
2223 |
# we fetched the sysprefs already before the loop through all retrieved record! |
2214 |
# we fetched the sysprefs already before the loop through all retrieved record! |
2224 |
if (!$scan && $xslfile) { |
2215 |
if (!$scan && $xslfile) { |
2225 |
$oldbiblio->{XSLTResultsRecord} = XSLTParse4Display($oldbiblio->{biblionumber}, $marcrecord, $xslsyspref, 1, \@hiddenitems, $sysxml, $xslfile, $lang); |
2216 |
$oldbiblio->{XSLTResultsRecord} = XSLTParse4Display($oldbiblio->{biblionumber}, $marcrecord, $xslsyspref, [@available_items_loop, @onloan_items_loop, @other_items_loop], 1, $sysxml, $xslfile, $lang); |
2226 |
# the last parameter tells Koha to clean up the problematic ampersand entities that Zebra outputs |
2217 |
# the last parameter tells Koha to clean up the problematic ampersand entities that Zebra outputs |
2227 |
} |
2218 |
} |
2228 |
|
2219 |
|