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

(-)a/C4/Reserves.pm (-8 / +13 lines)
Lines 1100-1113 sub CancelReserveFromId { Link Here
1100
            WHERE reserve_id = ?
1100
            WHERE reserve_id = ?
1101
        };
1101
        };
1102
        $sth = $dbh->prepare($query);
1102
        $sth = $dbh->prepare($query);
1103
        $sth->execute($reserve_id);
1103
        my $rv = $sth->execute($reserve_id);
1104
1104
1105
        $query = qq{
1105
        if ($rv) {
1106
            DELETE FROM reserves
1106
            $query = qq{
1107
            WHERE reserve_id = ?
1107
                DELETE FROM reserves
1108
        };
1108
                WHERE reserve_id = ?
1109
        $sth = $dbh->prepare($query);
1109
            };
1110
        $sth->execute($reserve_id);
1110
            $sth = $dbh->prepare($query);
1111
            $sth->execute($reserve_id);
1112
        } else {
1113
            warn "ERROR: Failed to move reserve $reserve_id to table old_reserves.";
1114
            return;
1115
        }
1111
1116
1112
        # now fix the priority on the others...
1117
        # now fix the priority on the others...
1113
        _FixPriority( $reserve->{biblionumber}, $reserve->{borrowernumber} );
1118
        _FixPriority( $reserve->{biblionumber}, $reserve->{borrowernumber} );
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/ilsdi.tt (-1 / +1 lines)
Lines 671-677 Link Here
671
                    <dt><strong>patron_id</strong> (Required)</dt>
671
                    <dt><strong>patron_id</strong> (Required)</dt>
672
                    <dd>the unique patron identifier in the ILS; the same identifier returned by LookupPatron or AuthenticatePatron</dd>
672
                    <dd>the unique patron identifier in the ILS; the same identifier returned by LookupPatron or AuthenticatePatron</dd>
673
                    <dt><strong>item_id</strong> (Required)</dt>
673
                    <dt><strong>item_id</strong> (Required)</dt>
674
                    <dd>system item identifier</dd>
674
                    <dd>system hold identifier (returned by GetRecords and GetPatronInfo into element 'reserve_id')</dd>
675
                </dl>
675
                </dl>
676
                <h4>Example call</h4>
676
                <h4>Example call</h4>
677
                <a href="ilsdi.pl?service=CancelHold&amp;patron_id=1&amp;item_id=1">
677
                <a href="ilsdi.pl?service=CancelHold&amp;patron_id=1&amp;item_id=1">
(-)a/t/db_dependent/Reserves.t (-2 / +21 lines)
Lines 2-8 Link Here
2
2
3
use Modern::Perl;
3
use Modern::Perl;
4
4
5
use Test::More tests => 17;
5
use Test::More tests => 25;
6
use MARC::Record;
6
use MARC::Record;
7
use DateTime::Duration;
7
use DateTime::Duration;
8
8
Lines 215-220 is( $messages->{ResFound}->{borrowernumber}, Link Here
215
    $requesters{'RPL'},
215
    $requesters{'RPL'},
216
    'for generous library, its items fill first hold request in line (bug 10272)');
216
    'for generous library, its items fill first hold request in line (bug 10272)');
217
217
218
my (undef, $reserves) = GetReservesFromBiblionumber($biblionumber);
219
isa_ok($reserves, 'ARRAY');
220
is(scalar @$reserves, 1, "Only one reserves for this biblio");
221
my $reserve_id = $reserves->[0]->{reserve_id};
222
223
$reserve = GetReserve($reserve_id);
224
isa_ok($reserve, 'HASH', "GetReserve return");
225
is($reserve->{biblionumber}, $biblionumber);
226
227
$reserve = CancelReserveFromId($reserve_id);
228
isa_ok($reserve, 'HASH', "CancelReserveFromId return");
229
is($reserve->{biblionumber}, $biblionumber);
230
231
$reserve = GetReserve($reserve_id);
232
is($reserve, undef, "GetReserve returns undef after deletion");
233
234
$reserve = CancelReserveFromId($reserve_id);
235
is($reserve, undef, "CancelReserveFromId return undef if reserve does not exist");
236
237
218
# Tests for bug 9761 (ConfirmFutureHolds): new CheckReserves lookahead parameter, and corresponding change in AddReturn
238
# Tests for bug 9761 (ConfirmFutureHolds): new CheckReserves lookahead parameter, and corresponding change in AddReturn
219
# Note that CheckReserve uses its lookahead parameter and does not check ConfirmFutureHolds pref (it should be passed if needed like AddReturn does)
239
# Note that CheckReserve uses its lookahead parameter and does not check ConfirmFutureHolds pref (it should be passed if needed like AddReturn does)
220
# Test 9761a: Add a reserve without date, CheckReserve should return it
240
# Test 9761a: Add a reserve without date, CheckReserve should return it
221
- 

Return to bug 8868