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 626-634 sub HoldTitle { Link Here
626
        $branch = $$borrower{branchcode};
626
        $branch = $$borrower{branchcode};
627
    }
627
    }
628
628
629
    my $rank = GetReserveNextRank($biblionumber);
630
629
    # Add the reserve
631
    # Add the reserve
630
    #          $branch, $borrowernumber, $biblionumber, $constraint, $bibitems,  $priority, $notes, $title, $checkitem,  $found
632
    #          $branch, $borrowernumber, $biblionumber, $constraint, $bibitems,  $priority, $notes, $title, $checkitem,  $found
631
    AddReserve( $branch, $borrowernumber, $biblionumber, 'a', undef, 0, undef, $title, undef, undef );
633
    AddReserve( $branch, $borrowernumber, $biblionumber, 'a', undef, $rank, undef, $title, undef, undef );
632
634
633
    # Hashref building
635
    # Hashref building
634
    my $out;
636
    my $out;
Lines 705-713 sub HoldItem { Link Here
705
    my $found;
707
    my $found;
706
708
707
    # Get rank and found
709
    # Get rank and found
708
    $rank = '0' unless C4::Context->preference('ReservesNeedReturns');
710
    if (C4::Context->preference('ReservesNeedReturns')) {
709
    if ( $item->{'holdingbranch'} eq $branch ) {
711
        $rank = GetReserveNextRank($biblionumber);
710
        $found = 'W' unless C4::Context->preference('ReservesNeedReturns');
712
    } else {
713
        $rank = '0';
714
        if ($item->{'holdingbranch'} eq $branch) {
715
            $found = 'W';
716
        }
711
    }
717
    }
712
718
713
    # Add the reserve
719
    # Add the reserve
(-)a/C4/Reserves.pm (-1 / +26 lines)
Lines 130-137 BEGIN { Link Here
130
        &ReserveSlip
130
        &ReserveSlip
131
        &ToggleSuspend
131
        &ToggleSuspend
132
        &SuspendAll
132
        &SuspendAll
133
134
    );
135
    @EXPORT_OK = qw(
136
        MergeHolds
137
        GetReserveNextRank
133
    );
138
    );
134
    @EXPORT_OK = qw( MergeHolds );
135
}    
139
}    
136
140
137
=head2 AddReserve
141
=head2 AddReserve
Lines 2168-2173 sub ReserveSlip { Link Here
2168
    );
2172
    );
2169
}
2173
}
2170
2174
2175
=head2 GetReserveNextRank
2176
2177
    my $next_rank = GetReserveNextRank($biblionumber);
2178
2179
Calculate the next available reseve rank for a biblionumber.
2180
2181
=cut
2182
2183
sub GetReserveNextRank {
2184
    my ($biblionumber) = @_;
2185
2186
    my ( $count, $reserves ) = GetReservesFromBiblionumber($biblionumber,1);
2187
    foreach my $res (@$reserves) {
2188
        $count-- if (defined $res->{found} and $res->{found} eq 'W');
2189
    }
2190
    my $rank = $count + 1;
2191
2192
    return $rank;
2193
}
2194
2195
2171
=head1 AUTHOR
2196
=head1 AUTHOR
2172
2197
2173
Koha Development Team <http://koha-community.org/>
2198
Koha Development Team <http://koha-community.org/>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (-1 / +1 lines)
Lines 399-405 Circulation: Link Here
399
              choices:
399
              choices:
400
                  yes: "Don't automatically"
400
                  yes: "Don't automatically"
401
                  no: Automatically
401
                  no: Automatically
402
            - mark holds as found and waiting when a hold is placed specifically on them and they are already checked in.
402
            - mark a hold as found and waiting when a hold is placed on a specific item and that item is already checked in.
403
        -
403
        -
404
            - Patrons can only have
404
            - Patrons can only have
405
            - pref: maxreserves
405
            - 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