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

(-)a/C4/Reserves.pm (-8 / +13 lines)
Lines 1104-1117 sub CancelReserveFromId { Link Here
1104
            WHERE reserve_id = ?
1104
            WHERE reserve_id = ?
1105
        };
1105
        };
1106
        $sth = $dbh->prepare($query);
1106
        $sth = $dbh->prepare($query);
1107
        $sth->execute($reserve_id);
1107
        my $rv = $sth->execute($reserve_id);
1108
1108
1109
        $query = qq{
1109
        if ($rv) {
1110
            DELETE FROM reserves
1110
            $query = qq{
1111
            WHERE reserve_id = ?
1111
                DELETE FROM reserves
1112
        };
1112
                WHERE reserve_id = ?
1113
        $sth = $dbh->prepare($query);
1113
            };
1114
        $sth->execute($reserve_id);
1114
            $sth = $dbh->prepare($query);
1115
            $sth->execute($reserve_id);
1116
        } else {
1117
            warn "ERROR: Failed to move reserve $reserve_id to table old_reserves.";
1118
            return;
1119
        }
1115
1120
1116
        # now fix the priority on the others...
1121
        # now fix the priority on the others...
1117
        _FixPriority( $reserve->{biblionumber}, $reserve->{borrowernumber} );
1122
        _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 (-1 / +24 lines)
Lines 2-8 Link Here
2
2
3
use Modern::Perl;
3
use Modern::Perl;
4
4
5
<<<<<<< HEAD
5
use Test::More tests => 23;
6
use Test::More tests => 23;
7
=======
8
use Test::More tests => 25;
9
>>>>>>> Bug 8868: ILS-DI: CancelHold needs to take a reserve_id (follow-up)
6
use MARC::Record;
10
use MARC::Record;
7
use DateTime::Duration;
11
use DateTime::Duration;
8
12
Lines 221-226 is( $messages->{ResFound}->{borrowernumber}, Link Here
221
    $requesters{'RPL'},
225
    $requesters{'RPL'},
222
    'for generous library, its items fill first hold request in line (bug 10272)');
226
    'for generous library, its items fill first hold request in line (bug 10272)');
223
227
228
my (undef, $reserves) = GetReservesFromBiblionumber($biblionumber);
229
isa_ok($reserves, 'ARRAY');
230
is(scalar @$reserves, 1, "Only one reserves for this biblio");
231
my $reserve_id = $reserves->[0]->{reserve_id};
232
233
$reserve = GetReserve($reserve_id);
234
isa_ok($reserve, 'HASH', "GetReserve return");
235
is($reserve->{biblionumber}, $biblionumber);
236
237
$reserve = CancelReserveFromId($reserve_id);
238
isa_ok($reserve, 'HASH', "CancelReserveFromId return");
239
is($reserve->{biblionumber}, $biblionumber);
240
241
$reserve = GetReserve($reserve_id);
242
is($reserve, undef, "GetReserve returns undef after deletion");
243
244
$reserve = CancelReserveFromId($reserve_id);
245
is($reserve, undef, "CancelReserveFromId return undef if reserve does not exist");
246
247
224
# Tests for bug 9761 (ConfirmFutureHolds): new CheckReserves lookahead parameter, and corresponding change in AddReturn
248
# Tests for bug 9761 (ConfirmFutureHolds): new CheckReserves lookahead parameter, and corresponding change in AddReturn
225
# Note that CheckReserve uses its lookahead parameter and does not check ConfirmFutureHolds pref (it should be passed if needed like AddReturn does)
249
# Note that CheckReserve uses its lookahead parameter and does not check ConfirmFutureHolds pref (it should be passed if needed like AddReturn does)
226
# Test 9761a: Add a reserve without date, CheckReserve should return it
250
# Test 9761a: Add a reserve without date, CheckReserve should return it
227
- 

Return to bug 8868