|
Lines 52-58
$insert_sth->execute('DUMMY');
Link Here
|
| 52 |
$insert_sth->execute('ONLY1'); |
52 |
$insert_sth->execute('ONLY1'); |
| 53 |
|
53 |
|
| 54 |
# Setup Test------------------------ |
54 |
# Setup Test------------------------ |
| 55 |
my $biblio = $builder->gimme_a_biblio({ itemtype => 'DUMMY' }); |
55 |
my $biblio = $builder->build_sample_biblio({ itemtype => 'DUMMY' }); |
| 56 |
|
56 |
|
| 57 |
# Create item instance for testing. |
57 |
# Create item instance for testing. |
| 58 |
my ($item_bibnum, $item_bibitemnum, $itemnumber) |
58 |
my ($item_bibnum, $item_bibitemnum, $itemnumber) |
|
Lines 237-243
is( $hold->priority, '6', "Test AlterPriority(), move to bottom" );
Link Here
|
| 237 |
# Note that canreservefromotherbranches has no effect if |
237 |
# Note that canreservefromotherbranches has no effect if |
| 238 |
# IndependentBranches is OFF. |
238 |
# IndependentBranches is OFF. |
| 239 |
|
239 |
|
| 240 |
my $foreign_biblio = $builder->gimme_a_biblio({ itemtype => 'DUMMY' }); |
240 |
my $foreign_biblio = $builder->build_sample_biblio({ itemtype => 'DUMMY' }); |
| 241 |
my ($foreign_item_bibnum, $foreign_item_bibitemnum, $foreign_itemnumber) |
241 |
my ($foreign_item_bibnum, $foreign_item_bibitemnum, $foreign_itemnumber) |
| 242 |
= AddItem({ homebranch => $branch_2, holdingbranch => $branch_2 } , $foreign_biblio->biblionumber); |
242 |
= AddItem({ homebranch => $branch_2, holdingbranch => $branch_2 } , $foreign_biblio->biblionumber); |
| 243 |
$dbh->do('DELETE FROM issuingrules'); |
243 |
$dbh->do('DELETE FROM issuingrules'); |
|
Lines 282-288
ok(
Link Here
|
| 282 |
|
282 |
|
| 283 |
{ |
283 |
{ |
| 284 |
# Regression test for bug 11336 # Test if ModReserve correctly recalculate the priorities |
284 |
# Regression test for bug 11336 # Test if ModReserve correctly recalculate the priorities |
| 285 |
$biblio = $builder->gimme_a_biblio({ itemtype => 'DUMMY' }); |
285 |
$biblio = $builder->build_sample_biblio({ itemtype => 'DUMMY' }); |
| 286 |
($item_bibnum, $item_bibitemnum, $itemnumber) = AddItem({ homebranch => $branch_1, holdingbranch => $branch_1 } , $biblio->biblionumber); |
286 |
($item_bibnum, $item_bibitemnum, $itemnumber) = AddItem({ homebranch => $branch_1, holdingbranch => $branch_1 } , $biblio->biblionumber); |
| 287 |
my $reserveid1 = AddReserve($branch_1, $borrowernumbers[0], $biblio->biblionumber, '', 1); |
287 |
my $reserveid1 = AddReserve($branch_1, $borrowernumbers[0], $biblio->biblionumber, '', 1); |
| 288 |
($item_bibnum, $item_bibitemnum, $itemnumber) = AddItem({ homebranch => $branch_1, holdingbranch => $branch_1 } , $biblio->biblionumber); |
288 |
($item_bibnum, $item_bibitemnum, $itemnumber) = AddItem({ homebranch => $branch_1, holdingbranch => $branch_1 } , $biblio->biblionumber); |
|
Lines 319-325
ok( CanItemBeReserved( $borrowernumbers[0], $itemnumber)->{status} eq 'damaged',
Link Here
|
| 319 |
ok( !defined( ( CheckReserves($itemnumber) )[1] ), "Hold cannot be trapped for damaged item with AllowHoldsOnDamagedItems disabled" ); |
319 |
ok( !defined( ( CheckReserves($itemnumber) )[1] ), "Hold cannot be trapped for damaged item with AllowHoldsOnDamagedItems disabled" ); |
| 320 |
|
320 |
|
| 321 |
# Regression test for bug 9532 |
321 |
# Regression test for bug 9532 |
| 322 |
$biblio = $builder->gimme_a_biblio({ itemtype => 'CANNOT' }); |
322 |
$biblio = $builder->build_sample_biblio({ itemtype => 'CANNOT' }); |
| 323 |
($item_bibnum, $item_bibitemnum, $itemnumber) = AddItem({ homebranch => $branch_1, holdingbranch => $branch_1, itype => 'CANNOT' } , $biblio->biblionumber); |
323 |
($item_bibnum, $item_bibitemnum, $itemnumber) = AddItem({ homebranch => $branch_1, holdingbranch => $branch_1, itype => 'CANNOT' } , $biblio->biblionumber); |
| 324 |
AddReserve( |
324 |
AddReserve( |
| 325 |
$branch_1, |
325 |
$branch_1, |
|
Lines 367-373
$dbh->do(q{
Link Here
|
| 367 |
INSERT INTO branch_item_rules (branchcode, itemtype, holdallowed, returnbranch) |
367 |
INSERT INTO branch_item_rules (branchcode, itemtype, holdallowed, returnbranch) |
| 368 |
VALUES (?, ?, ?, ?) |
368 |
VALUES (?, ?, ?, ?) |
| 369 |
}, {}, $branch_1, 'CAN', 1, 'homebranch'); |
369 |
}, {}, $branch_1, 'CAN', 1, 'homebranch'); |
| 370 |
$biblio = $builder->gimme_a_biblio({ itemtype => 'CANNOT' }); |
370 |
$biblio = $builder->build_sample_biblio({ itemtype => 'CANNOT' }); |
| 371 |
($item_bibnum, $item_bibitemnum, $itemnumber) = AddItem( |
371 |
($item_bibnum, $item_bibitemnum, $itemnumber) = AddItem( |
| 372 |
{ homebranch => $branch_1, holdingbranch => $branch_1, itype => 'CANNOT' } , $biblio->biblionumber); |
372 |
{ homebranch => $branch_1, holdingbranch => $branch_1, itype => 'CANNOT' } , $biblio->biblionumber); |
| 373 |
is(CanItemBeReserved($borrowernumbers[0], $itemnumber)->{status}, 'notReservable', |
373 |
is(CanItemBeReserved($borrowernumbers[0], $itemnumber)->{status}, 'notReservable', |
|
Lines 393-399
$dbh->do('DELETE FROM issues');
Link Here
|
| 393 |
$dbh->do('DELETE FROM items'); |
393 |
$dbh->do('DELETE FROM items'); |
| 394 |
$dbh->do('DELETE FROM biblio'); |
394 |
$dbh->do('DELETE FROM biblio'); |
| 395 |
|
395 |
|
| 396 |
$biblio = $builder->gimme_a_biblio({ itemtype => 'ONLY1' }); |
396 |
$biblio = $builder->build_sample_biblio({ itemtype => 'ONLY1' }); |
| 397 |
( $item_bibnum, $item_bibitemnum, $itemnumber ) |
397 |
( $item_bibnum, $item_bibitemnum, $itemnumber ) |
| 398 |
= AddItem( { homebranch => $branch_1, holdingbranch => $branch_1 }, $biblio->biblionumber ); |
398 |
= AddItem( { homebranch => $branch_1, holdingbranch => $branch_1 }, $biblio->biblionumber ); |
| 399 |
|
399 |
|
|
Lines 418-424
subtest 'Test max_holds per library/patron category' => sub {
Link Here
|
| 418 |
$dbh->do('DELETE FROM issuingrules'); |
418 |
$dbh->do('DELETE FROM issuingrules'); |
| 419 |
$dbh->do('DELETE FROM circulation_rules'); |
419 |
$dbh->do('DELETE FROM circulation_rules'); |
| 420 |
|
420 |
|
| 421 |
$biblio = $builder->gimme_a_biblio({ itemtype => 'TEST' }); |
421 |
$biblio = $builder->build_sample_biblio({ itemtype => 'TEST' }); |
| 422 |
( $item_bibnum, $item_bibitemnum, $itemnumber ) = |
422 |
( $item_bibnum, $item_bibitemnum, $itemnumber ) = |
| 423 |
AddItem( { homebranch => $branch_1, holdingbranch => $branch_1 }, |
423 |
AddItem( { homebranch => $branch_1, holdingbranch => $branch_1 }, |
| 424 |
$biblio->biblionumber ); |
424 |
$biblio->biblionumber ); |
|
Lines 488-494
subtest 'Test max_holds per library/patron category' => sub {
Link Here
|
| 488 |
subtest 'Pickup location availability tests' => sub { |
488 |
subtest 'Pickup location availability tests' => sub { |
| 489 |
plan tests => 3; |
489 |
plan tests => 3; |
| 490 |
|
490 |
|
| 491 |
$biblio = $builder->gimme_a_biblio({ itemtype => 'ONLY1' }); |
491 |
$biblio = $builder->build_sample_biblio({ itemtype => 'ONLY1' }); |
| 492 |
my ( $item_bibnum, $item_bibitemnum, $itemnumber ) |
492 |
my ( $item_bibnum, $item_bibitemnum, $itemnumber ) |
| 493 |
= AddItem( { homebranch => $branch_1, holdingbranch => $branch_1 }, $biblio->biblionumber ); |
493 |
= AddItem( { homebranch => $branch_1, holdingbranch => $branch_1 }, $biblio->biblionumber ); |
| 494 |
#Add a default rule to allow some holds |
494 |
#Add a default rule to allow some holds |
|
Lines 533-553
subtest 'CanItemBeReserved / holds_per_day tests' => sub {
Link Here
|
| 533 |
my $patron = $builder->build_object( { class => 'Koha::Patrons' } ); |
533 |
my $patron = $builder->build_object( { class => 'Koha::Patrons' } ); |
| 534 |
|
534 |
|
| 535 |
# Create 3 biblios with items |
535 |
# Create 3 biblios with items |
| 536 |
my $biblio_1 = $builder->gimme_a_biblio({ itemtype => $itemtype->itemtype }); |
536 |
my $biblio_1 = $builder->build_sample_biblio({ itemtype => $itemtype->itemtype }); |
| 537 |
my ( undef, undef, $itemnumber_1 ) = AddItem( |
537 |
my ( undef, undef, $itemnumber_1 ) = AddItem( |
| 538 |
{ homebranch => $library->branchcode, |
538 |
{ homebranch => $library->branchcode, |
| 539 |
holdingbranch => $library->branchcode |
539 |
holdingbranch => $library->branchcode |
| 540 |
}, |
540 |
}, |
| 541 |
$biblio_1->biblionumber |
541 |
$biblio_1->biblionumber |
| 542 |
); |
542 |
); |
| 543 |
my $biblio_2 = $builder->gimme_a_biblio({ itemtype => $itemtype->itemtype }); |
543 |
my $biblio_2 = $builder->build_sample_biblio({ itemtype => $itemtype->itemtype }); |
| 544 |
my ( undef, undef, $itemnumber_2 ) = AddItem( |
544 |
my ( undef, undef, $itemnumber_2 ) = AddItem( |
| 545 |
{ homebranch => $library->branchcode, |
545 |
{ homebranch => $library->branchcode, |
| 546 |
holdingbranch => $library->branchcode |
546 |
holdingbranch => $library->branchcode |
| 547 |
}, |
547 |
}, |
| 548 |
$biblio_2->biblionumber |
548 |
$biblio_2->biblionumber |
| 549 |
); |
549 |
); |
| 550 |
my $biblio_3 = $builder->gimme_a_biblio({ itemtype => $itemtype->itemtype }); |
550 |
my $biblio_3 = $builder->build_sample_biblio({ itemtype => $itemtype->itemtype }); |
| 551 |
my ( undef, undef, $itemnumber_3 ) = AddItem( |
551 |
my ( undef, undef, $itemnumber_3 ) = AddItem( |
| 552 |
{ homebranch => $library->branchcode, |
552 |
{ homebranch => $library->branchcode, |
| 553 |
holdingbranch => $library->branchcode |
553 |
holdingbranch => $library->branchcode |