Lines 2007-2013
sub searchResults {
Link Here
|
2007 |
my $items_count = scalar(@fields); |
2007 |
my $items_count = scalar(@fields); |
2008 |
my $maxitems_pref = C4::Context->preference('maxItemsinSearchResults'); |
2008 |
my $maxitems_pref = C4::Context->preference('maxItemsinSearchResults'); |
2009 |
my $maxitems = $maxitems_pref ? $maxitems_pref - 1 : 1; |
2009 |
my $maxitems = $maxitems_pref ? $maxitems_pref - 1 : 1; |
2010 |
my @hiddenitems; # hidden itemnumbers based on OpacHiddenItems syspref |
|
|
2011 |
|
2010 |
|
2012 |
# loop through every item |
2011 |
# loop through every item |
2013 |
foreach my $field (@fields) { |
2012 |
foreach my $field (@fields) { |
Lines 2029-2035
sub searchResults {
Link Here
|
2029 |
# hidden based on OpacHiddenItems syspref |
2028 |
# hidden based on OpacHiddenItems syspref |
2030 |
my @hi = C4::Items::GetHiddenItemnumbers($item); |
2029 |
my @hi = C4::Items::GetHiddenItemnumbers($item); |
2031 |
if (scalar @hi) { |
2030 |
if (scalar @hi) { |
2032 |
push @hiddenitems, @hi; |
|
|
2033 |
$hideatopac_count++; |
2031 |
$hideatopac_count++; |
2034 |
next; |
2032 |
next; |
2035 |
} |
2033 |
} |
Lines 2046-2052
sub searchResults {
Link Here
|
2046 |
$item->{'branchname'} = $branches{$item->{$otherbranch}}; |
2044 |
$item->{'branchname'} = $branches{$item->{$otherbranch}}; |
2047 |
} |
2045 |
} |
2048 |
|
2046 |
|
2049 |
my $prefix = $item->{$hbranch} . '--' . $item->{location} . $item->{itype} . $item->{itemcallnumber}; |
2047 |
my $prefix = $item->{$hbranch} . '--' . $item->{location} . $item->{itype} . $item->{itemcallnumber}; |
2050 |
# For each grouping of items (onloan, available, unavailable), we build a key to store relevant info about that item |
2048 |
# For each grouping of items (onloan, available, unavailable), we build a key to store relevant info about that item |
2051 |
my $userenv = C4::Context->userenv; |
2049 |
my $userenv = C4::Context->userenv; |
2052 |
if ( $item->{onloan} |
2050 |
if ( $item->{onloan} |
Lines 2054-2065
sub searchResults {
Link Here
|
2054 |
{ |
2052 |
{ |
2055 |
$onloan_count++; |
2053 |
$onloan_count++; |
2056 |
my $key = $prefix . $item->{onloan} . $item->{barcode}; |
2054 |
my $key = $prefix . $item->{onloan} . $item->{barcode}; |
|
|
2055 |
$onloan_items->{$key} = { %$item }; |
2057 |
$onloan_items->{$key}->{due_date} = output_pref( { dt => dt_from_string( $item->{onloan} ), dateonly => 1 } ); |
2056 |
$onloan_items->{$key}->{due_date} = output_pref( { dt => dt_from_string( $item->{onloan} ), dateonly => 1 } ); |
2058 |
$onloan_items->{$key}->{count}++ if $item->{$hbranch}; |
2057 |
$onloan_items->{$key}->{count}++ if $item->{$hbranch}; |
2059 |
$onloan_items->{$key}->{branchname} = $item->{branchname}; |
|
|
2060 |
$onloan_items->{$key}->{location} = $shelflocations->{ $item->{location} }; |
2058 |
$onloan_items->{$key}->{location} = $shelflocations->{ $item->{location} }; |
2061 |
$onloan_items->{$key}->{itemcallnumber} = $item->{itemcallnumber}; |
|
|
2062 |
$onloan_items->{$key}->{description} = $item->{description}; |
2063 |
$onloan_items->{$key}->{imageurl} = |
2059 |
$onloan_items->{$key}->{imageurl} = |
2064 |
getitemtypeimagelocation( $search_context, $itemtypes{ $item->{itype} }->{imageurl} ); |
2060 |
getitemtypeimagelocation( $search_context, $itemtypes{ $item->{itype} }->{imageurl} ); |
2065 |
|
2061 |
|
Lines 2145-2169
sub searchResults {
Link Here
|
2145 |
$other_count++; |
2141 |
$other_count++; |
2146 |
|
2142 |
|
2147 |
my $key = $prefix . $item->{status}; |
2143 |
my $key = $prefix . $item->{status}; |
2148 |
foreach (qw(withdrawn itemlost damaged branchname itemcallnumber)) { |
2144 |
$other_items->{$key} = { %$item }; |
2149 |
$other_items->{$key}->{$_} = $item->{$_}; |
|
|
2150 |
} |
2151 |
$other_items->{$key}->{intransit} = ( $transfertwhen ne '' ) ? 1 : 0; |
2145 |
$other_items->{$key}->{intransit} = ( $transfertwhen ne '' ) ? 1 : 0; |
2152 |
$other_items->{$key}->{onhold} = ($reservestatus) ? 1 : 0; |
2146 |
$other_items->{$key}->{onhold} = ($reservestatus) ? 1 : 0; |
2153 |
$other_items->{$key}->{notforloan} = GetAuthorisedValueDesc('','',$item->{notforloan},'','',$notforloan_authorised_value) if $notforloan_authorised_value and $item->{notforloan}; |
2147 |
$other_items->{$key}->{notforloan} = GetAuthorisedValueDesc('','',$item->{notforloan},'','',$notforloan_authorised_value) if $notforloan_authorised_value and $item->{notforloan}; |
2154 |
$other_items->{$key}->{count}++ if $item->{$hbranch}; |
2148 |
$other_items->{$key}->{count}++ if $item->{$hbranch}; |
2155 |
$other_items->{$key}->{location} = $shelflocations->{ $item->{location} }; |
2149 |
$other_items->{$key}->{location} = $shelflocations->{ $item->{location} }; |
2156 |
$other_items->{$key}->{description} = $item->{description}; |
|
|
2157 |
$other_items->{$key}->{imageurl} = getitemtypeimagelocation( $search_context, $itemtypes{ $item->{itype} }->{imageurl} ); |
2150 |
$other_items->{$key}->{imageurl} = getitemtypeimagelocation( $search_context, $itemtypes{ $item->{itype} }->{imageurl} ); |
2158 |
} |
2151 |
} |
2159 |
# item is available |
2152 |
# item is available |
2160 |
else { |
2153 |
else { |
2161 |
$can_place_holds = 1; |
2154 |
$can_place_holds = 1; |
2162 |
$available_count++; |
2155 |
$available_count++; |
|
|
2156 |
$available_items->{$prefix} = { %$item }; |
2163 |
$available_items->{$prefix}->{count}++ if $item->{$hbranch}; |
2157 |
$available_items->{$prefix}->{count}++ if $item->{$hbranch}; |
2164 |
foreach (qw(branchname itemcallnumber description)) { |
|
|
2165 |
$available_items->{$prefix}->{$_} = $item->{$_}; |
2166 |
} |
2167 |
$available_items->{$prefix}->{location} = $shelflocations->{ $item->{location} }; |
2158 |
$available_items->{$prefix}->{location} = $shelflocations->{ $item->{location} }; |
2168 |
$available_items->{$prefix}->{imageurl} = getitemtypeimagelocation( $search_context, $itemtypes{ $item->{itype} }->{imageurl} ); |
2159 |
$available_items->{$prefix}->{imageurl} = getitemtypeimagelocation( $search_context, $itemtypes{ $item->{itype} }->{imageurl} ); |
2169 |
} |
2160 |
} |
Lines 2192-2198
sub searchResults {
Link Here
|
2192 |
# XSLT processing of some stuff |
2183 |
# XSLT processing of some stuff |
2193 |
my $interface = $search_context eq 'opac' ? 'OPAC' : ''; |
2184 |
my $interface = $search_context eq 'opac' ? 'OPAC' : ''; |
2194 |
if (!$scan && C4::Context->preference($interface . "XSLTResultsDisplay")) { |
2185 |
if (!$scan && C4::Context->preference($interface . "XSLTResultsDisplay")) { |
2195 |
$oldbiblio->{XSLTResultsRecord} = XSLTParse4Display($oldbiblio->{biblionumber}, $marcrecord, $interface."XSLTResultsDisplay", 1, \@hiddenitems); |
2186 |
$oldbiblio->{XSLTResultsRecord} = XSLTParse4Display($oldbiblio->{biblionumber}, $marcrecord, $interface."XSLTResultsDisplay", [@available_items_loop, @onloan_items_loop, @other_items_loop], 1); |
2196 |
# the last parameter tells Koha to clean up the problematic ampersand entities that Zebra outputs |
2187 |
# the last parameter tells Koha to clean up the problematic ampersand entities that Zebra outputs |
2197 |
} |
2188 |
} |
2198 |
|
2189 |
|