From 446018dfdd18acf6e1e76a80fde21e0f8c14a7f4 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 --- ...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 00000000000..1842403e1bd --- /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 b58114d802e..6b44249cd0b 100644 --- a/installer/data/mysql/mandatory/sysprefs.sql +++ b/installer/data/mysql/mandatory/sysprefs.sql @@ -615,6 +615,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'), ('Reference_NFL_Statuses','1|2',NULL,'Contains not for loan statuses considered as available for reference','Free'), ('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'), ('RefundLostOnReturnControl','CheckinLibrary','CheckinLibrary|ItemHomeBranch|ItemHoldingBranch','If a lost item is returned, choose which branch to pick rules for refunding.','Choice'), ('RenewAccruingItemWhenPaid','0','','If enabled, when the fines on an item accruing is paid off, attempt to renew that item. If the syspref "RenewalPeriodBase" is set to "due date", renewed items may still be overdue','YesNo'), ('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 b06c6621bf5..2da876b903e 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 @@ -333,6 +333,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.30.2