From 648d581b655f07d0cca9bbdc0f31480917096702 Mon Sep 17 00:00:00 2001 From: Pedro Amorim Date: Thu, 10 Aug 2023 15:44:05 +0000 Subject: [PATCH] Bug 25393: Add new noautorenewalbefore circulation rule Signed-off-by: Andrew Fuerste-Henry Signed-off-by: Nick Clemens Signed-off-by: Tomas Cohen Arazi --- Koha/CirculationRules.pm | 3 +++ admin/smart-rules.pl | 4 ++++ installer/onboarding.pl | 1 + .../intranet-tmpl/prog/en/modules/admin/smart-rules.tt | 7 ++++++- 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/Koha/CirculationRules.pm b/Koha/CirculationRules.pm index c29b83d041..6f76053ae7 100644 --- a/Koha/CirculationRules.pm +++ b/Koha/CirculationRules.pm @@ -155,6 +155,9 @@ our $RULE_KINDS = { norenewalbefore => { scope => [ 'branchcode', 'categorycode', 'itemtype' ], }, + noautorenewalbefore => { + scope => [ 'branchcode', 'categorycode', 'itemtype' ], + }, onshelfholds => { scope => [ 'branchcode', 'categorycode', 'itemtype' ], }, diff --git a/admin/smart-rules.pl b/admin/smart-rules.pl index d073bda5d5..68d28c321e 100755 --- a/admin/smart-rules.pl +++ b/admin/smart-rules.pl @@ -96,6 +96,7 @@ if ($op eq 'delete') { unseen_renewals_allowed => undef, renewalperiod => undef, norenewalbefore => undef, + noautorenewalbefore => undef, auto_renew => undef, no_auto_renewal_after => undef, no_auto_renewal_after_hard_limit => undef, @@ -268,6 +269,8 @@ elsif ($op eq 'add') { my $renewalperiod = $input->param('renewalperiod'); my $norenewalbefore = $input->param('norenewalbefore'); $norenewalbefore = q{} if $norenewalbefore =~ /^\s*$/; + my $noautorenewalbefore = $input->param('noautorenewalbefore'); + $noautorenewalbefore = q{} if $noautorenewalbefore =~ /^\s*$/; my $auto_renew = $input->param('auto_renew') eq 'yes' ? 1 : 0; my $no_auto_renewal_after = $input->param('no_auto_renewal_after'); $no_auto_renewal_after = q{} if $no_auto_renewal_after =~ /^\s*$/; @@ -316,6 +319,7 @@ elsif ($op eq 'add') { unseen_renewals_allowed => $unseen_renewals_allowed, renewalperiod => $renewalperiod, norenewalbefore => $norenewalbefore, + noautorenewalbefore => $noautorenewalbefore, auto_renew => $auto_renew, no_auto_renewal_after => $no_auto_renewal_after, no_auto_renewal_after_hard_limit => $no_auto_renewal_after_hard_limit, diff --git a/installer/onboarding.pl b/installer/onboarding.pl index 457f1fe278..d429f01c36 100755 --- a/installer/onboarding.pl +++ b/installer/onboarding.pl @@ -273,6 +273,7 @@ if ( $step == 5 ) { no_auto_renewal_after => "", no_auto_renewal_after_hard_limit => "", norenewalbefore => "", + noautorenewalbefore => "", opacitemholds => "N", overduefinescap => "", rentaldiscount => 0, diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt index c17d1e7687..a5fa1e63c5 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt @@ -137,6 +137,7 @@ [% END %] Renewal period No renewal before + No automatic renewal before Automatic renewal No automatic renewal after No automatic renewal after (hard limit) @@ -187,6 +188,7 @@ [% SET unseenrenewalsallowed = all_rules.$c.$i.unseen_renewals_allowed %] [% SET renewalperiod = all_rules.$c.$i.renewalperiod %] [% SET norenewalbefore = all_rules.$c.$i.norenewalbefore %] + [% SET noautorenewalbefore = all_rules.$c.$i.noautorenewalbefore %] [% SET auto_renew = all_rules.$c.$i.auto_renew %] [% SET no_auto_renewal_after = all_rules.$c.$i.no_auto_renewal_after %] [% SET no_auto_renewal_after_hard_limit = all_rules.$c.$i.no_auto_renewal_after_hard_limit %] @@ -205,7 +207,7 @@ [% SET recall_overdue_fine = all_rules.$c.$i.recall_overdue_fine %] [% SET recall_shelf_time = all_rules.$c.$i.recall_shelf_time %] - [% SET show_rule = note || maxissueqty || maxonsiteissueqty || issuelength || daysmode || lengthunit || hardduedate || hardduedatecompare || fine || chargeperiod || chargeperiod_charge_at || firstremind || overduefinescap || cap_fine_to_replacement_price || finedays || maxsuspensiondays || suspension_chargeperiod || renewalsallowed || unseenrenewalsallowed || renewalperiod || norenewalbefore || auto_renew || no_auto_renewal_after || no_auto_renewal_after_hard_limit || reservesallowed || holds_per_day || holds_per_record || onshelfholds || opacitemholds || article_requests || rentaldiscount || decreaseloanholds || recalls_allowed || recalls_per_record || on_shelf_recalls || recall_due_date_interval || recall_overdue_fine || recall_shelf_time %] + [% SET show_rule = note || maxissueqty || maxonsiteissueqty || issuelength || daysmode || lengthunit || hardduedate || hardduedatecompare || fine || chargeperiod || chargeperiod_charge_at || firstremind || overduefinescap || cap_fine_to_replacement_price || finedays || maxsuspensiondays || suspension_chargeperiod || renewalsallowed || unseenrenewalsallowed || renewalperiod || norenewalbefore || noautorenewalbefore || auto_renew || no_auto_renewal_after || no_auto_renewal_after_hard_limit || reservesallowed || holds_per_day || holds_per_record || onshelfholds || opacitemholds || article_requests || rentaldiscount || decreaseloanholds || recalls_allowed || recalls_per_record || on_shelf_recalls || recall_due_date_interval || recall_overdue_fine || recall_shelf_time %] [% IF show_rule %] [% SET row_count = row_count + 1 %] @@ -319,6 +321,7 @@ [% END %] [% renewalperiod | html %] [% norenewalbefore | html %] + [% noautorenewalbefore | html %] [% IF auto_renew %] Yes @@ -487,6 +490,7 @@ [% END %] +