Lines 1827-1833
sub searchResults {
Link Here
|
1827 |
my $items_count = scalar(@fields); |
1827 |
my $items_count = scalar(@fields); |
1828 |
my $maxitems_pref = C4::Context->preference('maxItemsinSearchResults'); |
1828 |
my $maxitems_pref = C4::Context->preference('maxItemsinSearchResults'); |
1829 |
my $maxitems = $maxitems_pref ? $maxitems_pref - 1 : 1; |
1829 |
my $maxitems = $maxitems_pref ? $maxitems_pref - 1 : 1; |
1830 |
my @hiddenitems; # hidden itemnumbers based on OpacHiddenItems syspref |
|
|
1831 |
|
1830 |
|
1832 |
# loop through every item |
1831 |
# loop through every item |
1833 |
foreach my $field (@fields) { |
1832 |
foreach my $field (@fields) { |
Lines 1849-1855
sub searchResults {
Link Here
|
1849 |
# hidden based on OpacHiddenItems syspref |
1848 |
# hidden based on OpacHiddenItems syspref |
1850 |
my @hi = C4::Items::GetHiddenItemnumbers($item); |
1849 |
my @hi = C4::Items::GetHiddenItemnumbers($item); |
1851 |
if (scalar @hi) { |
1850 |
if (scalar @hi) { |
1852 |
push @hiddenitems, @hi; |
|
|
1853 |
$hideatopac_count++; |
1851 |
$hideatopac_count++; |
1854 |
next; |
1852 |
next; |
1855 |
} |
1853 |
} |
Lines 1866-1884
sub searchResults {
Link Here
|
1866 |
$item->{'branchname'} = $branches{$item->{$otherbranch}}; |
1864 |
$item->{'branchname'} = $branches{$item->{$otherbranch}}; |
1867 |
} |
1865 |
} |
1868 |
|
1866 |
|
1869 |
my $prefix = $item->{$hbranch} . '--' . $item->{location} . $item->{itype} . $item->{itemcallnumber}; |
1867 |
my $prefix = $item->{$hbranch} . '--' . $item->{location} . $item->{itype} . $item->{itemcallnumber}; |
1870 |
# For each grouping of items (onloan, available, unavailable), we build a key to store relevant info about that item |
1868 |
# For each grouping of items (onloan, available, unavailable), we build a key to store relevant info about that item |
1871 |
my $userenv = C4::Context->userenv; |
1869 |
my $userenv = C4::Context->userenv; |
1872 |
if ( $item->{onloan} && !(C4::Members::GetHideLostItemsPreference($userenv->{'number'}) && $item->{itemlost}) ) { |
1870 |
if ( $item->{onloan} && !(C4::Members::GetHideLostItemsPreference($userenv->{'number'}) && $item->{itemlost}) ) { |
1873 |
$onloan_count++; |
1871 |
$onloan_count++; |
1874 |
my $key = $prefix . $item->{onloan} . $item->{barcode}; |
1872 |
my $key = $prefix . $item->{onloan} . $item->{barcode}; |
1875 |
$onloan_items->{$key}->{due_date} = format_date($item->{onloan}); |
1873 |
$onloan_items->{$key} = { %$item }; |
1876 |
$onloan_items->{$key}->{count}++ if $item->{$hbranch}; |
1874 |
$onloan_items->{$key}->{due_date} = format_date($item->{onloan}); |
1877 |
$onloan_items->{$key}->{branchname} = $item->{branchname}; |
1875 |
$onloan_items->{$key}->{count}++ if $item->{$hbranch}; |
1878 |
$onloan_items->{$key}->{location} = $shelflocations->{ $item->{location} }; |
1876 |
$onloan_items->{$key}->{location} = $shelflocations->{ $item->{location} }; |
1879 |
$onloan_items->{$key}->{itemcallnumber} = $item->{itemcallnumber}; |
1877 |
$onloan_items->{$key}->{imageurl} = getitemtypeimagelocation( $search_context, $itemtypes{ $item->{itype} }->{imageurl} ); |
1880 |
$onloan_items->{$key}->{description} = $item->{description}; |
|
|
1881 |
$onloan_items->{$key}->{imageurl} = getitemtypeimagelocation( $search_context, $itemtypes{ $item->{itype} }->{imageurl} ); |
1882 |
# if something's checked out and lost, mark it as 'long overdue' |
1878 |
# if something's checked out and lost, mark it as 'long overdue' |
1883 |
if ( $item->{itemlost} ) { |
1879 |
if ( $item->{itemlost} ) { |
1884 |
$onloan_items->{$prefix}->{longoverdue}++; |
1880 |
$onloan_items->{$prefix}->{longoverdue}++; |
Lines 1955-1981
sub searchResults {
Link Here
|
1955 |
$other_count++; |
1951 |
$other_count++; |
1956 |
|
1952 |
|
1957 |
my $key = $prefix . $item->{status}; |
1953 |
my $key = $prefix . $item->{status}; |
1958 |
foreach (qw(withdrawn itemlost damaged branchname itemcallnumber)) { |
1954 |
$other_items->{$key} = { %$item }; |
1959 |
$other_items->{$key}->{$_} = $item->{$_}; |
|
|
1960 |
} |
1961 |
$other_items->{$key}->{intransit} = ( $transfertwhen ne '' ) ? 1 : 0; |
1955 |
$other_items->{$key}->{intransit} = ( $transfertwhen ne '' ) ? 1 : 0; |
1962 |
$other_items->{$key}->{onhold} = ($reservestatus) ? 1 : 0; |
1956 |
$other_items->{$key}->{onhold} = ($reservestatus) ? 1 : 0; |
1963 |
$other_items->{$key}->{notforloan} = GetAuthorisedValueDesc('','',$item->{notforloan},'','',$notforloan_authorised_value) if $notforloan_authorised_value and $item->{notforloan}; |
1957 |
$other_items->{$key}->{notforloan} = GetAuthorisedValueDesc('','',$item->{notforloan},'','',$notforloan_authorised_value) |
1964 |
$other_items->{$key}->{count}++ if $item->{$hbranch}; |
1958 |
if $notforloan_authorised_value and $item->{notforloan}; |
1965 |
$other_items->{$key}->{location} = $shelflocations->{ $item->{location} }; |
1959 |
$other_items->{$key}->{count}++ |
1966 |
$other_items->{$key}->{description} = $item->{description}; |
1960 |
if $item->{$hbranch}; |
1967 |
$other_items->{$key}->{imageurl} = getitemtypeimagelocation( $search_context, $itemtypes{ $item->{itype} }->{imageurl} ); |
1961 |
$other_items->{$key}->{location} = $shelflocations->{ $item->{location} }; |
|
|
1962 |
$other_items->{$key}->{imageurl} = getitemtypeimagelocation( $search_context, $itemtypes{ $item->{itype} }->{imageurl} ); |
1968 |
} |
1963 |
} |
1969 |
# item is available |
1964 |
# item is available |
1970 |
else { |
1965 |
else { |
1971 |
$can_place_holds = 1; |
1966 |
$can_place_holds = 1; |
1972 |
$available_count++; |
1967 |
$available_count++; |
1973 |
$available_items->{$prefix}->{count}++ if $item->{$hbranch}; |
1968 |
$available_items->{$prefix} = { %$item }; |
1974 |
foreach (qw(branchname itemcallnumber description)) { |
1969 |
$available_items->{$prefix}->{count}++ if $item->{$hbranch}; |
1975 |
$available_items->{$prefix}->{$_} = $item->{$_}; |
1970 |
$available_items->{$prefix}->{location} = $shelflocations->{ $item->{location} }; |
1976 |
} |
1971 |
$available_items->{$prefix}->{imageurl} = getitemtypeimagelocation( $search_context, $itemtypes{ $item->{itype} }->{imageurl} ); |
1977 |
$available_items->{$prefix}->{location} = $shelflocations->{ $item->{location} }; |
|
|
1978 |
$available_items->{$prefix}->{imageurl} = getitemtypeimagelocation( $search_context, $itemtypes{ $item->{itype} }->{imageurl} ); |
1979 |
} |
1972 |
} |
1980 |
} |
1973 |
} |
1981 |
} # notforloan, item level and biblioitem level |
1974 |
} # notforloan, item level and biblioitem level |
Lines 2005-2011
sub searchResults {
Link Here
|
2005 |
warn $marcrecord->as_formatted if $DEBUG; |
1998 |
warn $marcrecord->as_formatted if $DEBUG; |
2006 |
my $interface = $search_context eq 'opac' ? 'OPAC' : ''; |
1999 |
my $interface = $search_context eq 'opac' ? 'OPAC' : ''; |
2007 |
if (!$scan && C4::Context->preference($interface . "XSLTResultsDisplay")) { |
2000 |
if (!$scan && C4::Context->preference($interface . "XSLTResultsDisplay")) { |
2008 |
$oldbiblio->{XSLTResultsRecord} = XSLTParse4Display($oldbiblio->{biblionumber}, $marcrecord, $interface."XSLTResultsDisplay", 1, \@hiddenitems); |
2001 |
$oldbiblio->{XSLTResultsRecord} = XSLTParse4Display($oldbiblio->{biblionumber}, $marcrecord, $interface."XSLTResultsDisplay", [@available_items_loop, @onloan_items_loop, @other_items_loop], 1); |
2009 |
# the last parameter tells Koha to clean up the problematic ampersand entities that Zebra outputs |
2002 |
# the last parameter tells Koha to clean up the problematic ampersand entities that Zebra outputs |
2010 |
} |
2003 |
} |
2011 |
|
2004 |
|