Bugzilla – Attachment 159189 Details for
Bug 35372
Support for empty AdvancedSearchTypes
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35372: Add support for OpacAdvancedSearchTypes to be empty and disabled
Bug-35372-Add-support-for-OpacAdvancedSearchTypes-.patch (text/plain), 4.10 KB, created by
Aleisha Amohia
on 2023-11-22 02:35:38 UTC
(
hide
)
Description:
Bug 35372: Add support for OpacAdvancedSearchTypes to be empty and disabled
Filename:
MIME Type:
Creator:
Aleisha Amohia
Created:
2023-11-22 02:35:38 UTC
Size:
4.10 KB
patch
obsolete
>From bb09f41808f1e2fbb794d35731def56ee9f29d02 Mon Sep 17 00:00:00 2001 >From: Aleisha Amohia <aleisha@catalyst.net.nz> >Date: Wed, 22 Nov 2023 02:34:08 +0000 >Subject: [PATCH] Bug 35372: Add support for OpacAdvancedSearchTypes to be > empty and disabled > >This enhancement makes it possible to leave the OpacAdvancedSearchTypes system preference empty if your library would like to disable the item filter tabs available on the OPAC 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 OpacAdvancedSearchTypes system preference and remove its contents, so it is saved empty. >2. Go to advanced search in the OPAC. 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 OpacAdvancedSearchTypes 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 >--- > .../intranet-tmpl/prog/en/modules/admin/preferences/opac.pref | 3 ++- > koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-advsearch.tt | 2 +- > opac/opac-search.pl | 2 +- > 3 files changed, 4 insertions(+), 3 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref >index a68e7eaa2d3..f6aee05b702 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref >@@ -929,7 +929,8 @@ OPAC: > - pref: OpacAdvancedSearchTypes > class: long > - "fields (separate values with |). Tabs appear in the order listed.<br/>" >- - "<em>Currently supported values</em>: Item types (<strong>itemtypes</strong>), Collection, (<strong>ccode</strong>) and Shelving location (<strong>loc</strong>)." >+ - "<em>Currently supported values</em>: Item types (<strong>itemtypes</strong>), Collection, (<strong>ccode</strong>) and Shelving location (<strong>loc</strong>).<br/>" >+ - Leave empty to disable these tabs in the OPAC advanced search. > Authentication: > - > - pref: OPACShibOnly >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-advsearch.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-advsearch.tt >index 21d4d1b0251..a8dff2fa6db 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-advsearch.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-advsearch.tt >@@ -155,7 +155,7 @@ > > <div class="row"> > [%# Following on one line for translatability %] >- [% IF ( ( OpacAdvSearchOptions and OpacAdvSearchOptions.grep('itemtype').size > 0 and not expanded_options ) or ( OpacAdvSearchMoreOptions and OpacAdvSearchMoreOptions.grep('itemtype').size > 0 and expanded_options ) ) %] >+ [% IF advancedsearchesloop and ( ( OpacAdvSearchOptions and OpacAdvSearchOptions.grep('itemtype').size > 0 and not expanded_options ) or ( OpacAdvSearchMoreOptions and OpacAdvSearchMoreOptions.grep('itemtype').size > 0 and expanded_options ) ) %] > <div class="col order-first order-md-first order-lg-2"> > [% WRAPPER tabs id= "advsearches" %] > [% WRAPPER tabs_nav %] >diff --git a/opac/opac-search.pl b/opac/opac-search.pl >index ae864ee30cf..02489bff0ed 100755 >--- a/opac/opac-search.pl >+++ b/opac/opac-search.pl >@@ -248,7 +248,7 @@ foreach my $itemtype ( keys %{$itemtypes} ) { > my $itype_or_itemtype = (C4::Context->preference("item-level_itypes"))?'itype':'itemtype'; > my @advancedsearchesloop; > my $cnt; >-my $advanced_search_types = C4::Context->preference("OpacAdvancedSearchTypes") || "itemtypes"; >+my $advanced_search_types = C4::Context->preference("OpacAdvancedSearchTypes"); > my @advanced_search_types = split(/\|/, $advanced_search_types); > > my $hidingrules = C4::Context->yaml_preference('OpacHiddenItems') // {}; >-- >2.30.2
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 35372
:
159149
|
159189
|
159266
|
159267