From 7b9277c1f0521f4c2c8e62849e373eca92bab169 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 --- 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 31528556393..23b664463d2 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 080e8fa4948..55435a586a8 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 @@ -689,6 +689,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.30.2