View | Details | Raw Unified | Return to bug 4812
Collapse All | Expand All

(-)a/opac/opac-reserve.pl (-3 / +9 lines)
Lines 42-47 use Koha::ItemTypes; Link Here
42
use Koha::Checkouts;
42
use Koha::Checkouts;
43
use Koha::Libraries;
43
use Koha::Libraries;
44
use Koha::Patrons;
44
use Koha::Patrons;
45
use Koha::Holds;
45
use Date::Calc qw/Today Date_to_Days/;
46
use Date::Calc qw/Today Date_to_Days/;
46
use List::MoreUtils qw/uniq/;
47
use List::MoreUtils qw/uniq/;
47
48
Lines 272-282 if ( $query->param('place_reserve') ) { Link Here
272
        my $rank = $biblioData->{rank};
273
        my $rank = $biblioData->{rank};
273
        if ( $itemNum ne '' ) {
274
        if ( $itemNum ne '' ) {
274
            $canreserve = 1 if CanItemBeReserved( $borrowernumber, $itemNum ) eq 'OK';
275
            $canreserve = 1 if CanItemBeReserved( $borrowernumber, $itemNum ) eq 'OK';
275
            $rank = '0' unless C4::Context->preference('ReservesNeedReturns');
276
            my $item = GetItem($itemNum);
276
            my $item = GetItem($itemNum);
277
            if ( $item->{'holdingbranch'} eq $branch ) {
277
            if ( $item->{'holdingbranch'} eq $branch ) {
278
                $found = 'W'
278
                unless (
279
                  unless C4::Context->preference('ReservesNeedReturns');
279
                       C4::Context->preference('ReservesNeedReturns')
280
                    || Koha::Checkouts->search( { itemnumber => $itemNum } )->count > 0
281
                    || Koha::Holds->search( { itemnumber => $itemNum, priority => 0 } )->count > 0
282
                ) {
283
                    $rank  = '0'; 
284
                    $found = 'W';
285
                }
280
            }
286
            }
281
        }
287
        }
282
        else {
288
        else {
(-)a/reserve/placerequest.pl (-6 / +12 lines)
Lines 32-37 use C4::Circulation; Link Here
32
use C4::Members;
32
use C4::Members;
33
use C4::Auth qw/checkauth/;
33
use C4::Auth qw/checkauth/;
34
use Koha::Patrons;
34
use Koha::Patrons;
35
use Koha::Checkouts;
36
use Koha::Holds;
35
37
36
my $input = CGI->new();
38
my $input = CGI->new();
37
39
Lines 74-84 my $found; Link Here
74
# of the document, we force the value $rank and $found .
76
# of the document, we force the value $rank and $found .
75
if (defined $checkitem && $checkitem ne ''){
77
if (defined $checkitem && $checkitem ne ''){
76
    $holds_to_place_count = 1;
78
    $holds_to_place_count = 1;
77
    $rank[0] = '0' unless C4::Context->preference('ReservesNeedReturns');
79
    my $item = GetItem($checkitem);
78
    my $item = $checkitem;
80
    if ( $item->{'holdingbranch'} eq $branch ) {
79
    $item = GetItem($item);
81
        unless (
80
    if ( $item->{'holdingbranch'} eq $branch ){
82
               C4::Context->preference('ReservesNeedReturns')
81
        $found = 'W' unless C4::Context->preference('ReservesNeedReturns');
83
            || Koha::Checkouts->search( { itemnumber => $checkitem } )->count > 0
84
            || Koha::Holds->search( { itemnumber => $checkitem, priority => 0 } )->count > 0
85
        ) {
86
            $rank[0] = '0';
87
            $found = 'W';
88
        }
82
    }
89
    }
83
}
90
}
84
91
85
- 

Return to bug 4812