From 6d5d204d0316aebe4399c741a0e086a9f3592e72 Mon Sep 17 00:00:00 2001 From: Aleisha Amohia Date: Mon, 8 Jan 2024 23:03:48 +0000 Subject: [PATCH] Bug 35728: Add RedirectToSoleResult system preference Signed-off-by: David Nind Signed-off-by: Nick Clemens Signed-off-by: Katrin Fischer --- ...g_35728_-_add_RedirectToSoleResult_syspref.pl | 16 ++++++++++++++++ installer/data/mysql/mandatory/sysprefs.sql | 1 + .../en/modules/admin/preferences/searching.pref | 7 +++++++ 3 files changed, 24 insertions(+) create mode 100755 installer/data/mysql/atomicupdate/bug_35728_-_add_RedirectToSoleResult_syspref.pl diff --git a/installer/data/mysql/atomicupdate/bug_35728_-_add_RedirectToSoleResult_syspref.pl b/installer/data/mysql/atomicupdate/bug_35728_-_add_RedirectToSoleResult_syspref.pl new file mode 100755 index 0000000000..1842403e1b --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_35728_-_add_RedirectToSoleResult_syspref.pl @@ -0,0 +1,16 @@ +use Modern::Perl; + +return { + bug_number => "35728", + description => "Add option to NOT redirect to result when search returns only one record", + up => sub { + my ($args) = @_; + my ( $dbh, $out ) = @$args{qw(dbh out)}; + + $dbh->do( + q{INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES ('RedirectToSoleResult', '1', NULL, 'When a catalog search via the staff interface or the OPAC returns only one record, redirect to the result.', 'YesNo') } + ); + + say $out "Added system preference 'RedirectToSoleResult'"; + }, +}; diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql index 8a4008a510..3a10bafffa 100644 --- a/installer/data/mysql/mandatory/sysprefs.sql +++ b/installer/data/mysql/mandatory/sysprefs.sql @@ -635,6 +635,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('RecordLocalUseOnReturn','0',NULL,'If ON, statistically record returns of unissued items as local use, instead of return','YesNo'), ('RecordStaffUserOnCheckout', '0', '', 'If enabled, when an item is checked out, the user who checked out the item is recorded', 'YesNo'), ('RedirectGuaranteeEmail', '0', NULL, 'Enable the ability to redirect guarantee email messages to guarantor.', 'YesNo'), +('RedirectToSoleResult', '1', NULL, 'When a catalog search via the staff interface or the OPAC returns only one record, redirect to the result.', 'YesNo'), ('Reference_NFL_Statuses','1|2',NULL,'Contains not for loan statuses considered as available for reference','Free'), ('RefundLostOnReturnControl','CheckinLibrary','CheckinLibrary|ItemHomeBranch|ItemHoldingBranch','If a lost item is returned, choose which branch to pick rules for refunding.','Choice'), ('RenewAccruingItemInOpac','0','','If enabled, when the fines on an item accruing is paid off in the OPAC via a payment plugin, attempt to renew that item. If the syspref "RenewalPeriodBase" is set to "due date", renewed items may still be overdue','YesNo'), diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref index 9fbc73653b..e0db164b91 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref @@ -338,6 +338,13 @@ Searching: 1: Show 0: "Don't show" - "whether an authority record contains an established heading that conforms to descriptive cataloguing rules, and can therefore be used as a main/added entry, or subject, or series title." + - + - pref: RedirectToSoleResult + choices: + 1: Redirect + 0: "Don't redirect" + - to the result if a catalog search via the OPAC or staff interface returns only one record. + Did you mean/spell checking: - - "Swedish service for spellchecking.
" -- 2.39.5