From 3b9c4158ecb22a073868b6f9b1e83c231552ba21 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Fri, 7 Feb 2025 10:33:05 +0000 Subject: [PATCH] Bug 30975: (QA follow-up) Fix for authorities and upload plugin Authorities still needed a few tweaks for text2 (obscure name for plugins). Upload plugin does not have buttonDot 'mark'. Cloning was still an issue. Not the most elegant solution but it works. We should not have this exception for just another icon or so. Signed-off-by: Marcel de Rooy Signed-off-by: David Cook --- .../prog/en/modules/authorities/authorities.tt | 6 +++--- koha-tmpl/intranet-tmpl/prog/en/modules/tools/upload.tt | 6 +++--- koha-tmpl/intranet-tmpl/prog/js/cataloging.js | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tt index 75c116c950..ef03bd0d5d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tt @@ -729,8 +729,8 @@ [% ELSIF ( mv.type == 'text1' ) %] - [% ELSIF ( mv.type == 'text2' ) %] - + [% ELSIF ( mv.type == 'text2' ) # plugin %] + [% ELSIF ( mv.type == 'text' ) %] [% ELSIF ( mv.type == 'textarea' ) %] @@ -755,7 +755,7 @@ [% IF mv.noclick %] ... [% ELSE %] - ... + ... [% END %] [% mv.javascript | $raw %] [% END #/IF ( mv.type == 'text1' ) %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/upload.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/upload.tt index 48c577540d..46ec78c9b7 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/upload.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/upload.tt @@ -481,9 +481,9 @@ var res = '[% Koha.Preference('OPACBaseURL') | html %]'; res = res.replace( /\/$/, ''); res = res + '/cgi-bin/koha/opac-retrieve-file.pl?id=' + hashval; - [% IF index %] - $(window.opener.document).find('#[% index | html %]').val( res ); - [% END %] + var index = '[% index | html %]'; + index = index.replace( /^buttonDot_/, '' ); + if(index) $(window.opener.document).find('#'+index).val( res ); window.close(); } var table_settings = [% TablesSettings.GetTableSettings( 'tools', 'upload', 'uploadresults', 'json' ) | $raw %]; diff --git a/koha-tmpl/intranet-tmpl/prog/js/cataloging.js b/koha-tmpl/intranet-tmpl/prog/js/cataloging.js index 55fade7494..c6caa9d4fe 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/cataloging.js +++ b/koha-tmpl/intranet-tmpl/prog/js/cataloging.js @@ -821,7 +821,7 @@ $(document).ready(function() { const plugin = event.target.getAttribute('data-plugin'); if (plugin && plugin in Koha.frameworkPlugins && event.type in Koha.frameworkPlugins[plugin]) { event.data = {}; - if (event.target.classList.contains('buttonDot')) { + if (event.target.classList.contains('framework_plugin') || event.target.classList.contains('buttonDot') ) { event.data.id = event.target.closest('.subfield_line').querySelector('input.input_marceditor').id; } else { event.data.id = event.target.id; -- 2.39.5