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

(-)a/C4/Reserves.pm (-1 / +1 lines)
Lines 1274-1280 sub ModReserveAffect { Link Here
1274
    $sth = $dbh->prepare($query);
1274
    $sth = $dbh->prepare($query);
1275
    $sth->execute( $itemnumber, $borrowernumber,$biblionumber);
1275
    $sth->execute( $itemnumber, $borrowernumber,$biblionumber);
1276
    _koha_notify_reserve( $itemnumber, $borrowernumber, $biblionumber ) if ( !$transferToDo && !$already_on_shelf );
1276
    _koha_notify_reserve( $itemnumber, $borrowernumber, $biblionumber ) if ( !$transferToDo && !$already_on_shelf );
1277
1277
    _FixPriority( { biblionumber => $biblionumber } );
1278
    if ( C4::Context->preference("ReturnToShelvingCart") ) {
1278
    if ( C4::Context->preference("ReturnToShelvingCart") ) {
1279
      CartToShelf( $itemnumber );
1279
      CartToShelf( $itemnumber );
1280
    }
1280
    }
(-)a/t/db_dependent/Reserves.t (-2 / +27 lines)
Lines 2-8 Link Here
2
2
3
use Modern::Perl;
3
use Modern::Perl;
4
4
5
use Test::More tests => 20;
5
use Test::More tests => 23;
6
use MARC::Record;
6
use MARC::Record;
7
use DateTime::Duration;
7
use DateTime::Duration;
8
8
Lines 191-196 my ($itemnum_cpl, $itemnum_fpl); Link Here
191
        barcode => 'bug10272_FPL'
191
        barcode => 'bug10272_FPL'
192
    } , $bibnum2);
192
    } , $bibnum2);
193
193
194
# Ensure that priorities are numbered correcly when a hold is moved to waiting
195
# (bug 11947)
196
$dbh->do("DELETE FROM reserves WHERE biblionumber=?",undef,($bibnum2));
197
AddReserve('RPL',  $requesters{'RPL'}, $bibnum2,
198
           $constraint, $bibitems,  1, $resdate, $expdate, $notes,
199
           $title,      $checkitem, $found);
200
AddReserve('FPL',  $requesters{'FPL'}, $bibnum2,
201
           $constraint, $bibitems,  2, $resdate, $expdate, $notes,
202
           $title,      $checkitem, $found);
203
AddReserve('CPL',  $requesters{'CPL'}, $bibnum2,
204
           $constraint, $bibitems,  3, $resdate, $expdate, $notes,
205
           $title,      $checkitem, $found);
206
ModReserveAffect($itemnum_cpl, $requesters{'RPL'}, 0);
207
208
# Now it should have different priorities.
209
my ($count, $title_reserves) = GetReservesFromBiblionumber($bibnum2);
210
# Sort by reserve number in case the database gives us oddly ordered results
211
my @reserves = sort { $a->{reserve_id} <=> $b->{reserve_id} } @$title_reserves;
212
is($reserves[0]{priority}, 0, 'Item is correctly waiting');
213
is($reserves[1]{priority}, 1, 'Item is correctly priority 1');
214
is($reserves[2]{priority}, 2, 'Item is correctly priority 2');
215
216
217
$dbh->do("DELETE FROM reserves WHERE biblionumber=?",undef,($bibnum2));
194
AddReserve('RPL',  $requesters{'RPL'}, $bibnum2,
218
AddReserve('RPL',  $requesters{'RPL'}, $bibnum2,
195
           $constraint, $bibitems,  1, $resdate, $expdate, $notes,
219
           $constraint, $bibitems,  1, $resdate, $expdate, $notes,
196
           $title,      $checkitem, $found);
220
           $title,      $checkitem, $found);
Lines 291-296 is( Link Here
291
my $letter = ReserveSlip('CPL', $requesters{'CPL'}, $bibnum);
315
my $letter = ReserveSlip('CPL', $requesters{'CPL'}, $bibnum);
292
ok(defined($letter), 'can successfully generate hold slip (bug 10949)');
316
ok(defined($letter), 'can successfully generate hold slip (bug 10949)');
293
317
318
319
294
$dbh->rollback;
320
$dbh->rollback;
295
321
296
sub count_hold_print_messages {
322
sub count_hold_print_messages {
297
- 

Return to bug 11947