|
Lines 235-250
my ($foreign_item_bibnum, $foreign_item_bibitemnum, $foreign_itemnumber)
Link Here
|
| 235 |
= AddItem({ homebranch => $branch_2, holdingbranch => $branch_2 } , $foreign_bibnum); |
235 |
= AddItem({ homebranch => $branch_2, holdingbranch => $branch_2 } , $foreign_bibnum); |
| 236 |
$dbh->do('DELETE FROM issuingrules'); |
236 |
$dbh->do('DELETE FROM issuingrules'); |
| 237 |
$dbh->do( |
237 |
$dbh->do( |
| 238 |
q{INSERT INTO issuingrules (categorycode, branchcode, itemtype, reservesallowed) |
238 |
q{INSERT INTO issuingrules (categorycode, branchcode, itemtype, reservesallowed, holds_per_record) |
| 239 |
VALUES (?, ?, ?, ?)}, |
239 |
VALUES (?, ?, ?, ?, ?)}, |
| 240 |
{}, |
240 |
{}, |
| 241 |
'*', '*', '*', 25 |
241 |
'*', '*', '*', 25, 99 |
| 242 |
); |
242 |
); |
| 243 |
$dbh->do( |
243 |
$dbh->do( |
| 244 |
q{INSERT INTO issuingrules (categorycode, branchcode, itemtype, reservesallowed) |
244 |
q{INSERT INTO issuingrules (categorycode, branchcode, itemtype, reservesallowed, holds_per_record) |
| 245 |
VALUES (?, ?, ?, ?)}, |
245 |
VALUES (?, ?, ?, ?, ?)}, |
| 246 |
{}, |
246 |
{}, |
| 247 |
'*', '*', 'CANNOT', 0 |
247 |
'*', '*', 'CANNOT', 0, 99 |
| 248 |
); |
248 |
); |
| 249 |
|
249 |
|
| 250 |
# make sure some basic sysprefs are set |
250 |
# make sure some basic sysprefs are set |
|
Lines 335-341
is( $reserve3->{priority}, 1, "After ModReserve, the 3rd reserve becomes the fir
Link Here
|
| 335 |
|
335 |
|
| 336 |
ModItem({ damaged => 1 }, $item_bibnum, $itemnumber); |
336 |
ModItem({ damaged => 1 }, $item_bibnum, $itemnumber); |
| 337 |
t::lib::Mocks::mock_preference( 'AllowHoldsOnDamagedItems', 1 ); |
337 |
t::lib::Mocks::mock_preference( 'AllowHoldsOnDamagedItems', 1 ); |
| 338 |
ok( CanItemBeReserved( $borrowernumbers[0], $itemnumber) eq 'OK', "Patron can reserve damaged item with AllowHoldsOnDamagedItems enabled" ); |
338 |
is( CanItemBeReserved( $borrowernumbers[0], $itemnumber), 'OK', "Patron can reserve damaged item with AllowHoldsOnDamagedItems enabled" ); |
| 339 |
ok( defined( ( CheckReserves($itemnumber) )[1] ), "Hold can be trapped for damaged item with AllowHoldsOnDamagedItems enabled" ); |
339 |
ok( defined( ( CheckReserves($itemnumber) )[1] ), "Hold can be trapped for damaged item with AllowHoldsOnDamagedItems enabled" ); |
| 340 |
t::lib::Mocks::mock_preference( 'AllowHoldsOnDamagedItems', 0 ); |
340 |
t::lib::Mocks::mock_preference( 'AllowHoldsOnDamagedItems', 0 ); |
| 341 |
ok( CanItemBeReserved( $borrowernumbers[0], $itemnumber) eq 'damaged', "Patron cannot reserve damaged item with AllowHoldsOnDamagedItems disabled" ); |
341 |
ok( CanItemBeReserved( $borrowernumbers[0], $itemnumber) eq 'damaged', "Patron cannot reserve damaged item with AllowHoldsOnDamagedItems disabled" ); |
|
Lines 351-358
AddReserve(
Link Here
|
| 351 |
'', |
351 |
'', |
| 352 |
1, |
352 |
1, |
| 353 |
); |
353 |
); |
| 354 |
ok( |
354 |
is( |
| 355 |
CanItemBeReserved( $borrowernumbers[0], $itemnumber) eq 'tooManyReserves', |
355 |
CanItemBeReserved( $borrowernumbers[0], $itemnumber), 'tooManyReserves', |
| 356 |
"cannot request item if policy that matches on item-level item type forbids it" |
356 |
"cannot request item if policy that matches on item-level item type forbids it" |
| 357 |
); |
357 |
); |
| 358 |
ModItem({ itype => 'CAN' }, $item_bibnum, $itemnumber); |
358 |
ModItem({ itype => 'CAN' }, $item_bibnum, $itemnumber); |
|
Lines 458-467
$dbh->do('DELETE FROM biblio');
Link Here
|
| 458 |
= AddItem( { homebranch => $branch_1, holdingbranch => $branch_1 }, $bibnum ); |
458 |
= AddItem( { homebranch => $branch_1, holdingbranch => $branch_1 }, $bibnum ); |
| 459 |
|
459 |
|
| 460 |
$dbh->do( |
460 |
$dbh->do( |
| 461 |
q{INSERT INTO issuingrules (categorycode, branchcode, itemtype, reservesallowed) |
461 |
q{INSERT INTO issuingrules (categorycode, branchcode, itemtype, reservesallowed, holds_per_record) |
| 462 |
VALUES (?, ?, ?, ?)}, |
462 |
VALUES (?, ?, ?, ?, ?)}, |
| 463 |
{}, |
463 |
{}, |
| 464 |
'*', '*', 'ONLY1', 1 |
464 |
'*', '*', 'ONLY1', 1, 99 |
| 465 |
); |
465 |
); |
| 466 |
is( CanItemBeReserved( $borrowernumbers[0], $itemnumber ), |
466 |
is( CanItemBeReserved( $borrowernumbers[0], $itemnumber ), |
| 467 |
'OK', 'Patron can reserve item with hold limit of 1, no holds placed' ); |
467 |
'OK', 'Patron can reserve item with hold limit of 1, no holds placed' ); |