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