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

(-)a/C4/ILSDI/Services.pm (-5 / +11 lines)
Lines 26-32 use C4::Circulation; Link Here
26
use C4::Branch;
26
use C4::Branch;
27
use C4::Accounts;
27
use C4::Accounts;
28
use C4::Biblio;
28
use C4::Biblio;
29
use C4::Reserves qw(AddReserve CancelReserve GetReservesFromBiblionumber GetReservesFromBorrowernumber CanBookBeReserved CanItemBeReserved);
29
use C4::Reserves qw(AddReserve CancelReserve GetReservesFromBiblionumber GetReservesFromBorrowernumber CanBookBeReserved CanItemBeReserved GetReserveNextRank);
30
use C4::Context;
30
use C4::Context;
31
use C4::AuthoritiesMarc;
31
use C4::AuthoritiesMarc;
32
use C4::ILSDI::Utility;
32
use C4::ILSDI::Utility;
Lines 623-631 sub HoldTitle { Link Here
623
        $branch = $$borrower{branchcode};
623
        $branch = $$borrower{branchcode};
624
    }
624
    }
625
625
626
    my $rank = GetReserveNextRank($biblionumber);
627
626
    # Add the reserve
628
    # Add the reserve
627
    #          $branch, $borrowernumber, $biblionumber, $constraint, $bibitems,  $priority, $notes, $title, $checkitem,  $found
629
    #          $branch, $borrowernumber, $biblionumber, $constraint, $bibitems,  $priority, $notes, $title, $checkitem,  $found
628
    AddReserve( $branch, $borrowernumber, $biblionumber, 'a', undef, 0, undef, $title, undef, undef );
630
    AddReserve( $branch, $borrowernumber, $biblionumber, 'a', undef, $rank, undef, $title, undef, undef );
629
631
630
    # Hashref building
632
    # Hashref building
631
    my $out;
633
    my $out;
Lines 702-710 sub HoldItem { Link Here
702
    my $found;
704
    my $found;
703
705
704
    # Get rank and found
706
    # Get rank and found
705
    $rank = '0' unless C4::Context->preference('ReservesNeedReturns');
707
    if (C4::Context->preference('ReservesNeedReturns')) {
706
    if ( $item->{'holdingbranch'} eq $branch ) {
708
        $rank = GetReserveNextRank($biblionumber);
707
        $found = 'W' unless C4::Context->preference('ReservesNeedReturns');
709
    } else {
710
        $rank = '0';
711
        if ($item->{'holdingbranch'} eq $branch) {
712
            $found = 'W';
713
        }
708
    }
714
    }
709
715
710
    # Add the reserve
716
    # Add the reserve
(-)a/C4/Reserves.pm (-1 / +25 lines)
Lines 134-140 BEGIN { Link Here
134
134
135
        &GetReservesControlBranch
135
        &GetReservesControlBranch
136
    );
136
    );
137
    @EXPORT_OK = qw( MergeHolds );
137
    @EXPORT_OK = qw(
138
        MergeHolds
139
        GetReserveNextRank
140
    );
138
}    
141
}    
139
142
140
=head2 AddReserve
143
=head2 AddReserve
Lines 2211-2216 sub GetReservesControlBranch { Link Here
2211
    return $branchcode;
2214
    return $branchcode;
2212
}
2215
}
2213
2216
2217
=head2 GetReserveNextRank
2218
2219
    my $next_rank = GetReserveNextRank($biblionumber);
2220
2221
Calculate the next available reseve rank for a biblionumber.
2222
2223
=cut
2224
2225
sub GetReserveNextRank {
2226
    my ($biblionumber) = @_;
2227
2228
    my ( $count, $reserves ) = GetReservesFromBiblionumber($biblionumber,1);
2229
    foreach my $res (@$reserves) {
2230
        $count-- if (defined $res->{found} and $res->{found} eq 'W');
2231
    }
2232
    my $rank = $count + 1;
2233
2234
    return $rank;
2235
}
2236
2237
2214
=head1 AUTHOR
2238
=head1 AUTHOR
2215
2239
2216
Koha Development Team <http://koha-community.org/>
2240
Koha Development Team <http://koha-community.org/>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (-1 / +1 lines)
Lines 418-424 Circulation: Link Here
418
              choices:
418
              choices:
419
                  yes: "Don't automatically"
419
                  yes: "Don't automatically"
420
                  no: Automatically
420
                  no: Automatically
421
            - mark holds as found and waiting when a hold is placed specifically on them and they are already checked in.
421
            - mark a hold as found and waiting when a hold is placed on a specific item and that item is already checked in.
422
        -
422
        -
423
            - Patrons can only have
423
            - Patrons can only have
424
            - pref: maxreserves
424
            - pref: maxreserves
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/web_services.pref (-2 / +2 lines)
Lines 35-43 Web services: Link Here
35
                no: Disable
35
                no: Disable
36
            - ILS-DI services for OPAC users
36
            - ILS-DI services for OPAC users
37
        -
37
        -
38
            - Allow IP addresses
38
            - pref: ILS-DI:AuthorizedIPs
39
            - pref: ILS-DI:AuthorizedIPs
39
              class: Text
40
              class: Text
40
            - allowed IPs to use the ILS-DI services
41
            - to use the ILS-DI services (when enabled). Separate the IP addresses with commas and without spaces. Leave the field blank to allow any IP address.
41
    Reporting:
42
    Reporting:
42
        -
43
        -
43
            - Only return
44
            - Only return
44
- 

Return to bug 8918