Lines 1845-1883
sub GetBranchItemRule {
Link Here
|
1845 |
my ( $branchcode, $itemtype ) = @_; |
1845 |
my ( $branchcode, $itemtype ) = @_; |
1846 |
|
1846 |
|
1847 |
# Search for rules! |
1847 |
# Search for rules! |
1848 |
my $holdallowed_rule = Koha::CirculationRules->get_effective_rule( |
1848 |
my $rules = Koha::CirculationRules->get_effective_rules({ |
1849 |
{ |
1849 |
branchcode => $branchcode, |
1850 |
branchcode => $branchcode, |
1850 |
itemtype => $itemtype, |
1851 |
itemtype => $itemtype, |
1851 |
rules => ['holdallowed', 'hold_fulfillment_policy', 'returnbranch'] |
1852 |
rule_name => 'holdallowed', |
1852 |
}); |
1853 |
} |
|
|
1854 |
); |
1855 |
my $hold_fulfillment_policy_rule = Koha::CirculationRules->get_effective_rule( |
1856 |
{ |
1857 |
branchcode => $branchcode, |
1858 |
itemtype => $itemtype, |
1859 |
rule_name => 'hold_fulfillment_policy', |
1860 |
} |
1861 |
); |
1862 |
my $returnbranch_rule = Koha::CirculationRules->get_effective_rule( |
1863 |
{ |
1864 |
branchcode => $branchcode, |
1865 |
itemtype => $itemtype, |
1866 |
rule_name => 'returnbranch', |
1867 |
} |
1868 |
); |
1869 |
|
1853 |
|
1870 |
# built-in default circulation rule |
1854 |
# built-in default circulation rule |
1871 |
my $rules; |
1855 |
$rules->{holdallowed} //= 'from_any_library'; |
1872 |
$rules->{holdallowed} = defined $holdallowed_rule |
1856 |
$rules->{hold_fulfillment_policy} //= 'any'; |
1873 |
? $holdallowed_rule->rule_value |
1857 |
$rules->{returnbranch} //= 'homebranch'; |
1874 |
: 'from_any_library'; |
|
|
1875 |
$rules->{hold_fulfillment_policy} = defined $hold_fulfillment_policy_rule |
1876 |
? $hold_fulfillment_policy_rule->rule_value |
1877 |
: 'any'; |
1878 |
$rules->{returnbranch} = defined $returnbranch_rule |
1879 |
? $returnbranch_rule->rule_value |
1880 |
: 'homebranch'; |
1881 |
|
1858 |
|
1882 |
return $rules; |
1859 |
return $rules; |
1883 |
} |
1860 |
} |
1884 |
- |
|
|