From af7f66ee48cac70791b2c7dce437c1eb3384538a Mon Sep 17 00:00:00 2001 From: Aleisha Amohia Date: Tue, 21 Apr 2020 11:48:06 +0000 Subject: [PATCH] Bug 21249: (follow-up) Fixing syspref name, description, get working with OPAC masthead search Syspref is now called SearchLimitLibrary, and the description better explains what the feature does. It works with the advanced search on the staff client and OPAC, and the masthead search on the OPAC when OpacAddMastheadLibraryPulldown is enabled. Sponsored-by: Catalyst IT --- catalogue/search.pl | 2 +- .../bug_21249-Branch_to_limit_advanced_search_results.sql | 1 - .../bug_21249-add_SearchLimitLibrary_syspref.perl | 6 ++++++ installer/data/mysql/sysprefs.sql | 1 + .../prog/en/modules/admin/preferences/searching.pref | 11 +++++------ opac/opac-search.pl | 7 +++---- 6 files changed, 16 insertions(+), 12 deletions(-) delete mode 100644 installer/data/mysql/atomicupdate/bug_21249-Branch_to_limit_advanced_search_results.sql create mode 100644 installer/data/mysql/atomicupdate/bug_21249-add_SearchLimitLibrary_syspref.perl diff --git a/catalogue/search.pl b/catalogue/search.pl index eecfec07128..fa1dade10f1 100755 --- a/catalogue/search.pl +++ b/catalogue/search.pl @@ -421,7 +421,7 @@ my %is_nolimit = map { $_ => 1 } @nolimits; @limits = grep { not $is_nolimit{$_} } @limits; if ( $params->{'multibranchlimit'} ) { - my $branchfield = C4::Context->preference('AdvancedSearchBranchFieldToUse'); + my $branchfield = C4::Context->preference('SearchLimitLibrary'); my $search_group = Koha::Library::Groups->find( $params->{multibranchlimit} ); my @branchcodes = map { $_->branchcode } $search_group->all_libraries; diff --git a/installer/data/mysql/atomicupdate/bug_21249-Branch_to_limit_advanced_search_results.sql b/installer/data/mysql/atomicupdate/bug_21249-Branch_to_limit_advanced_search_results.sql deleted file mode 100644 index 6d6aa048087..00000000000 --- a/installer/data/mysql/atomicupdate/bug_21249-Branch_to_limit_advanced_search_results.sql +++ /dev/null @@ -1 +0,0 @@ -INSERT IGNORE INTO systempreferences (variable, value, options, explanation, type) VALUES ('AdvancedSearchBranchFieldToUse', 'homebranch and holdingbranch', 'homebranch|holdingbranch|homebranch and holdingbranch', 'When a library or group of libraries is selected from the advanced search compare the selected branch value against this branch field(s) selected', 'choice'); diff --git a/installer/data/mysql/atomicupdate/bug_21249-add_SearchLimitLibrary_syspref.perl b/installer/data/mysql/atomicupdate/bug_21249-add_SearchLimitLibrary_syspref.perl new file mode 100644 index 00000000000..d05b3d02a6d --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_21249-add_SearchLimitLibrary_syspref.perl @@ -0,0 +1,6 @@ +$DBversion = 'XXX'; +if( CheckVersion( $DBversion ) ) { + $dbh->do(q{INSERT IGNORE INTO systempreferences (variable, value, options, explanation, type) VALUES ('SearchLimitLibrary', 'both', 'homebranch|holdingbranch|both', "When limiting search results with a library or library group, use the item's home library, or holding library, or both.", 'Choice')}); + + NewVersion( $DBversion, 21249, 'Adding SearchLimitLibrary syspref' ); +} diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index e39352448cb..a590d341cce 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -562,6 +562,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('SCOUserCSS','',NULL,'Add CSS to be included in the SCO module in an embedded