From 56bd9265cef1c710fb7907e17a95ddc43c5dbaa2 Mon Sep 17 00:00:00 2001 From: Aleisha Amohia Date: Mon, 20 Nov 2023 20:48:52 +0000 Subject: [PATCH] Bug 35372: Add support for AdvancedSearchTypes to be empty and disabled This enhancement makes it possible to leave the AdvancedSearchTypes system preference empty if your library would like to disable the item filter tabs available on the staff interface advanced search. It also adds a message to the system preference description to describe this. To test: 1. Go to Koha Administration -> system preferences. Search for the AdvancedSearchTypes system preference and remove its contents, so it is saved empty. 2. Go to advanced search in the staff interface. Notice the item types tab still shows as a filter option. 3. Apply the patch, restart services and refresh the advanced search 4. Confirm the item types tab no longer shows. 5. Add something back to the AdvancedSearchTypes system preference i.e. itemtypes, ccode 6. Go back to advanced search and confirm your expected tabs show as normal Sponsored-by: Education Services Australia SCIS --- catalogue/search.pl | 2 +- .../prog/en/modules/admin/preferences/searching.pref | 3 ++- koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/advsearch.tt | 2 ++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/catalogue/search.pl b/catalogue/search.pl index e3da85daeee..2befaa94473 100755 --- a/catalogue/search.pl +++ b/catalogue/search.pl @@ -253,7 +253,7 @@ $template->param( ); # load the Type stuff -my $types = C4::Context->preference("AdvancedSearchTypes") || "itemtypes"; +my $types = C4::Context->preference("AdvancedSearchTypes"); my $advancedsearchesloop = prepare_adv_search_types($types); $template->param(advancedsearchesloop => $advancedsearchesloop); 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..8eb1e2da6a7 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 @@ -107,7 +107,8 @@ Searching: - pref: AdvancedSearchTypes class: long - "fields (separate values with |). Tabs appear in the order listed.
" - - "Currently supported values: Item types (itemtypes), Collection, (ccode) and Shelving location (loc)." + - "Currently supported values: Item types (itemtypes), Collection, (ccode) and Shelving location (loc).
" + - Leave empty to disable these tabs in the staff interface advanced search. - - Limit the languages listed in the advanced search drop-down to the - pref: AdvancedSearchLanguages diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/advsearch.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/advsearch.tt index a176d73de73..adfe028242c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/advsearch.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/advsearch.tt @@ -211,6 +211,7 @@ + [% IF advancedsearchesloop %] [% WRAPPER tabs id= "advsearches" %] [% WRAPPER tabs_nav %] [% FOREACH advsearchloo IN advancedsearchesloop %] @@ -267,6 +268,7 @@ [% END # /FOREACH advsearchloo %] [% END # /WRAPPER tab_panels %] [% END # /WRAPPER tabs %] + [% END %] [% IF ( expanded_options ) %] -- 2.30.2