Lines 1621-1627
Format results in a form suitable for passing to the template
Link Here
|
1621 |
# IMO this subroutine is pretty messy still -- it's responsible for |
1621 |
# IMO this subroutine is pretty messy still -- it's responsible for |
1622 |
# building the HTML output for the template |
1622 |
# building the HTML output for the template |
1623 |
sub searchResults { |
1623 |
sub searchResults { |
1624 |
my ( $search_context, $searchdesc, $hits, $results_per_page, $offset, $scan, $marcresults, $xslt_variables ) = @_; |
1624 |
my ( $search_context, $searchdesc, $hits, $results_per_page, $offset, $scan, $marcresults, $xslt_variables, $borrowernumber ) = @_; |
1625 |
my $dbh = C4::Context->dbh; |
1625 |
my $dbh = C4::Context->dbh; |
1626 |
my @newresults; |
1626 |
my @newresults; |
1627 |
|
1627 |
|
Lines 1778-1789
sub searchResults {
Link Here
|
1778 |
my $onloan_count = 0; |
1778 |
my $onloan_count = 0; |
1779 |
my $longoverdue_count = 0; |
1779 |
my $longoverdue_count = 0; |
1780 |
my $other_count = 0; |
1780 |
my $other_count = 0; |
1781 |
my $withdrawn_count = 0; |
1781 |
my $withdrawn_count = 0; |
1782 |
my $itemlost_count = 0; |
1782 |
my $itemlost_count = 0; |
1783 |
my $hideatopac_count = 0; |
1783 |
my $hideatopac_count = 0; |
1784 |
my $itembinding_count = 0; |
1784 |
my $itembinding_count = 0; |
1785 |
my $itemdamaged_count = 0; |
1785 |
my $itemdamaged_count = 0; |
1786 |
my $item_in_transit_count = 0; |
1786 |
my $item_in_transit_count = 0; |
|
|
1787 |
my $can_place_holds = 1; |
1787 |
my $item_onhold_count = 0; |
1788 |
my $item_onhold_count = 0; |
1788 |
my $notforloan_count = 0; |
1789 |
my $notforloan_count = 0; |
1789 |
my $item_recalled_count = 0; |
1790 |
my $item_recalled_count = 0; |
Lines 1855-1860
sub searchResults {
Link Here
|
1855 |
if ( $item->{itemlost} ) { |
1856 |
if ( $item->{itemlost} ) { |
1856 |
$onloan_items->{$key}->{longoverdue}++; |
1857 |
$onloan_items->{$key}->{longoverdue}++; |
1857 |
$longoverdue_count++; |
1858 |
$longoverdue_count++; |
|
|
1859 |
$can_place_holds = 0; |
1858 |
} |
1860 |
} |
1859 |
} |
1861 |
} |
1860 |
|
1862 |
|
Lines 2003-2009
sub searchResults {
Link Here
|
2003 |
my $biblio_object = Koha::Biblios->find( $oldbiblio->{biblionumber} ); |
2005 |
my $biblio_object = Koha::Biblios->find( $oldbiblio->{biblionumber} ); |
2004 |
$oldbiblio->{biblio_object} = $biblio_object; |
2006 |
$oldbiblio->{biblio_object} = $biblio_object; |
2005 |
|
2007 |
|
2006 |
my $can_place_holds = 1; |
2008 |
$can_place_holds = 1; |
2007 |
# if biblio level itypes are used and itemtype is notforloan, it can't be reserved either |
2009 |
# if biblio level itypes are used and itemtype is notforloan, it can't be reserved either |
2008 |
if (!C4::Context->preference("item-level_itypes")) { |
2010 |
if (!C4::Context->preference("item-level_itypes")) { |
2009 |
if ($itemtype && $itemtype->{notforloan}) { |
2011 |
if ($itemtype && $itemtype->{notforloan}) { |
Lines 2012-2017
sub searchResults {
Link Here
|
2012 |
} else { |
2014 |
} else { |
2013 |
$can_place_holds = $biblio_object->items->filter_by_for_hold()->count if $biblio_object; |
2015 |
$can_place_holds = $biblio_object->items->filter_by_for_hold()->count if $biblio_object; |
2014 |
} |
2016 |
} |
|
|
2017 |
|
2018 |
if ( $borrowernumber and $can_place_holds ) { |
2019 |
$can_place_holds = (C4::Reserves::CanBookBeReserved( $borrowernumber, $oldbiblio->{biblionumber} )->{status} eq 'OK'); |
2020 |
} |
2021 |
|
2015 |
$oldbiblio->{norequests} = 1 unless $can_place_holds; |
2022 |
$oldbiblio->{norequests} = 1 unless $can_place_holds; |
2016 |
$oldbiblio->{items_count} = $items_count; |
2023 |
$oldbiblio->{items_count} = $items_count; |
2017 |
$oldbiblio->{available_items_loop} = \@available_items_loop; |
2024 |
$oldbiblio->{available_items_loop} = \@available_items_loop; |