Lines 1617-1646
wildcards.
Link Here
|
1617 |
sub GetBranchBorrowerCircRule { |
1617 |
sub GetBranchBorrowerCircRule { |
1618 |
my ( $branchcode, $categorycode ) = @_; |
1618 |
my ( $branchcode, $categorycode ) = @_; |
1619 |
|
1619 |
|
1620 |
# Set search prededences |
|
|
1621 |
my @params = ( |
1622 |
{ |
1623 |
branchcode => $branchcode, |
1624 |
categorycode => $categorycode, |
1625 |
itemtype => undef, |
1626 |
}, |
1627 |
{ |
1628 |
branchcode => $branchcode, |
1629 |
categorycode => undef, |
1630 |
itemtype => undef, |
1631 |
}, |
1632 |
{ |
1633 |
branchcode => undef, |
1634 |
categorycode => $categorycode, |
1635 |
itemtype => undef, |
1636 |
}, |
1637 |
{ |
1638 |
branchcode => undef, |
1639 |
categorycode => undef, |
1640 |
itemtype => undef, |
1641 |
}, |
1642 |
); |
1643 |
|
1644 |
# Initialize default values |
1620 |
# Initialize default values |
1645 |
my $rules = { |
1621 |
my $rules = { |
1646 |
patron_maxissueqty => undef, |
1622 |
patron_maxissueqty => undef, |
Lines 1649-1667
sub GetBranchBorrowerCircRule {
Link Here
|
1649 |
|
1625 |
|
1650 |
# Search for rules! |
1626 |
# Search for rules! |
1651 |
foreach my $rule_name (qw( patron_maxissueqty patron_maxonsiteissueqty )) { |
1627 |
foreach my $rule_name (qw( patron_maxissueqty patron_maxonsiteissueqty )) { |
1652 |
foreach my $params (@params) { |
1628 |
my $rule = Koha::CirculationRules->get_effective_rule( |
1653 |
my $rule = Koha::CirculationRules->search( |
1629 |
{ |
1654 |
{ |
1630 |
categorycode => $categorycode, |
1655 |
rule_name => $rule_name, |
1631 |
itemtype => undef, |
1656 |
%$params, |
1632 |
branchcode => $branchcode, |
1657 |
} |
1633 |
rule_name => $rule_name, |
1658 |
)->next(); |
|
|
1659 |
|
1660 |
if ( $rule ) { |
1661 |
$rules->{$rule_name} = $rule->rule_value; |
1662 |
last; |
1663 |
} |
1634 |
} |
1664 |
} |
1635 |
); |
|
|
1636 |
|
1637 |
$rules->{$rule_name} = $rule->rule_value if defined $rule; |
1665 |
} |
1638 |
} |
1666 |
|
1639 |
|
1667 |
return $rules; |
1640 |
return $rules; |
1668 |
- |
|
|