From f7c8e4ddf24f1820db077d49f70a49d77b875a13 Mon Sep 17 00:00:00 2001 From: Aleisha Amohia Date: Mon, 22 Apr 2024 02:28:23 +0000 Subject: [PATCH] Bug 36659: Show correct tab after conducting an Authorities search To test: 1. In the staff interface, go to Authorities 2. Do a search for each tab, i.e. 'Main heading' and 'Entire record' 3. Notice every search has the 'Main heading ($a only)' tab selected when the results page loads. 4. Apply patch and restart services 5. Repeat step 2 and confirm the appropriate tab is selected by default after each search. Sponsored-by: Education Services Australia SCIS Signed-off-by: David Nind Signed-off-by: Lucas Gass Signed-off-by: Katrin Fischer --- .../prog/en/includes/authorities_js.inc | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) 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 78c5a982c5..542ba1ae1c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/authorities_js.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/authorities_js.inc @@ -19,7 +19,7 @@ function mergeAuth(authid, summary) { function showMergingInProgress() { var alreadySelected = Cookies.get('auth_to_merge'); - if (alreadySelected !== undefined) { + if (alreadySelected) { alreadySelected = JSON.parse(alreadySelected); $('#merge_in_progress').show().html(_("Merging with authority: ") + "" + alreadySelected.summary + " (" + alreadySelected.authid + ") " + _("Cancel merge") + ""); $('#cancel_merge').click(function(event) { @@ -64,14 +64,14 @@ $(document).ready(function () { var searchType = '[% marclist | html %]'; if (searchType) { - if ('mainmainentry' == searchType) { - $("#header_search a[href='#mainmain_heading']").tab("show"); - } else if ('mainentry' == searchType) { - $("#header_search a[href='#main_heading']").tab("show"); - } else if ('match' == searchType) { - $("#header_search a[href='#matchheading_search']").tab("show"); - } else if ('all' == searchType) { - $("#header_search a[href='#entire_record']").tab("show"); + if ('mainmainentry' == searchType.valueOf()) { + $("#header_search a[href='#mainmain_heading_panel']").tab("show"); + } else if ('mainentry' == searchType.valueOf()) { + $("#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 ('all' == searchType.valueOf()) { + $("#header_search a[href='#entire_record_panel']").tab("show"); } } }); -- 2.39.5