From 7e7bec926156932d7958f0f434ea1bc55ba7e9d0 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Thu, 19 Jan 2023 20:47:31 +0000 Subject: [PATCH] Bug 32685: Correct authority match display on import Bug 22785 updated the import records table, but mixed javascript variables and template toolkit, this means all matches are treated as biblios To test: 1 - Export some authority records form Koha 2 - Create a matching rule based on 'Local-number' and field 001 3 - Stage the records for import using above rule 4 - Note the match links point to authorities, but the citations point to biblios 5 - Apply patch 6 - Reload the page 7 - Confirm the links have the correct text Signed-off-by: Andrew Fuerste-Henry Signed-off-by: Jonathan Druart Signed-off-by: Tomas Cohen Arazi (cherry picked from commit 9d7cca8b4dcdda09e5134bcd57731346285c9fc2) Signed-off-by: Matt Blenkinsop --- .../prog/en/modules/tools/manage-marc-import.tt | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/manage-marc-import.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/manage-marc-import.tt index 2c7680ad6e..3c17c157bc 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/manage-marc-import.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/manage-marc-import.tt @@ -545,18 +545,20 @@ checked = 'checked="checked"'; any_checked = 1; } - [% IF(item.record_type == 'auth') -%] - var matching_msg = _("Matches authority %s (score=%s):%s"); - [%- ELSE -%] - var matching_msg = _("Matches bibliographic record %s (score=%s):%s"); - [%- END %] var match_option = ""; match_option = ' '; var diff_url = '/cgi-bin/koha/tools/showdiffmarc.pl?batchid=%s&importid=%s&id=%s&type=%s'; var match_citation = ''; - if( item.title ){ match_citation += item.title + ' ' } - if( item.author ){ match_citation += item.author } + var matching_msg = ''; + if ( item.record_type == 'auth' ){ + matching_msg = _("Matches authority %s (score=%s):%s"); + if( item.authorized_heading ){ match_citation += item.authorized_heading } + } else { + matching_msg = _("Matches bibliographic record %s (score=%s):%s"); + if( item.title ){ match_citation += item.title + ' ' } + if( item.author ){ match_citation += item.author } + } $('td:eq(4) ul', nRow).append('