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

(-)a/C4/Reserves.pm (-8 / +13 lines)
Lines 1111-1124 sub CancelReserveFromId { Link Here
1111
            WHERE reserve_id = ?
1111
            WHERE reserve_id = ?
1112
        };
1112
        };
1113
        $sth = $dbh->prepare($query);
1113
        $sth = $dbh->prepare($query);
1114
        $sth->execute($reserve_id);
1114
        my $rv = $sth->execute($reserve_id);
1115
1115
1116
        $query = qq{
1116
        if ($rv) {
1117
            DELETE FROM reserves
1117
            $query = qq{
1118
            WHERE reserve_id = ?
1118
                DELETE FROM reserves
1119
        };
1119
                WHERE reserve_id = ?
1120
        $sth = $dbh->prepare($query);
1120
            };
1121
        $sth->execute($reserve_id);
1121
            $sth = $dbh->prepare($query);
1122
            $sth->execute($reserve_id);
1123
        } else {
1124
            warn "ERROR: Failed to move reserve $reserve_id to table old_reserves.";
1125
            return;
1126
        }
1122
1127
1123
        # now fix the priority on the others...
1128
        # now fix the priority on the others...
1124
        _FixPriority( $reserve->{biblionumber}, $reserve->{borrowernumber} );
1129
        _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 / +19 lines)
Lines 4-10 use strict; Link Here
4
use warnings;
4
use warnings;
5
use C4::Branch;
5
use C4::Branch;
6
6
7
use Test::More tests => 4;
7
use Test::More tests => 12;
8
use MARC::Record;
8
use MARC::Record;
9
use C4::Biblio;
9
use C4::Biblio;
10
use C4::Items;
10
use C4::Items;
Lines 66-71 ok($status eq "Reserved", "CheckReserves Test 2"); Link Here
66
($status, $reserve, $all_reserves) = CheckReserves(undef, $barcode);
66
($status, $reserve, $all_reserves) = CheckReserves(undef, $barcode);
67
ok($status eq "Reserved", "CheckReserves Test 3");
67
ok($status eq "Reserved", "CheckReserves Test 3");
68
68
69
my (undef, $reserves) = GetReservesFromBiblionumber($biblionumber);
70
isa_ok($reserves, 'ARRAY');
71
is(scalar @$reserves, 1, "Only one reserves for this biblio");
72
my $reserve_id = $reserves->[0]->{reserve_id};
73
74
$reserve = GetReserve($reserve_id);
75
isa_ok($reserve, 'HASH', "GetReserve return");
76
is($reserve->{biblionumber}, $biblionumber);
77
78
$reserve = CancelReserveFromId($reserve_id);
79
isa_ok($reserve, 'HASH', "CancelReserveFromId return");
80
is($reserve->{biblionumber}, $biblionumber);
81
82
$reserve = GetReserve($reserve_id);
83
is($reserve, undef, "GetReserve returns undef after deletion");
84
85
$reserve = CancelReserveFromId($reserve_id);
86
is($reserve, undef, "CancelReserveFromId return undef if reserve does not exist");
69
87
70
# Teardown Test---------------------
88
# Teardown Test---------------------
71
# Delete item.
89
# Delete item.
72
- 

Return to bug 8868