From cb565b3e76553b905838dbb88698a2183b8b0ff8 Mon Sep 17 00:00:00 2001 From: Alex Buckley Date: Wed, 24 Jul 2019 09:15:20 +0000 Subject: [PATCH] Bug 19378: Configure holds rules in onboarding tool At present the onboarding step 5 (Set up issuing rule) does not let you set a value for issuingrules.reservesallowed, issuingrules.holds_per_day, issuingrules.holds_per_record this patch adds that functionality so newly logged in users are able to reserve right after importing biblios. Test plan: 1. Drop and recreate your database 2. Go through the installer and onboarding tool and notice in the last page of the onboarding tool (where you set up issuing rules) there is no input for Reserves allowed, Holds per day or Holds per record 3. Submit the page and jump into the Koha database and run: SELECT reservesallowed, holds_per_day, holds_per_record from issuingrules; Notice all three fields are NULL 4. Apply this patch 5. Drop and create your database and restart memcached and plack 6. Go through the installer and onboarding tool and notice in the last onboarding tool page there is now three new number input fields: Reserves allowed, Holds per day and Holds per record 7. Keep the default values for these fields and submit the form 8. Repeat step 4 and notice reservesallowed, holds_per_day and holds_per_record are now all 10 9. Sign off Sponsored-By: Catalyst IT --- installer/onboarding.pl | 11 +++++++++++ .../prog/en/modules/onboarding/onboardingstep5.tt | 17 ++++++++++++++++- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/installer/onboarding.pl b/installer/onboarding.pl index 77aa120..502a2c2 100755 --- a/installer/onboarding.pl +++ b/installer/onboarding.pl @@ -247,6 +247,14 @@ if ( $step == 5 ) { $maxissueqty = undef if $maxissueqty !~ /^\d+/; $issuelength = $issuelength eq q{} ? undef : $issuelength; + # Bug 19378 - Set reservesallowed, holds_per_day, holds_per_record in onboarding tool + my $reservesallowed = $input->param('reservesallowed'); + my $holds_per_record = $input->param('holds_per_record'); + my $holds_per_day = $input->param('holds_per_day'); + + $holds_per_day =~ s/\s//g; + $holds_per_day = undef if $holds_per_day !~ /^\d+/; + my $params = { branchcode => $branchcode, categorycode => $categorycode, @@ -256,6 +264,9 @@ if ( $step == 5 ) { issuelength => $issuelength, lengthunit => $lengthunit, onshelfholds => $onshelfholds, + reservesallowed => $reservesallowed, + holds_per_record => $holds_per_record, + holds_per_day => $holds_per_day, }; my $issuingrule = Koha::IssuingRule->new($params); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep5.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep5.tt index b04013e..a5a9e99 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep5.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep5.tt @@ -118,6 +118,21 @@ +
  • + + + Required +
  • +
  • + + + Required +
  • +
  • + + + Required +
  • To create circulation rule, go to: @@ -139,4 +154,4 @@ [% END %] -[% INCLUDE 'installer-intranet-bottom.inc' %] \ No newline at end of file +[% INCLUDE 'installer-intranet-bottom.inc' %] -- 2.1.4