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 |
$dbh->do('DELETE FROM branchtransfers', undef, undef); |
401 |
AddReserve('CPL', $requesters{'CPL'}, $item_bibnum, |
402 |
$constraint, $bibitems, 1, undef, $expdate, $notes, |
403 |
$title, $checkitem, ''); |
404 |
my (undef, $canres, undef) = CheckReserves($itemnumber); |
405 |
|
406 |
my $cancancel = CanUserCancelReserve($canres->{reserve_id}, $requesters{'CPL'}); |
407 |
is($cancancel, 1, 'Can user cancel its own reserve'); |
408 |
|
409 |
$cancancel = CanUserCancelReserve($canres->{reserve_id}, $requesters{'FPL'}); |
410 |
is($cancancel, 0, 'Other user cant cancel reserve'); |
411 |
|
412 |
ModReserveAffect($itemnumber, $requesters{'CPL'}, 1); |
413 |
ModItemTransfer($itemnumber, 'CPL', 'FPL' ); |
414 |
$cancancel = CanUserCancelReserve($canres->{reserve_id}, $requesters{'CPL'}); |
415 |
is($cancancel, 0, 'Reserve in transfer status cant be canceled'); |
416 |
|
417 |
$dbh->do('DELETE FROM reserves', undef, ($bibnum)); |
418 |
AddReserve('CPL', $requesters{'CPL'}, $item_bibnum, |
419 |
$constraint, $bibitems, 1, undef, $expdate, $notes, |
420 |
$title, $checkitem, ''); |
421 |
(undef, $canres, undef) = CheckReserves($itemnumber); |
422 |
|
423 |
ModReserveAffect($itemnumber, $requesters{'CPL'}, 0); |
424 |
$cancancel = CanUserCancelReserve($canres->{reserve_id}, $requesters{'CPL'}); |
425 |
is($cancancel, 0, 'Reserve in waiting status cant be canceled'); |
426 |
|
427 |
# End of tests for bug 12876 |
428 |
|
398 |
$dbh->rollback; |
429 |
$dbh->rollback; |
399 |
|
430 |
|
400 |
sub count_hold_print_messages { |
431 |
sub count_hold_print_messages { |
401 |
- |
|
|