|
Lines 2-8
Link Here
|
| 2 |
|
2 |
|
| 3 |
use Modern::Perl; |
3 |
use Modern::Perl; |
| 4 |
|
4 |
|
| 5 |
use Test::More tests => 8; |
5 |
use Test::More tests => 11; |
| 6 |
use MARC::Record; |
6 |
use MARC::Record; |
| 7 |
|
7 |
|
| 8 |
use C4::Branch; |
8 |
use C4::Branch; |
|
Lines 29-34
my $title = 'Silence in the library';
Link Here
|
| 29 |
$bib->append_fields( |
29 |
$bib->append_fields( |
| 30 |
MARC::Field->new('100', ' ', ' ', a => 'Moffat, Steven'), |
30 |
MARC::Field->new('100', ' ', ' ', a => 'Moffat, Steven'), |
| 31 |
MARC::Field->new('245', ' ', ' ', a => $title), |
31 |
MARC::Field->new('245', ' ', ' ', a => $title), |
|
|
32 |
MARC::Field->new('300', ' ', ' ', a => '2 vols.'), |
| 32 |
); |
33 |
); |
| 33 |
my ($bibnum, $bibitemnum); |
34 |
my ($bibnum, $bibitemnum); |
| 34 |
($bibnum, $title, $bibitemnum) = AddBiblio($bib, ''); |
35 |
($bibnum, $title, $bibitemnum) = AddBiblio($bib, ''); |
|
Lines 61-70
my $notes = '';
Link Here
|
| 61 |
my $checkitem = undef; |
62 |
my $checkitem = undef; |
| 62 |
my $found = undef; |
63 |
my $found = undef; |
| 63 |
|
64 |
|
| 64 |
my @branches = GetBranchesLoop(); |
65 |
AddReserve('CPL', $borrowernumber, $biblionumber, |
| 65 |
my $branch = $branches[0][0]{value}; |
|
|
| 66 |
|
| 67 |
AddReserve($branch, $borrowernumber, $biblionumber, |
| 68 |
$constraint, $bibitems, $priority, $resdate, $expdate, $notes, |
66 |
$constraint, $bibitems, $priority, $resdate, $expdate, $notes, |
| 69 |
$title, $checkitem, $found); |
67 |
$title, $checkitem, $found); |
| 70 |
|
68 |
|
|
Lines 199-201
is( $messages->{ResFound}->{borrowernumber},
Link Here
|
| 199 |
is( $messages->{ResFound}->{borrowernumber}, |
197 |
is( $messages->{ResFound}->{borrowernumber}, |
| 200 |
$requesters{'RPL'}, |
198 |
$requesters{'RPL'}, |
| 201 |
'for generous library, its items fill first hold request in line (bug 10272)'); |
199 |
'for generous library, its items fill first hold request in line (bug 10272)'); |
| 202 |
- |
200 |
|
|
|
201 |
#tests for mandatory hold notes |
| 202 |
C4::Context->set_preference('OPACHoldNotes', 1); |
| 203 |
C4::Context->set_preference('OPACMandatoryHoldNotes', '1&2'); |
| 204 |
|
| 205 |
my $record=GetMarcBiblio($bibnum); |
| 206 |
|
| 207 |
my $retval= C4::Reserves::GetMandatoryNoteReason($bibnum,$record); |
| 208 |
is($retval, 1, "Mandatory hold notes test 1"); |
| 209 |
|
| 210 |
C4::Context->set_preference('OPACMandatoryHoldNotes', '4'); |
| 211 |
$retval= C4::Reserves::GetMandatoryNoteReason($bibnum,$record); |
| 212 |
is($retval, 0, "Mandatory hold notes test 2"); |
| 213 |
|
| 214 |
C4::Context->set_preference('OPACMandatoryHoldNotes', '1&2'); |
| 215 |
C4::Context->set_preference('OPACHoldNotes', 0); |
| 216 |
$retval= C4::Reserves::GetMandatoryNoteReason($bibnum,$record); |
| 217 |
is($retval, 0, "Mandatory hold notes test 3"); |
| 218 |
#end of mandatory hold notes tests |
| 219 |
|
| 220 |
$dbh->rollback; |