Lines 1872-1878
sub searchResults {
Link Here
|
1872 |
my $items_count = scalar(@fields); |
1872 |
my $items_count = scalar(@fields); |
1873 |
my $maxitems_pref = C4::Context->preference('maxItemsinSearchResults'); |
1873 |
my $maxitems_pref = C4::Context->preference('maxItemsinSearchResults'); |
1874 |
my $maxitems = $maxitems_pref ? $maxitems_pref - 1 : 1; |
1874 |
my $maxitems = $maxitems_pref ? $maxitems_pref - 1 : 1; |
1875 |
my @hiddenitems; # hidden itemnumbers based on OpacHiddenItems syspref |
|
|
1876 |
|
1875 |
|
1877 |
# loop through every item |
1876 |
# loop through every item |
1878 |
foreach my $field (@fields) { |
1877 |
foreach my $field (@fields) { |
Lines 1894-1900
sub searchResults {
Link Here
|
1894 |
# hidden based on OpacHiddenItems syspref |
1893 |
# hidden based on OpacHiddenItems syspref |
1895 |
my @hi = C4::Items::GetHiddenItemnumbers($item); |
1894 |
my @hi = C4::Items::GetHiddenItemnumbers($item); |
1896 |
if (scalar @hi) { |
1895 |
if (scalar @hi) { |
1897 |
push @hiddenitems, @hi; |
|
|
1898 |
$hideatopac_count++; |
1896 |
$hideatopac_count++; |
1899 |
next; |
1897 |
next; |
1900 |
} |
1898 |
} |
Lines 1911-1928
sub searchResults {
Link Here
|
1911 |
$item->{'branchname'} = $branches{$item->{$otherbranch}}; |
1909 |
$item->{'branchname'} = $branches{$item->{$otherbranch}}; |
1912 |
} |
1910 |
} |
1913 |
|
1911 |
|
1914 |
my $prefix = $item->{$hbranch} . '--' . $item->{location} . $item->{itype} . $item->{itemcallnumber}; |
1912 |
my $prefix = $item->{$hbranch} . '--' . $item->{location} . $item->{itype} . $item->{itemcallnumber}; |
1915 |
# For each grouping of items (onloan, available, unavailable), we build a key to store relevant info about that item |
1913 |
# For each grouping of items (onloan, available, unavailable), we build a key to store relevant info about that item |
1916 |
my $userenv = C4::Context->userenv; |
1914 |
my $userenv = C4::Context->userenv; |
1917 |
if ( $item->{onloan} && !(C4::Members::GetHideLostItemsPreference($userenv->{'number'}) && $item->{itemlost}) ) { |
1915 |
if ( $item->{onloan} && !(C4::Members::GetHideLostItemsPreference($userenv->{'number'}) && $item->{itemlost}) ) { |
1918 |
$onloan_count++; |
1916 |
$onloan_count++; |
1919 |
my $key = $prefix . $item->{onloan} . $item->{barcode}; |
1917 |
my $key = $prefix . $item->{onloan} . $item->{barcode}; |
|
|
1918 |
$onloan_items->{$key} = { %$item }; |
1920 |
$onloan_items->{$key}->{due_date} = format_date($item->{onloan}); |
1919 |
$onloan_items->{$key}->{due_date} = format_date($item->{onloan}); |
1921 |
$onloan_items->{$key}->{count}++ if $item->{$hbranch}; |
1920 |
$onloan_items->{$key}->{count}++ if $item->{$hbranch}; |
1922 |
$onloan_items->{$key}->{branchname} = $item->{branchname}; |
|
|
1923 |
$onloan_items->{$key}->{location} = $shelflocations->{ $item->{location} }; |
1921 |
$onloan_items->{$key}->{location} = $shelflocations->{ $item->{location} }; |
1924 |
$onloan_items->{$key}->{itemcallnumber} = $item->{itemcallnumber}; |
|
|
1925 |
$onloan_items->{$key}->{description} = $item->{description}; |
1926 |
$onloan_items->{$key}->{imageurl} = getitemtypeimagelocation( $search_context, $itemtypes{ $item->{itype} }->{imageurl} ); |
1922 |
$onloan_items->{$key}->{imageurl} = getitemtypeimagelocation( $search_context, $itemtypes{ $item->{itype} }->{imageurl} ); |
1927 |
# if something's checked out and lost, mark it as 'long overdue' |
1923 |
# if something's checked out and lost, mark it as 'long overdue' |
1928 |
if ( $item->{itemlost} ) { |
1924 |
if ( $item->{itemlost} ) { |
Lines 2002-2026
sub searchResults {
Link Here
|
2002 |
$other_count++; |
1998 |
$other_count++; |
2003 |
|
1999 |
|
2004 |
my $key = $prefix . $item->{status}; |
2000 |
my $key = $prefix . $item->{status}; |
2005 |
foreach (qw(withdrawn itemlost damaged branchname itemcallnumber)) { |
2001 |
$other_items->{$key} = { %$item }; |
2006 |
$other_items->{$key}->{$_} = $item->{$_}; |
|
|
2007 |
} |
2008 |
$other_items->{$key}->{intransit} = ( $transfertwhen ne '' ) ? 1 : 0; |
2002 |
$other_items->{$key}->{intransit} = ( $transfertwhen ne '' ) ? 1 : 0; |
2009 |
$other_items->{$key}->{onhold} = ($reservestatus) ? 1 : 0; |
2003 |
$other_items->{$key}->{onhold} = ($reservestatus) ? 1 : 0; |
2010 |
$other_items->{$key}->{notforloan} = GetAuthorisedValueDesc('','',$item->{notforloan},'','',$notforloan_authorised_value) if $notforloan_authorised_value and $item->{notforloan}; |
2004 |
$other_items->{$key}->{notforloan} = GetAuthorisedValueDesc('','',$item->{notforloan},'','',$notforloan_authorised_value) if $notforloan_authorised_value and $item->{notforloan}; |
2011 |
$other_items->{$key}->{count}++ if $item->{$hbranch}; |
2005 |
$other_items->{$key}->{count}++ if $item->{$hbranch}; |
2012 |
$other_items->{$key}->{location} = $shelflocations->{ $item->{location} }; |
2006 |
$other_items->{$key}->{location} = $shelflocations->{ $item->{location} }; |
2013 |
$other_items->{$key}->{description} = $item->{description}; |
|
|
2014 |
$other_items->{$key}->{imageurl} = getitemtypeimagelocation( $search_context, $itemtypes{ $item->{itype} }->{imageurl} ); |
2007 |
$other_items->{$key}->{imageurl} = getitemtypeimagelocation( $search_context, $itemtypes{ $item->{itype} }->{imageurl} ); |
2015 |
} |
2008 |
} |
2016 |
# item is available |
2009 |
# item is available |
2017 |
else { |
2010 |
else { |
2018 |
$can_place_holds = 1; |
2011 |
$can_place_holds = 1; |
2019 |
$available_count++; |
2012 |
$available_count++; |
|
|
2013 |
$available_items->{$prefix} = { %$item }; |
2020 |
$available_items->{$prefix}->{count}++ if $item->{$hbranch}; |
2014 |
$available_items->{$prefix}->{count}++ if $item->{$hbranch}; |
2021 |
foreach (qw(branchname itemcallnumber description)) { |
|
|
2022 |
$available_items->{$prefix}->{$_} = $item->{$_}; |
2023 |
} |
2024 |
$available_items->{$prefix}->{location} = $shelflocations->{ $item->{location} }; |
2015 |
$available_items->{$prefix}->{location} = $shelflocations->{ $item->{location} }; |
2025 |
$available_items->{$prefix}->{imageurl} = getitemtypeimagelocation( $search_context, $itemtypes{ $item->{itype} }->{imageurl} ); |
2016 |
$available_items->{$prefix}->{imageurl} = getitemtypeimagelocation( $search_context, $itemtypes{ $item->{itype} }->{imageurl} ); |
2026 |
} |
2017 |
} |
Lines 2052-2058
sub searchResults {
Link Here
|
2052 |
warn $marcrecord->as_formatted if $DEBUG; |
2043 |
warn $marcrecord->as_formatted if $DEBUG; |
2053 |
my $interface = $search_context eq 'opac' ? 'OPAC' : ''; |
2044 |
my $interface = $search_context eq 'opac' ? 'OPAC' : ''; |
2054 |
if (!$scan && C4::Context->preference($interface . "XSLTResultsDisplay")) { |
2045 |
if (!$scan && C4::Context->preference($interface . "XSLTResultsDisplay")) { |
2055 |
$oldbiblio->{XSLTResultsRecord} = XSLTParse4Display($oldbiblio->{biblionumber}, $marcrecord, $interface."XSLTResultsDisplay", 1, \@hiddenitems); |
2046 |
$oldbiblio->{XSLTResultsRecord} = XSLTParse4Display($oldbiblio->{biblionumber}, $marcrecord, $interface."XSLTResultsDisplay", [@available_items_loop, @onloan_items_loop, @other_items_loop], 1); |
2056 |
# the last parameter tells Koha to clean up the problematic ampersand entities that Zebra outputs |
2047 |
# the last parameter tells Koha to clean up the problematic ampersand entities that Zebra outputs |
2057 |
} |
2048 |
} |
2058 |
|
2049 |
|