@@ -, +, @@ page tests: $ koha-mysql kohadev > SELECT * FROM circulation_rules \ WHERE rule_name='article_request_fee'; --- Koha/CirculationRules.pm | 3 + admin/smart-rules.pl | 27 ++++++++ .../prog/en/modules/admin/smart-rules.tt | 69 ++++++++++++++++++- 3 files changed, 98 insertions(+), 1 deletion(-) --- a/Koha/CirculationRules.pm +++ a/Koha/CirculationRules.pm @@ -76,6 +76,9 @@ our $RULE_KINDS = { article_requests => { scope => [ 'branchcode', 'categorycode', 'itemtype' ], }, + article_request_fee => { + scope => [ 'branchcode', 'categorycode' ], + }, open_article_requests_limit => { scope => [ 'branchcode', 'categorycode' ], }, --- a/admin/smart-rules.pl +++ a/admin/smart-rules.pl @@ -531,6 +531,33 @@ elsif ( $op eq "add-open-article-requests-limit" ) { ); } } +elsif ( $op eq "set-article-request-fee" ) { + + my $category = $input->param('article_request_fee_category'); + my $fee = strip_non_numeric( scalar $input->param('article_request_fee') ); + + Koha::Exceptions::Exception->throw("No value passed for article request fee") + if not defined $fee # There is a JS check for that + || $fee eq ''; + + Koha::CirculationRules->set_rules( + { categorycode => ( $category eq '*' ) ? undef : $category, + branchcode => ( $branch eq '*' ) ? undef : $branch, + rules => { article_request_fee => $fee }, + } + ); + +} elsif ( $op eq 'del-article-request-fee' ) { + + my $category = $input->param('article_request_fee_category'); + + Koha::CirculationRules->set_rules( + { categorycode => ( $category eq '*' ) ? undef : $category, + branchcode => ( $branch eq '*' ) ? undef : $branch, + rules => { article_request_fee => undef }, + } + ); +} elsif ($op eq "add-branch-item") { my $itemtype = $input->param('itemtype'); my $holdallowed = $input->param('holdallowed'); --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt @@ -787,7 +787,7 @@ [% END %] - [% IF Koha.Preference('ArticleRequests') %] +[% IF Koha.Preference('ArticleRequests') %]
Specify the article request fee for a given patron category.
+ +