Lines 1781-1787
sub searchResults {
Link Here
|
1781 |
my $itembinding_count = 0; |
1781 |
my $itembinding_count = 0; |
1782 |
my $itemdamaged_count = 0; |
1782 |
my $itemdamaged_count = 0; |
1783 |
my $item_in_transit_count = 0; |
1783 |
my $item_in_transit_count = 0; |
1784 |
my $can_place_holds = 0; |
|
|
1785 |
my $item_onhold_count = 0; |
1784 |
my $item_onhold_count = 0; |
1786 |
my $notforloan_count = 0; |
1785 |
my $notforloan_count = 0; |
1787 |
my $items_count = scalar(@fields); |
1786 |
my $items_count = scalar(@fields); |
Lines 1852-1860
sub searchResults {
Link Here
|
1852 |
$onloan_items->{$key}->{longoverdue}++; |
1851 |
$onloan_items->{$key}->{longoverdue}++; |
1853 |
$longoverdue_count++; |
1852 |
$longoverdue_count++; |
1854 |
} |
1853 |
} |
1855 |
else { # can place holds as long as item isn't lost |
|
|
1856 |
$can_place_holds = 1; |
1857 |
} |
1858 |
} |
1854 |
} |
1859 |
|
1855 |
|
1860 |
# items not on loan, but still unavailable ( lost, withdrawn, damaged ) |
1856 |
# items not on loan, but still unavailable ( lost, withdrawn, damaged ) |
Lines 1916-1933
sub searchResults {
Link Here
|
1916 |
$item_onhold_count++ if $reservestatus eq 'Waiting'; |
1912 |
$item_onhold_count++ if $reservestatus eq 'Waiting'; |
1917 |
$item->{status} = ($item->{withdrawn}//q{}) . "-" . ($item->{itemlost}//q{}) . "-" . ($item->{damaged}//q{}) . "-" . ($item->{notforloan}//q{}); |
1913 |
$item->{status} = ($item->{withdrawn}//q{}) . "-" . ($item->{itemlost}//q{}) . "-" . ($item->{damaged}//q{}) . "-" . ($item->{notforloan}//q{}); |
1918 |
|
1914 |
|
1919 |
# can place a hold on a item if |
|
|
1920 |
# not lost nor withdrawn |
1921 |
# not damaged unless AllowHoldsOnDamagedItems is true |
1922 |
# item is either for loan or on order (notforloan < 0) |
1923 |
$can_place_holds = 1 |
1924 |
if ( |
1925 |
!$item->{itemlost} |
1926 |
&& !$item->{withdrawn} |
1927 |
&& ( !$item->{damaged} || C4::Context->preference('AllowHoldsOnDamagedItems') ) |
1928 |
&& ( !$item->{notforloan} || $item->{notforloan} < 0 ) |
1929 |
); |
1930 |
|
1931 |
$other_count++; |
1915 |
$other_count++; |
1932 |
|
1916 |
|
1933 |
my $key = $prefix . $item->{status}; |
1917 |
my $key = $prefix . $item->{status}; |
Lines 1944-1950
sub searchResults {
Link Here
|
1944 |
} |
1928 |
} |
1945 |
# item is available |
1929 |
# item is available |
1946 |
else { |
1930 |
else { |
1947 |
$can_place_holds = 1; |
|
|
1948 |
$available_count++; |
1931 |
$available_count++; |
1949 |
$available_items->{$prefix}->{count}++ if $item->{$hbranch}; |
1932 |
$available_items->{$prefix}->{count}++ if $item->{$hbranch}; |
1950 |
foreach (qw(branchname itemcallnumber description)) { |
1933 |
foreach (qw(branchname itemcallnumber description)) { |
Lines 2001-2011
sub searchResults {
Link Here
|
2001 |
); |
1984 |
); |
2002 |
} |
1985 |
} |
2003 |
|
1986 |
|
|
|
1987 |
my $biblio_object = Koha::Biblios->find( $oldbiblio->{biblionumber} ); |
1988 |
$oldbiblio->{biblio_object} = $biblio_object; |
1989 |
|
1990 |
my $can_place_holds = 1; |
2004 |
# if biblio level itypes are used and itemtype is notforloan, it can't be reserved either |
1991 |
# if biblio level itypes are used and itemtype is notforloan, it can't be reserved either |
2005 |
if (!C4::Context->preference("item-level_itypes")) { |
1992 |
if (!C4::Context->preference("item-level_itypes")) { |
2006 |
if ($itemtype && $itemtype->{notforloan}) { |
1993 |
if ($itemtype && $itemtype->{notforloan}) { |
2007 |
$can_place_holds = 0; |
1994 |
$can_place_holds = 0; |
2008 |
} |
1995 |
} |
|
|
1996 |
} else { |
1997 |
$can_place_holds = $biblio_object->items->filter_by_for_hold()->count; |
2009 |
} |
1998 |
} |
2010 |
$oldbiblio->{norequests} = 1 unless $can_place_holds; |
1999 |
$oldbiblio->{norequests} = 1 unless $can_place_holds; |
2011 |
$oldbiblio->{items_count} = $items_count; |
2000 |
$oldbiblio->{items_count} = $items_count; |
Lines 2054-2061
sub searchResults {
Link Here
|
2054 |
$oldbiblio->{'alternateholdings_count'} = $alternateholdingscount; |
2043 |
$oldbiblio->{'alternateholdings_count'} = $alternateholdingscount; |
2055 |
} |
2044 |
} |
2056 |
|
2045 |
|
2057 |
$oldbiblio->{biblio_object} = Koha::Biblios->find( $oldbiblio->{biblionumber} ); |
|
|
2058 |
|
2059 |
push( @newresults, $oldbiblio ); |
2046 |
push( @newresults, $oldbiblio ); |
2060 |
} |
2047 |
} |
2061 |
|
2048 |
|