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