Lines 2-8
Link Here
|
2 |
|
2 |
|
3 |
use Modern::Perl; |
3 |
use Modern::Perl; |
4 |
|
4 |
|
5 |
use Test::More tests => 35; |
5 |
use Test::More tests => 39; |
6 |
|
6 |
|
7 |
use MARC::Record; |
7 |
use MARC::Record; |
8 |
use DateTime::Duration; |
8 |
use DateTime::Duration; |
Lines 395-400
$p = C4::Reserves::CalculatePriority($bibnum, $resdate);
Link Here
|
395 |
is($p, 3, 'CalculatePriority should now return priority 3'); |
395 |
is($p, 3, 'CalculatePriority should now return priority 3'); |
396 |
# End of tests for bug 8918 |
396 |
# End of tests for bug 8918 |
397 |
|
397 |
|
|
|
398 |
# Tests for cancel reserves by users from OPAC. |
399 |
$dbh->do('DELETE FROM reserves', undef, ($bibnum)); |
400 |
AddReserve('CPL', $requesters{'CPL'}, $item_bibnum, |
401 |
$constraint, $bibitems, 1, undef, $expdate, $notes, |
402 |
$title, $checkitem, ''); |
403 |
my (undef, $canres, undef) = CheckReserves($itemnumber); |
404 |
|
405 |
my $cancancel = CanReserveBeCanceledFromOpac($canres->{reserve_id}, $requesters{'CPL'}); |
406 |
is($cancancel, 1, 'Can user cancel its own reserve'); |
407 |
|
408 |
$cancancel = CanReserveBeCanceledFromOpac($canres->{reserve_id}, $requesters{'FPL'}); |
409 |
is($cancancel, 0, 'Other user cant cancel reserve'); |
410 |
|
411 |
ModReserveAffect($itemnumber, $requesters{'CPL'}, 1); |
412 |
$cancancel = CanReserveBeCanceledFromOpac($canres->{reserve_id}, $requesters{'CPL'}); |
413 |
is($cancancel, 0, 'Reserve in transfer status cant be canceled'); |
414 |
|
415 |
$dbh->do('DELETE FROM reserves', undef, ($bibnum)); |
416 |
AddReserve('CPL', $requesters{'CPL'}, $item_bibnum, |
417 |
$constraint, $bibitems, 1, undef, $expdate, $notes, |
418 |
$title, $checkitem, ''); |
419 |
(undef, $canres, undef) = CheckReserves($itemnumber); |
420 |
|
421 |
ModReserveAffect($itemnumber, $requesters{'CPL'}, 0); |
422 |
$cancancel = CanReserveBeCanceledFromOpac($canres->{reserve_id}, $requesters{'CPL'}); |
423 |
is($cancancel, 0, 'Reserve in waiting status cant be canceled'); |
424 |
|
425 |
# End of tests for bug 12876 |
426 |
|
398 |
$dbh->rollback; |
427 |
$dbh->rollback; |
399 |
|
428 |
|
400 |
sub count_hold_print_messages { |
429 |
sub count_hold_print_messages { |
401 |
- |
|
|