Bugzilla – Attachment 129603 Details for
Bug 29878
Use multiple select widget for AdvancedSearchTypes system preference
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29878: Use multiple select widget for AdvancedSearchTypes system preference
Bug-29878-Use-multiple-select-widget-for-AdvancedS.patch (text/plain), 4.40 KB, created by
Jonathan Druart
on 2022-01-19 12:55:59 UTC
(
hide
)
Description:
Bug 29878: Use multiple select widget for AdvancedSearchTypes system preference
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2022-01-19 12:55:59 UTC
Size:
4.40 KB
patch
obsolete
>From d283f35ed8b60b64a7466b1726b3cf1cbcd80e7b Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Thu, 13 Jan 2022 17:48:25 +0000 >Subject: [PATCH] Bug 29878: Use multiple select widget for AdvancedSearchTypes > system preference > >This patch updates system preferences so that the AdvancedSearchTypes >preference uses a multiple-select widget. This lets users select one or >more checkboxes in a dropdown rather than requiring that they enter >pipe-delimited text. > >To test, apply the patch and run updatedatabase. > >- Go to Administration -> System Preferences and search for > 'AdvancedSearchTypes' >- The input should be styled as a multiple-select widget. Test that you > can select one, more, or all of the options. >- Test that your selections are saved successfully and that the changes > are reflected on the OPAC and staff interface advanced search pages. > >Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > catalogue/search.pl | 2 +- > installer/data/mysql/atomicupdate/bug-29878.pl | 15 +++++++++++++++ > .../en/modules/admin/preferences/searching.pref | 10 ++++++---- > opac/opac-search.pl | 2 +- > 4 files changed, 23 insertions(+), 6 deletions(-) > create mode 100755 installer/data/mysql/atomicupdate/bug-29878.pl > >diff --git a/catalogue/search.pl b/catalogue/search.pl >index 5da9c063f3b..a5419bf3e58 100755 >--- a/catalogue/search.pl >+++ b/catalogue/search.pl >@@ -720,7 +720,7 @@ It also accounts for the "item-level_itypes" system preference. > sub prepare_adv_search_types { > my ($types) = @_; > >- my @advanced_search_types = split( /\|/, $types ); >+ my @advanced_search_types = split( /\,/, $types ); > > # the index parameter is different for item-level itemtypes > my $itype_or_itemtype = >diff --git a/installer/data/mysql/atomicupdate/bug-29878.pl b/installer/data/mysql/atomicupdate/bug-29878.pl >new file mode 100755 >index 00000000000..f8a9ce7d8b1 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug-29878.pl >@@ -0,0 +1,15 @@ >+use Modern::Perl; >+ >+return { >+ bug_number => "29878", >+ description => "Use multiple select for AdvancedSearchTypes system preference", >+ up => sub { >+ my ($args) = @_; >+ my $dbh = $args->{dbh}; >+ >+ $dbh->do(q{ >+ UPDATE systempreferences SET value = REPLACE(value, '|', ',') >+ WHERE variable IN ('AdvancedSearchTypes') >+ }); >+ }, >+} >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 a0d7ec430da..f589b75cd67 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 >@@ -96,11 +96,13 @@ Searching: > 0: "Don't add" > - search history of the unlogged user to the next patron logging in. > - >- - Show tabs in the OPAC and staff interface advanced search for limiting searches on the >+ - Show tabs in the OPAC and staff interface advanced search for limiting searches by > - pref: AdvancedSearchTypes >- class: long >- - "fields (separate values with |). Tabs appear in the order listed.<br/>" >- - "<em>Currently supported values</em>: Item types (<strong>itemtypes</strong>), Collection Codes (<strong>ccode</strong>) and Shelving Location (<strong>loc</strong>)." >+ multiple: >+ itemtypes: Item type >+ ccode: Collection >+ loc: Shelving location >+ - "Tabs appear in the order listed.<br/>" > - > - Limit the languages listed in the advanced search drop-down to the > - pref: AdvancedSearchLanguages >diff --git a/opac/opac-search.pl b/opac/opac-search.pl >index 8d5fe07bc00..5fd4be435ec 100755 >--- a/opac/opac-search.pl >+++ b/opac/opac-search.pl >@@ -240,7 +240,7 @@ my $itype_or_itemtype = (C4::Context->preference("item-level_itypes"))?'itype':' > my @advancedsearchesloop; > my $cnt; > my $advanced_search_types = C4::Context->preference("AdvancedSearchTypes") || "itemtypes"; >-my @advanced_search_types = split(/\|/, $advanced_search_types); >+my @advanced_search_types = split(/\,/, $advanced_search_types); > > my $hidingrules = C4::Context->yaml_preference('OpacHiddenItems') // {}; > >-- >2.25.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 29878
:
129429
|
129431
| 129603 |
129963
|
129964