|
Lines 241-256
my ($foreign_item_bibnum, $foreign_item_bibitemnum, $foreign_itemnumber)
Link Here
|
| 241 |
= AddItem({ homebranch => $branch_2, holdingbranch => $branch_2 } , $foreign_bibnum); |
241 |
= AddItem({ homebranch => $branch_2, holdingbranch => $branch_2 } , $foreign_bibnum); |
| 242 |
$dbh->do('DELETE FROM issuingrules'); |
242 |
$dbh->do('DELETE FROM issuingrules'); |
| 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 |
'*', '*', '*', 25 |
247 |
'*', '*', '*', 25, 99 |
| 248 |
); |
248 |
); |
| 249 |
$dbh->do( |
249 |
$dbh->do( |
| 250 |
q{INSERT INTO issuingrules (categorycode, branchcode, itemtype, reservesallowed) |
250 |
q{INSERT INTO issuingrules (categorycode, branchcode, itemtype, reservesallowed, holds_per_record) |
| 251 |
VALUES (?, ?, ?, ?)}, |
251 |
VALUES (?, ?, ?, ?, ?)}, |
| 252 |
{}, |
252 |
{}, |
| 253 |
'*', '*', 'CANNOT', 0 |
253 |
'*', '*', 'CANNOT', 0, 99 |
| 254 |
); |
254 |
); |
| 255 |
|
255 |
|
| 256 |
# make sure some basic sysprefs are set |
256 |
# make sure some basic sysprefs are set |
|
Lines 341-347
is( $reserve3->{priority}, 1, "After ModReserve, the 3rd reserve becomes the fir
Link Here
|
| 341 |
|
341 |
|
| 342 |
ModItem({ damaged => 1 }, $item_bibnum, $itemnumber); |
342 |
ModItem({ damaged => 1 }, $item_bibnum, $itemnumber); |
| 343 |
t::lib::Mocks::mock_preference( 'AllowHoldsOnDamagedItems', 1 ); |
343 |
t::lib::Mocks::mock_preference( 'AllowHoldsOnDamagedItems', 1 ); |
| 344 |
ok( CanItemBeReserved( $borrowernumbers[0], $itemnumber) eq 'OK', "Patron can reserve damaged item with AllowHoldsOnDamagedItems enabled" ); |
344 |
is( CanItemBeReserved( $borrowernumbers[0], $itemnumber), 'OK', "Patron can reserve damaged item with AllowHoldsOnDamagedItems enabled" ); |
| 345 |
ok( defined( ( CheckReserves($itemnumber) )[1] ), "Hold can be trapped for damaged item with AllowHoldsOnDamagedItems enabled" ); |
345 |
ok( defined( ( CheckReserves($itemnumber) )[1] ), "Hold can be trapped for damaged item with AllowHoldsOnDamagedItems enabled" ); |
| 346 |
t::lib::Mocks::mock_preference( 'AllowHoldsOnDamagedItems', 0 ); |
346 |
t::lib::Mocks::mock_preference( 'AllowHoldsOnDamagedItems', 0 ); |
| 347 |
ok( CanItemBeReserved( $borrowernumbers[0], $itemnumber) eq 'damaged', "Patron cannot reserve damaged item with AllowHoldsOnDamagedItems disabled" ); |
347 |
ok( CanItemBeReserved( $borrowernumbers[0], $itemnumber) eq 'damaged', "Patron cannot reserve damaged item with AllowHoldsOnDamagedItems disabled" ); |
|
Lines 357-364
AddReserve(
Link Here
|
| 357 |
'', |
357 |
'', |
| 358 |
1, |
358 |
1, |
| 359 |
); |
359 |
); |
| 360 |
ok( |
360 |
is( |
| 361 |
CanItemBeReserved( $borrowernumbers[0], $itemnumber) eq 'tooManyReserves', |
361 |
CanItemBeReserved( $borrowernumbers[0], $itemnumber), 'tooManyReserves', |
| 362 |
"cannot request item if policy that matches on item-level item type forbids it" |
362 |
"cannot request item if policy that matches on item-level item type forbids it" |
| 363 |
); |
363 |
); |
| 364 |
ModItem({ itype => 'CAN' }, $item_bibnum, $itemnumber); |
364 |
ModItem({ itype => 'CAN' }, $item_bibnum, $itemnumber); |
|
Lines 464-473
$dbh->do('DELETE FROM biblio');
Link Here
|
| 464 |
= AddItem( { homebranch => $branch_1, holdingbranch => $branch_1 }, $bibnum ); |
464 |
= AddItem( { homebranch => $branch_1, holdingbranch => $branch_1 }, $bibnum ); |
| 465 |
|
465 |
|
| 466 |
$dbh->do( |
466 |
$dbh->do( |
| 467 |
q{INSERT INTO issuingrules (categorycode, branchcode, itemtype, reservesallowed) |
467 |
q{INSERT INTO issuingrules (categorycode, branchcode, itemtype, reservesallowed, holds_per_record) |
| 468 |
VALUES (?, ?, ?, ?)}, |
468 |
VALUES (?, ?, ?, ?, ?)}, |
| 469 |
{}, |
469 |
{}, |
| 470 |
'*', '*', 'ONLY1', 1 |
470 |
'*', '*', 'ONLY1', 1, 99 |
| 471 |
); |
471 |
); |
| 472 |
is( CanItemBeReserved( $borrowernumbers[0], $itemnumber ), |
472 |
is( CanItemBeReserved( $borrowernumbers[0], $itemnumber ), |
| 473 |
'OK', 'Patron can reserve item with hold limit of 1, no holds placed' ); |
473 |
'OK', 'Patron can reserve item with hold limit of 1, no holds placed' ); |