View | Details | Raw Unified | Return to bug 22284
Collapse All | Expand All

(-)a/Koha/Item.pm (-2 lines)
Lines 298-305 sub pickup_locations { Link Here
298
    my $branch_control = C4::Context->preference('HomeOrHoldingBranch');
298
    my $branch_control = C4::Context->preference('HomeOrHoldingBranch');
299
    my $library = $branch_control eq 'holdingbranch' ? $self->holding_branch : $self->home_branch;
299
    my $library = $branch_control eq 'holdingbranch' ? $self->holding_branch : $self->home_branch;
300
300
301
    #warn $branch_control.' '.$branchitemrule->{holdallowed}.' '.$library->branchcode.' '.$patron->branchcode;
302
303
    my @libs;
301
    my @libs;
304
    if(defined $patron) {
302
    if(defined $patron) {
305
        return @libs if $branchitemrule->{holdallowed} == 3 && !$library->validate_hold_sibling( {branchcode => $patron->branchcode} );
303
        return @libs if $branchitemrule->{holdallowed} == 3 && !$library->validate_hold_sibling( {branchcode => $patron->branchcode} );
(-)a/t/db_dependent/Holds.t (+10 lines)
Lines 245-251 is( $hold->priority, '6', "Test AlterPriority(), move to bottom" ); Link Here
245
my $foreign_biblio = $builder->build_sample_biblio({ itemtype => 'DUMMY' });
245
my $foreign_biblio = $builder->build_sample_biblio({ itemtype => 'DUMMY' });
246
my ($foreign_item_bibnum, $foreign_item_bibitemnum, $foreign_itemnumber)
246
my ($foreign_item_bibnum, $foreign_item_bibitemnum, $foreign_itemnumber)
247
  = AddItem({ homebranch => $branch_2, holdingbranch => $branch_2 } , $foreign_biblio->biblionumber);
247
  = AddItem({ homebranch => $branch_2, holdingbranch => $branch_2 } , $foreign_biblio->biblionumber);
248
# Cleanup circulation rules
248
$dbh->do('DELETE FROM issuingrules');
249
$dbh->do('DELETE FROM issuingrules');
250
$dbh->do('DELETE FROM branch_item_rules');
251
$dbh->do('DELETE FROM default_branch_item_rules');
252
$dbh->do('DELETE FROM default_branch_circ_rules');
253
$dbh->do('DELETE FROM default_circ_rules');
249
$dbh->do(
254
$dbh->do(
250
    q{INSERT INTO issuingrules (categorycode, branchcode, itemtype, reservesallowed, holds_per_record)
255
    q{INSERT INTO issuingrules (categorycode, branchcode, itemtype, reservesallowed, holds_per_record)
251
      VALUES (?, ?, ?, ?, ?)},
256
      VALUES (?, ?, ?, ?, ?)},
Lines 550-555 subtest 'CanItemBeReserved / holds_per_day tests' => sub { Link Here
550
555
551
    Koha::Holds->search->delete;
556
    Koha::Holds->search->delete;
552
    $dbh->do('DELETE FROM issues');
557
    $dbh->do('DELETE FROM issues');
558
    $dbh->do('DELETE FROM issuingrules');
559
    $dbh->do('DELETE FROM branch_item_rules');
560
    $dbh->do('DELETE FROM default_branch_item_rules');
561
    $dbh->do('DELETE FROM default_branch_circ_rules');
562
    $dbh->do('DELETE FROM default_circ_rules');
553
    Koha::Items->search->delete;
563
    Koha::Items->search->delete;
554
    Koha::Biblios->search->delete;
564
    Koha::Biblios->search->delete;
555
565
(-)a/t/db_dependent/Reserves.t (-13 / +12 lines)
Lines 55-60 my $builder = t::lib::TestBuilder->new; Link Here
55
55
56
my $frameworkcode = q//;
56
my $frameworkcode = q//;
57
57
58
# Cleanup circulation rules
59
$dbh->do('DELETE FROM issuingrules');
60
$dbh->do('DELETE FROM branch_item_rules');
61
$dbh->do('DELETE FROM default_branch_item_rules');
62
$dbh->do('DELETE FROM default_branch_circ_rules');
63
$dbh->do('DELETE FROM default_circ_rules');
64
$dbh->do(
65
    q{INSERT INTO issuingrules (categorycode, branchcode, itemtype, reservesallowed)
66
      VALUES (?, ?, ?, ?)},
67
    {},
68
    '*', '*', '*', 25
69
);
58
70
59
t::lib::Mocks::mock_preference('ReservesNeedReturns', 1);
71
t::lib::Mocks::mock_preference('ReservesNeedReturns', 1);
60
72
Lines 187-204 $requesters{$branch_3} = Koha::Patron->new({ Link Here
187
# to request its items, while $branch_2 will allow its items
199
# to request its items, while $branch_2 will allow its items
188
# to fill holds from anywhere.
200
# to fill holds from anywhere.
189
201
190
$dbh->do('DELETE FROM issuingrules');
191
$dbh->do('DELETE FROM branch_item_rules');
192
$dbh->do('DELETE FROM default_branch_item_rules');
193
$dbh->do('DELETE FROM default_branch_circ_rules');
194
$dbh->do('DELETE FROM default_circ_rules');
195
$dbh->do(
196
    q{INSERT INTO issuingrules (categorycode, branchcode, itemtype, reservesallowed)
197
      VALUES (?, ?, ?, ?)},
198
    {},
199
    '*', '*', '*', 25
200
);
201
202
# CPL allows only its own patrons to request its items
202
# CPL allows only its own patrons to request its items
203
$dbh->do(
203
$dbh->do(
204
    q{INSERT INTO default_branch_circ_rules (branchcode, holdallowed, returnbranch)
204
    q{INSERT INTO default_branch_circ_rules (branchcode, holdallowed, returnbranch)
205
- 

Return to bug 22284