|
Lines 54-60
$insert_sth->execute('DUMMY');
Link Here
|
| 54 |
$insert_sth->execute('ONLY1'); |
54 |
$insert_sth->execute('ONLY1'); |
| 55 |
|
55 |
|
| 56 |
# Setup Test------------------------ |
56 |
# Setup Test------------------------ |
| 57 |
my $biblio = $builder->gimme_a_biblio({ itemtype => 'DUMMY' }); |
57 |
my $biblio = $builder->build_sample_biblio({ itemtype => 'DUMMY' }); |
| 58 |
|
58 |
|
| 59 |
# Create item instance for testing. |
59 |
# Create item instance for testing. |
| 60 |
my ($item_bibnum, $item_bibitemnum, $itemnumber) |
60 |
my ($item_bibnum, $item_bibitemnum, $itemnumber) |
|
Lines 239-245
is( $hold->priority, '6', "Test AlterPriority(), move to bottom" );
Link Here
|
| 239 |
# Note that canreservefromotherbranches has no effect if |
239 |
# Note that canreservefromotherbranches has no effect if |
| 240 |
# IndependentBranches is OFF. |
240 |
# IndependentBranches is OFF. |
| 241 |
|
241 |
|
| 242 |
my $foreign_biblio = $builder->gimme_a_biblio({ itemtype => 'DUMMY' }); |
242 |
my $foreign_biblio = $builder->build_sample_biblio({ itemtype => 'DUMMY' }); |
| 243 |
my ($foreign_item_bibnum, $foreign_item_bibitemnum, $foreign_itemnumber) |
243 |
my ($foreign_item_bibnum, $foreign_item_bibitemnum, $foreign_itemnumber) |
| 244 |
= AddItem({ homebranch => $branch_2, holdingbranch => $branch_2 } , $foreign_biblio->biblionumber); |
244 |
= AddItem({ homebranch => $branch_2, holdingbranch => $branch_2 } , $foreign_biblio->biblionumber); |
| 245 |
$dbh->do('DELETE FROM issuingrules'); |
245 |
$dbh->do('DELETE FROM issuingrules'); |
|
Lines 284-290
ok(
Link Here
|
| 284 |
|
284 |
|
| 285 |
{ |
285 |
{ |
| 286 |
# Regression test for bug 11336 # Test if ModReserve correctly recalculate the priorities |
286 |
# Regression test for bug 11336 # Test if ModReserve correctly recalculate the priorities |
| 287 |
$biblio = $builder->gimme_a_biblio({ itemtype => 'DUMMY' }); |
287 |
$biblio = $builder->build_sample_biblio({ itemtype => 'DUMMY' }); |
| 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); |
| 289 |
my $reserveid1 = AddReserve($branch_1, $borrowernumbers[0], $biblio->biblionumber, '', 1); |
289 |
my $reserveid1 = AddReserve($branch_1, $borrowernumbers[0], $biblio->biblionumber, '', 1); |
| 290 |
($item_bibnum, $item_bibitemnum, $itemnumber) = AddItem({ homebranch => $branch_1, holdingbranch => $branch_1 } , $biblio->biblionumber); |
290 |
($item_bibnum, $item_bibitemnum, $itemnumber) = AddItem({ homebranch => $branch_1, holdingbranch => $branch_1 } , $biblio->biblionumber); |
|
Lines 321-327
ok( CanItemBeReserved( $borrowernumbers[0], $itemnumber)->{status} eq 'damaged',
Link Here
|
| 321 |
ok( !defined( ( CheckReserves($itemnumber) )[1] ), "Hold cannot be trapped for damaged item with AllowHoldsOnDamagedItems disabled" ); |
321 |
ok( !defined( ( CheckReserves($itemnumber) )[1] ), "Hold cannot be trapped for damaged item with AllowHoldsOnDamagedItems disabled" ); |
| 322 |
|
322 |
|
| 323 |
# Regression test for bug 9532 |
323 |
# Regression test for bug 9532 |
| 324 |
$biblio = $builder->gimme_a_biblio({ itemtype => 'CANNOT' }); |
324 |
$biblio = $builder->build_sample_biblio({ itemtype => 'CANNOT' }); |
| 325 |
($item_bibnum, $item_bibitemnum, $itemnumber) = AddItem({ homebranch => $branch_1, holdingbranch => $branch_1, itype => 'CANNOT' } , $biblio->biblionumber); |
325 |
($item_bibnum, $item_bibitemnum, $itemnumber) = AddItem({ homebranch => $branch_1, holdingbranch => $branch_1, itype => 'CANNOT' } , $biblio->biblionumber); |
| 326 |
AddReserve( |
326 |
AddReserve( |
| 327 |
$branch_1, |
327 |
$branch_1, |
|
Lines 369-375
$dbh->do(q{
Link Here
|
| 369 |
INSERT INTO branch_item_rules (branchcode, itemtype, holdallowed, returnbranch) |
369 |
INSERT INTO branch_item_rules (branchcode, itemtype, holdallowed, returnbranch) |
| 370 |
VALUES (?, ?, ?, ?) |
370 |
VALUES (?, ?, ?, ?) |
| 371 |
}, {}, $branch_1, 'CAN', 1, 'homebranch'); |
371 |
}, {}, $branch_1, 'CAN', 1, 'homebranch'); |
| 372 |
$biblio = $builder->gimme_a_biblio({ itemtype => 'CANNOT' }); |
372 |
$biblio = $builder->build_sample_biblio({ itemtype => 'CANNOT' }); |
| 373 |
($item_bibnum, $item_bibitemnum, $itemnumber) = AddItem( |
373 |
($item_bibnum, $item_bibitemnum, $itemnumber) = AddItem( |
| 374 |
{ homebranch => $branch_1, holdingbranch => $branch_1, itype => 'CANNOT' } , $biblio->biblionumber); |
374 |
{ homebranch => $branch_1, holdingbranch => $branch_1, itype => 'CANNOT' } , $biblio->biblionumber); |
| 375 |
is(CanItemBeReserved($borrowernumbers[0], $itemnumber)->{status}, 'notReservable', |
375 |
is(CanItemBeReserved($borrowernumbers[0], $itemnumber)->{status}, 'notReservable', |
|
Lines 395-401
$dbh->do('DELETE FROM issues');
Link Here
|
| 395 |
$dbh->do('DELETE FROM items'); |
395 |
$dbh->do('DELETE FROM items'); |
| 396 |
$dbh->do('DELETE FROM biblio'); |
396 |
$dbh->do('DELETE FROM biblio'); |
| 397 |
|
397 |
|
| 398 |
$biblio = $builder->gimme_a_biblio({ itemtype => 'ONLY1' }); |
398 |
$biblio = $builder->build_sample_biblio({ itemtype => 'ONLY1' }); |
| 399 |
( $item_bibnum, $item_bibitemnum, $itemnumber ) |
399 |
( $item_bibnum, $item_bibitemnum, $itemnumber ) |
| 400 |
= AddItem( { homebranch => $branch_1, holdingbranch => $branch_1 }, $biblio->biblionumber ); |
400 |
= AddItem( { homebranch => $branch_1, holdingbranch => $branch_1 }, $biblio->biblionumber ); |
| 401 |
|
401 |
|
|
Lines 420-426
subtest 'Test max_holds per library/patron category' => sub {
Link Here
|
| 420 |
$dbh->do('DELETE FROM issuingrules'); |
420 |
$dbh->do('DELETE FROM issuingrules'); |
| 421 |
$dbh->do('DELETE FROM circulation_rules'); |
421 |
$dbh->do('DELETE FROM circulation_rules'); |
| 422 |
|
422 |
|
| 423 |
$biblio = $builder->gimme_a_biblio({ itemtype => 'TEST' }); |
423 |
$biblio = $builder->build_sample_biblio({ itemtype => 'TEST' }); |
| 424 |
( $item_bibnum, $item_bibitemnum, $itemnumber ) = |
424 |
( $item_bibnum, $item_bibitemnum, $itemnumber ) = |
| 425 |
AddItem( { homebranch => $branch_1, holdingbranch => $branch_1 }, |
425 |
AddItem( { homebranch => $branch_1, holdingbranch => $branch_1 }, |
| 426 |
$biblio->biblionumber ); |
426 |
$biblio->biblionumber ); |
|
Lines 490-496
subtest 'Test max_holds per library/patron category' => sub {
Link Here
|
| 490 |
subtest 'Pickup location availability tests' => sub { |
490 |
subtest 'Pickup location availability tests' => sub { |
| 491 |
plan tests => 4; |
491 |
plan tests => 4; |
| 492 |
|
492 |
|
| 493 |
$biblio = $builder->gimme_a_biblio({ itemtype => 'ONLY1' }); |
493 |
$biblio = $builder->build_sample_biblio({ itemtype => 'ONLY1' }); |
| 494 |
my ( $item_bibnum, $item_bibitemnum, $itemnumber ) |
494 |
my ( $item_bibnum, $item_bibitemnum, $itemnumber ) |
| 495 |
= AddItem( { homebranch => $branch_1, holdingbranch => $branch_1 }, $biblio->biblionumber ); |
495 |
= AddItem( { homebranch => $branch_1, holdingbranch => $branch_1 }, $biblio->biblionumber ); |
| 496 |
#Add a default rule to allow some holds |
496 |
#Add a default rule to allow some holds |
|
Lines 547-567
subtest 'CanItemBeReserved / holds_per_day tests' => sub {
Link Here
|
| 547 |
my $patron = $builder->build_object( { class => 'Koha::Patrons' } ); |
547 |
my $patron = $builder->build_object( { class => 'Koha::Patrons' } ); |
| 548 |
|
548 |
|
| 549 |
# Create 3 biblios with items |
549 |
# Create 3 biblios with items |
| 550 |
my $biblio_1 = $builder->gimme_a_biblio({ itemtype => $itemtype->itemtype }); |
550 |
my $biblio_1 = $builder->build_sample_biblio({ itemtype => $itemtype->itemtype }); |
| 551 |
my ( undef, undef, $itemnumber_1 ) = AddItem( |
551 |
my ( undef, undef, $itemnumber_1 ) = AddItem( |
| 552 |
{ homebranch => $library->branchcode, |
552 |
{ homebranch => $library->branchcode, |
| 553 |
holdingbranch => $library->branchcode |
553 |
holdingbranch => $library->branchcode |
| 554 |
}, |
554 |
}, |
| 555 |
$biblio_1->biblionumber |
555 |
$biblio_1->biblionumber |
| 556 |
); |
556 |
); |
| 557 |
my $biblio_2 = $builder->gimme_a_biblio({ itemtype => $itemtype->itemtype }); |
557 |
my $biblio_2 = $builder->build_sample_biblio({ itemtype => $itemtype->itemtype }); |
| 558 |
my ( undef, undef, $itemnumber_2 ) = AddItem( |
558 |
my ( undef, undef, $itemnumber_2 ) = AddItem( |
| 559 |
{ homebranch => $library->branchcode, |
559 |
{ homebranch => $library->branchcode, |
| 560 |
holdingbranch => $library->branchcode |
560 |
holdingbranch => $library->branchcode |
| 561 |
}, |
561 |
}, |
| 562 |
$biblio_2->biblionumber |
562 |
$biblio_2->biblionumber |
| 563 |
); |
563 |
); |
| 564 |
my $biblio_3 = $builder->gimme_a_biblio({ itemtype => $itemtype->itemtype }); |
564 |
my $biblio_3 = $builder->build_sample_biblio({ itemtype => $itemtype->itemtype }); |
| 565 |
my ( undef, undef, $itemnumber_3 ) = AddItem( |
565 |
my ( undef, undef, $itemnumber_3 ) = AddItem( |
| 566 |
{ homebranch => $library->branchcode, |
566 |
{ homebranch => $library->branchcode, |
| 567 |
holdingbranch => $library->branchcode |
567 |
holdingbranch => $library->branchcode |