From eea5cdfd1dec84086ba56c67317dd6130d9f2e8b 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 Content-Type: text/plain; charset=utf-8 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 --- .../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 021922bcce..8dbfdf7816 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tt @@ -732,8 +732,8 @@ [% ELSIF ( mv.type == 'text1' ) %] - [% ELSIF ( mv.type == 'text2' ) %] - + [% ELSIF ( mv.type == 'text2' ) # plugin %] + [% ELSIF ( mv.type == 'text' ) %] [% ELSIF ( mv.type == 'textarea' ) %] @@ -758,7 +758,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 b14a9eda42..9592a548c2 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/upload.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/upload.tt @@ -475,9 +475,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 43613ec420..bd067cc081 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/cataloging.js +++ b/koha-tmpl/intranet-tmpl/prog/js/cataloging.js @@ -629,7 +629,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