Bugzilla – Attachment 120570 Details for
Bug 21249
Syspref to choose whether to search homebranch, holding branch or both for library groups in advanced search
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21249: (follow-up) Fixing syspref name, description, get working with OPAC masthead search
Bug-21249-follow-up-Fixing-syspref-name-descriptio.patch (text/plain), 6.58 KB, created by
Victor Grousset/tuxayo
on 2021-05-05 21:18:27 UTC
(
hide
)
Description:
Bug 21249: (follow-up) Fixing syspref name, description, get working with OPAC masthead search
Filename:
MIME Type:
Creator:
Victor Grousset/tuxayo
Created:
2021-05-05 21:18:27 UTC
Size:
6.58 KB
patch
obsolete
>From a1774b3c9be5dde7450b7f4087daa0a0deaa7c85 Mon Sep 17 00:00:00 2001 >From: Aleisha Amohia <aleishaamohia@hotmail.com> >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 >Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> >--- > catalogue/search.pl | 2 +- > ..._21249-Branch_to_limit_advanced_search_results.sql | 1 - > .../bug_21249-SearchLimitLibrary_syspref.perl | 6 ++++++ > installer/data/mysql/mandatory/sysprefs.sql | 1 + > .../prog/en/modules/admin/preferences/searching.pref | 11 +++++------ > opac/opac-search.pl | 6 ++---- > 6 files changed, 15 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-SearchLimitLibrary_syspref.perl > >diff --git a/catalogue/search.pl b/catalogue/search.pl >index 2da010e001..32bd6438fc 100755 >--- a/catalogue/search.pl >+++ b/catalogue/search.pl >@@ -380,7 +380,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 6d6aa04808..0000000000 >--- 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-SearchLimitLibrary_syspref.perl b/installer/data/mysql/atomicupdate/bug_21249-SearchLimitLibrary_syspref.perl >new file mode 100644 >index 0000000000..93519631de >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_21249-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 system preference" ); >+} >diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql >index f163912142..38ede7484f 100644 >--- a/installer/data/mysql/mandatory/sysprefs.sql >+++ b/installer/data/mysql/mandatory/sysprefs.sql >@@ -593,6 +593,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('SCOUserCSS','',NULL,'Add CSS to be included in the SCO module in an embedded <style> tag.','free'), > ('SCOUserJS','',NULL,'Define custom javascript for inclusion in the SCO module','free'), > ('SearchEngine','Zebra','Elasticsearch|Zebra','Search Engine','Choice'), >+('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'), > ('SearchMyLibraryFirst','0',NULL,'If ON, OPAC searches return results limited by the user\'s library by default if they are logged in','YesNo'), > ('SearchWithISBNVariations','0',NULL,'If enabled, search on all variations of the ISBN','YesNo'), > ('SelfCheckAllowByIPRanges','',NULL,'(Leave blank if not used. Use ranges or simple ip addresses separated by spaces, like <code>192.168.1.1 192.168.0.0/24</code>.)','Short'), >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 56548ab54d..25b3878307 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 >@@ -168,13 +168,12 @@ Searching: > az: from A to Z. > za: from Z to A. > - >- - pref: AdvancedSearchBranchFieldToUse >- default: homebranch and holdingbranch >+ - When limiting search results with a library or library group, limit by the item's >+ - pref: SearchLimitLibrary > choices: >- homebranch: homebranch >- holdingbranch: holdingbranch >- homebranch and 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 >+ homebranch: "home library." >+ holdingbranch: "holding library." >+ both: "home library and holding library." > - > - pref: displayFacetCount > type: boolean >diff --git a/opac/opac-search.pl b/opac/opac-search.pl >index 410f3f37c5..b759d152b3 100755 >--- a/opac/opac-search.pl >+++ b/opac/opac-search.pl >@@ -484,10 +484,8 @@ if (@searchCategories > 0) { > > @limits = map { uri_unescape($_) } @limits; > >-my $branchfield = C4::Context->preference('AdvancedSearchBranchFieldToUse'); >- >-if ( $params->{'multibranchlimit'} ) { >- my $branchfield = C4::Context->preference('AdvancedSearchBranchFieldToUse'); >+if ( $params->{'multibranchlimit'} || ( $branch_group_limit && $branch_group_limit =~ /^multibranchlimit-/ ) ) { >+ my $branchfield = C4::Context->preference('SearchLimitLibrary'); > my $search_group = Koha::Library::Groups->find( $params->{multibranchlimit} ); > > my @branchcodes = map { $_->branchcode } $search_group->all_libraries; >-- >2.31.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 21249
:
78013
|
78014
|
78921
|
82138
|
83518
|
93345
|
93346
|
95099
|
95100
|
95101
|
103618
|
103619
|
103620
|
103621
|
103622
|
117220
|
117221
|
117222
|
117223
|
117224
|
120481
|
120567
|
120568
|
120569
|
120570
|
120571
|
120572
|
120575
|
120576
|
120577
|
120578
|
120579
|
120580