Bugzilla – Attachment 167184 Details for
Bug 36509
Add option to search authority records by ID
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36509: Add Search ID tab to authorities search on staff interface
Bug-36509-Add-Search-ID-tab-to-authorities-search-.patch (text/plain), 6.18 KB, created by
Aleisha Amohia
on 2024-05-26 21:31:31 UTC
(
hide
)
Description:
Bug 36509: Add Search ID tab to authorities search on staff interface
Filename:
MIME Type:
Creator:
Aleisha Amohia
Created:
2024-05-26 21:31:31 UTC
Size:
6.18 KB
patch
obsolete
>From 77f300fa8c52b40ad96dd788ef3721e8ff84c541 Mon Sep 17 00:00:00 2001 >From: Aleisha Amohia <aleisha@catalyst.net.nz> >Date: Thu, 4 Apr 2024 01:56:39 +0000 >Subject: [PATCH] Bug 36509: Add Search ID tab to authorities search on staff > interface > >This patch makes use of the existing local-number index on the 001 authority field so that authority records can be searched using the 001 ID. > >This patch works for both Elasticsearch and Zebra search engines. > >To test: > >1. Spin up your ktd with elasticsearch `ktd --es7 up` >2. In the staff interface, open up Koha Administration and search for the SearchEngine system preference. It should be set to Elasticsearch. >3. In another tab, open the staff interface and go to Authorities. >4. Do a normal authorities search, confirm that when you expand the dropdown to order by 'none', the results appear to be in authority-ID ascending order. >5. Choose an ID and go to new the Search ID tab. Search for your ID, confirm it shows as expected. >6. Back in the Koha Administration tab, change the SearchEngine to Zebra. >7. In your Authorities tab, refresh the page. >8. Repeat step 5 and confirm that you can search for the authority by its ID again. > >Sponsored-by: Education Services Australia SCIS >--- > .../Elasticsearch/QueryBuilder.pm | 3 +- > .../searchengine/elasticsearch/mappings.yaml | 2 +- > .../prog/en/includes/authorities-search.inc | 28 +++++++++++++++++++ > .../prog/en/includes/authorities_js.inc | 2 ++ > 4 files changed, 33 insertions(+), 2 deletions(-) > >diff --git a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm b/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm >index ac161e50fd7..23c36c7617b 100644 >--- a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm >+++ b/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm >@@ -503,7 +503,7 @@ Arguments: > =item marclist > > An arrayref containing where the particular term should be searched for. >-Options are: mainmainentry, mainentry, match, match-heading, see-from, and >+Options are: mainmainentry, mainentry, match, match-heading, see-from, local-number, and > thesaurus. If left blank, any field is used. > > =item and_or >@@ -552,6 +552,7 @@ our $koha_to_index_name = { > thesaurus => 'subject-heading-thesaurus', > 'thesaurus-conventions' => 'subject-heading-thesaurus-conventions', > any => '', >+ 'local-number' => 'local-number', > all => '' > }; > >diff --git a/admin/searchengine/elasticsearch/mappings.yaml b/admin/searchengine/elasticsearch/mappings.yaml >index 929f2f94103..4f9c508990e 100644 >--- a/admin/searchengine/elasticsearch/mappings.yaml >+++ b/admin/searchengine/elasticsearch/mappings.yaml >@@ -947,7 +947,7 @@ authorities: > suggestible: '' > opac: 1 > staff_client: 1 >- type: number >+ type: '' > personal-name: > label: personal-name > mandatory: ~ >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/authorities-search.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/authorities-search.inc >index 87fd69c7c51..4ebb14fbe06 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/authorities-search.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/authorities-search.inc >@@ -153,6 +153,31 @@ > </form> > [% END # /tab_panel %] > >+ [% WRAPPER tab_panel tabname="search_id" %] >+ <form action="/cgi-bin/koha/authorities/authorities-home.pl" method="get"> >+ <input type="hidden" name="op" value="do_search" /> >+ <input type="hidden" name="type" value="intranet" /> >+ <input type="hidden" name="marclist" value="local-number" /> >+ >+ <div class="form-title"> >+ <label class="control-label" for="value_search_id"><span class="control-text">Search ID<span> <i class="fa fa-fw fa-solid fa-hashtag" aria-hidden="true"></i></label> >+ </div> >+ >+ <div class="form-content"> >+ <input id="value_search_id" class="form-control head-searchbox" type="text" name="value" value="[% value | html %]" placeholder="Search ID (001)" /> >+ <button type="button" class="form-extra-content-toggle" title="More options"><i class="form-extra-content-icon fa-solid fa-sliders" aria-hidden="true"></i></button> >+ </div> >+ >+ <button type="submit" aria-label="Search"><i class="fa fa-arrow-right"></i></button> >+ >+ <div class="form-extra-content"> >+ [% INCLUDE authtype %] >+ [% INCLUDE operator %] >+ [% INCLUDE orderby %] >+ </div> >+ </form> >+ [% END # /tab_panel %] >+ > [% WRAPPER tab_panel tabname="entire_record" %] > <form action="/cgi-bin/koha/authorities/authorities-home.pl" method="get"> > <input type="hidden" name="op" value="do_search" /> >@@ -191,6 +216,9 @@ > [% WRAPPER tab_item tabname= "matchheading_search" %] > <i class="fa fa-fw fa-align-center" aria-hidden="true"></i> <span class="tab-title">All headings</span> > [% END %] >+ [% WRAPPER tab_item tabname= "search_id" %] >+ <i class="fa fa-fw fa-solid fa-hashtag" aria-hidden="true"></i> <span class="tab-title">Search ID</span> >+ [% END %] > [% WRAPPER tab_item tabname= "entire_record" %] > <i class="fa-solid fa-fw fa-folder-open" aria-hidden="true"></i> <span class="tab-title">Entire record</span> > [% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/authorities_js.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/authorities_js.inc >index 542ba1ae1ce..48de405b125 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/authorities_js.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/authorities_js.inc >@@ -70,6 +70,8 @@ $(document).ready(function () { > $("#header_search a[href='#main_heading_panel']").tab("show"); > } else if ('match' == searchType.valueOf()) { > $("#header_search a[href='#matchheading_search_panel']").tab("show"); >+ } else if ('local-number' == searchType.valueOf()) { >+ $("#header_search a[href='#search_id_panel']").tab("show"); > } else if ('all' == searchType.valueOf()) { > $("#header_search a[href='#entire_record_panel']").tab("show"); > } >-- >2.39.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 36509
:
164524
|
164576
| 167184