Lines 2058-2064
sub searchResults {
Link Here
|
2058 |
my $items_count = scalar(@fields); |
2058 |
my $items_count = scalar(@fields); |
2059 |
my $maxitems_pref = C4::Context->preference('maxItemsinSearchResults'); |
2059 |
my $maxitems_pref = C4::Context->preference('maxItemsinSearchResults'); |
2060 |
my $maxitems = $maxitems_pref ? $maxitems_pref - 1 : 1; |
2060 |
my $maxitems = $maxitems_pref ? $maxitems_pref - 1 : 1; |
2061 |
my @hiddenitems; # hidden itemnumbers based on OpacHiddenItems syspref |
|
|
2062 |
|
2061 |
|
2063 |
# loop through every item |
2062 |
# loop through every item |
2064 |
foreach my $field (@fields) { |
2063 |
foreach my $field (@fields) { |
Lines 2080-2086
sub searchResults {
Link Here
|
2080 |
# hidden based on OpacHiddenItems syspref |
2079 |
# hidden based on OpacHiddenItems syspref |
2081 |
my @hi = C4::Items::GetHiddenItemnumbers($item); |
2080 |
my @hi = C4::Items::GetHiddenItemnumbers($item); |
2082 |
if (scalar @hi) { |
2081 |
if (scalar @hi) { |
2083 |
push @hiddenitems, @hi; |
|
|
2084 |
$hideatopac_count++; |
2082 |
$hideatopac_count++; |
2085 |
next; |
2083 |
next; |
2086 |
} |
2084 |
} |
Lines 2097-2103
sub searchResults {
Link Here
|
2097 |
$item->{'branchname'} = $branches{$item->{$otherbranch}}; |
2095 |
$item->{'branchname'} = $branches{$item->{$otherbranch}}; |
2098 |
} |
2096 |
} |
2099 |
|
2097 |
|
2100 |
my $prefix = $item->{$hbranch} . '--' . $item->{location} . $item->{itype} . $item->{itemcallnumber}; |
2098 |
my $prefix = $item->{$hbranch} . '--' . $item->{location} . $item->{itype} . $item->{itemcallnumber}; |
2101 |
# For each grouping of items (onloan, available, unavailable), we build a key to store relevant info about that item |
2099 |
# For each grouping of items (onloan, available, unavailable), we build a key to store relevant info about that item |
2102 |
my $userenv = C4::Context->userenv; |
2100 |
my $userenv = C4::Context->userenv; |
2103 |
if ( $item->{onloan} |
2101 |
if ( $item->{onloan} |
Lines 2105-2116
sub searchResults {
Link Here
|
2105 |
{ |
2103 |
{ |
2106 |
$onloan_count++; |
2104 |
$onloan_count++; |
2107 |
my $key = $prefix . $item->{onloan} . $item->{barcode}; |
2105 |
my $key = $prefix . $item->{onloan} . $item->{barcode}; |
|
|
2106 |
$onloan_items->{$key} = { %$item }; |
2108 |
$onloan_items->{$key}->{due_date} = format_date( $item->{onloan} ); |
2107 |
$onloan_items->{$key}->{due_date} = format_date( $item->{onloan} ); |
2109 |
$onloan_items->{$key}->{count}++ if $item->{$hbranch}; |
2108 |
$onloan_items->{$key}->{count}++ if $item->{$hbranch}; |
2110 |
$onloan_items->{$key}->{branchname} = $item->{branchname}; |
|
|
2111 |
$onloan_items->{$key}->{location} = $shelflocations->{ $item->{location} }; |
2109 |
$onloan_items->{$key}->{location} = $shelflocations->{ $item->{location} }; |
2112 |
$onloan_items->{$key}->{itemcallnumber} = $item->{itemcallnumber}; |
|
|
2113 |
$onloan_items->{$key}->{description} = $item->{description}; |
2114 |
$onloan_items->{$key}->{imageurl} = |
2110 |
$onloan_items->{$key}->{imageurl} = |
2115 |
getitemtypeimagelocation( $search_context, $itemtypes{ $item->{itype} }->{imageurl} ); |
2111 |
getitemtypeimagelocation( $search_context, $itemtypes{ $item->{itype} }->{imageurl} ); |
2116 |
|
2112 |
|
Lines 2195-2219
sub searchResults {
Link Here
|
2195 |
$other_count++; |
2191 |
$other_count++; |
2196 |
|
2192 |
|
2197 |
my $key = $prefix . $item->{status}; |
2193 |
my $key = $prefix . $item->{status}; |
2198 |
foreach (qw(withdrawn itemlost damaged branchname itemcallnumber)) { |
2194 |
$other_items->{$key} = { %$item }; |
2199 |
$other_items->{$key}->{$_} = $item->{$_}; |
|
|
2200 |
} |
2201 |
$other_items->{$key}->{intransit} = ( $transfertwhen ne '' ) ? 1 : 0; |
2195 |
$other_items->{$key}->{intransit} = ( $transfertwhen ne '' ) ? 1 : 0; |
2202 |
$other_items->{$key}->{onhold} = ($reservestatus) ? 1 : 0; |
2196 |
$other_items->{$key}->{onhold} = ($reservestatus) ? 1 : 0; |
2203 |
$other_items->{$key}->{notforloan} = GetAuthorisedValueDesc('','',$item->{notforloan},'','',$notforloan_authorised_value) if $notforloan_authorised_value and $item->{notforloan}; |
2197 |
$other_items->{$key}->{notforloan} = GetAuthorisedValueDesc('','',$item->{notforloan},'','',$notforloan_authorised_value) if $notforloan_authorised_value and $item->{notforloan}; |
2204 |
$other_items->{$key}->{count}++ if $item->{$hbranch}; |
2198 |
$other_items->{$key}->{count}++ if $item->{$hbranch}; |
2205 |
$other_items->{$key}->{location} = $shelflocations->{ $item->{location} }; |
2199 |
$other_items->{$key}->{location} = $shelflocations->{ $item->{location} }; |
2206 |
$other_items->{$key}->{description} = $item->{description}; |
|
|
2207 |
$other_items->{$key}->{imageurl} = getitemtypeimagelocation( $search_context, $itemtypes{ $item->{itype} }->{imageurl} ); |
2200 |
$other_items->{$key}->{imageurl} = getitemtypeimagelocation( $search_context, $itemtypes{ $item->{itype} }->{imageurl} ); |
2208 |
} |
2201 |
} |
2209 |
# item is available |
2202 |
# item is available |
2210 |
else { |
2203 |
else { |
2211 |
$can_place_holds = 1; |
2204 |
$can_place_holds = 1; |
2212 |
$available_count++; |
2205 |
$available_count++; |
|
|
2206 |
$available_items->{$prefix} = { %$item }; |
2213 |
$available_items->{$prefix}->{count}++ if $item->{$hbranch}; |
2207 |
$available_items->{$prefix}->{count}++ if $item->{$hbranch}; |
2214 |
foreach (qw(branchname itemcallnumber description)) { |
|
|
2215 |
$available_items->{$prefix}->{$_} = $item->{$_}; |
2216 |
} |
2217 |
$available_items->{$prefix}->{location} = $shelflocations->{ $item->{location} }; |
2208 |
$available_items->{$prefix}->{location} = $shelflocations->{ $item->{location} }; |
2218 |
$available_items->{$prefix}->{imageurl} = getitemtypeimagelocation( $search_context, $itemtypes{ $item->{itype} }->{imageurl} ); |
2209 |
$available_items->{$prefix}->{imageurl} = getitemtypeimagelocation( $search_context, $itemtypes{ $item->{itype} }->{imageurl} ); |
2219 |
} |
2210 |
} |
Lines 2242-2248
sub searchResults {
Link Here
|
2242 |
# XSLT processing of some stuff |
2233 |
# XSLT processing of some stuff |
2243 |
my $interface = $search_context eq 'opac' ? 'OPAC' : ''; |
2234 |
my $interface = $search_context eq 'opac' ? 'OPAC' : ''; |
2244 |
if (!$scan && C4::Context->preference($interface . "XSLTResultsDisplay")) { |
2235 |
if (!$scan && C4::Context->preference($interface . "XSLTResultsDisplay")) { |
2245 |
$oldbiblio->{XSLTResultsRecord} = XSLTParse4Display($oldbiblio->{biblionumber}, $marcrecord, $interface."XSLTResultsDisplay", 1, \@hiddenitems); |
2236 |
$oldbiblio->{XSLTResultsRecord} = XSLTParse4Display($oldbiblio->{biblionumber}, $marcrecord, $interface."XSLTResultsDisplay", [@available_items_loop, @onloan_items_loop, @other_items_loop], 1); |
2246 |
# the last parameter tells Koha to clean up the problematic ampersand entities that Zebra outputs |
2237 |
# the last parameter tells Koha to clean up the problematic ampersand entities that Zebra outputs |
2247 |
} |
2238 |
} |
2248 |
|
2239 |
|