From f16fe67426b1cc3992241b646f27c2df5196cff9 Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Fri, 26 Jan 2024 18:43:06 +0000 Subject: [PATCH] Bug 23208: Add ability to set a default hold ratio value To test: 1. APPLY PATCH, updatedatebase, restart_all 2. Search for the system preference 'HoldRatioDefault'. 3. It should be set to 3. Change the value to something else. 4. Load the report at 'circ/reserveratios.pl'. Circulation > Hold ratios 5. The default value should be the value you set in the new system preference. 6. Run the report with the default value and make sure it works. 7. Change the value and run the report. The new value should be retained. 8. Leave the page and come back. Again the default value from the new system preference should be set. Signed-off-by: Andrew Fuerste Henry Signed-off-by: Emily Lamancusa Signed-off-by: Katrin Fischer --- circ/reserveratios.pl | 2 +- .../prog/en/modules/admin/preferences/circulation.pref | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/circ/reserveratios.pl b/circ/reserveratios.pl index 3152855639..23b664463d 100755 --- a/circ/reserveratios.pl +++ b/circ/reserveratios.pl @@ -69,7 +69,7 @@ $enddate = $todaysdate unless $enddate; $startdate = $todaysdate->clone->subtract( years => 1 ) unless $startdate; if (!defined($ratio)) { - $ratio = 3; + $ratio = C4::Context->preference('HoldRatioDefault'); } # Force to be a number $ratio += 0; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref index b9169b203f..118d6dcd9c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref @@ -695,6 +695,11 @@ Circulation: 0: "Don't store" - 'the last patron to return an item. This setting is independent of the opacreadinghistory and AnonymousPatron system preferences.' Holds policy: + - + - Default the holds ratio report to + - pref: HoldRatioDefault + class: integer + - "." - - In the staff interface, split the holds queue into separate tables by - pref: HoldsSplitQueue -- 2.39.5