Bug 42441: Remove event attributes from authority merge template
This patch moves a couple of "onclick" event attributes from the authority merge template, moving the event handling to the JS block. This patch also fixes the behavior that I assume the click handlers are meant to have, changing the framework selection. A mismatch of IDs in the code meant that clicking the radio buttons didn't do anything. To test, apply the patch and go to Authorities. - Perform a search for authority records which will return multiple results, including records with different heading types (e.g. Personal Name, Topical Term, etc.) - In the "Actions" menu for one of the search results, click "Merge" - Do the same with another result which has a different heading type. - On the "Merging records" page you should see a frameowrk dropdown. - When you click the radio buttons next to your two records to merge the framework selection should change to match your selection. Sponsored-by: Athens County Public Libraries Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org> Amended-by: Jonathan Druart Tidy Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
This commit is contained in:
parent
a3569fe0c2
commit
8fc481e57a
|
|
@ -72,7 +72,7 @@
|
|||
<legend>Merge reference</legend>
|
||||
<ol>
|
||||
<li class="radio"
|
||||
><input type="radio" value="[% recordid1 | uri %]" checked="checked" id="mergereference1" name="mergereference" onclick="changeFramework('[% frameworkcode1 | html %]')" /><label for="mergereference1"
|
||||
><input type="radio" value="[% recordid1 | uri %]" checked="checked" id="mergereference1" name="mergereference" class="change_framework" data-framework="[% frameworkcode1 | html %]" /><label for="mergereference1"
|
||||
>[% title1 | html %] [% FOREACH subtitl1 IN subtitle1 %][% subtitl1 | html %][% END %] (<a
|
||||
href="/cgi-bin/koha/authorities/detail.pl?authid=[% recordid1 | uri %]"
|
||||
title="MARC"
|
||||
|
|
@ -83,7 +83,7 @@
|
|||
></li
|
||||
>
|
||||
<li class="radio"
|
||||
><input type="radio" value="[% recordid2 | uri %]" id="mergereference2" name="mergereference" onclick="changeFramework('[% frameworkcode2 | html %]')" /><label for="mergereference2"
|
||||
><input type="radio" value="[% recordid2 | uri %]" id="mergereference2" name="mergereference" class="change_framework" data-framework="[% frameworkcode2 | html %]" /><label for="mergereference2"
|
||||
>[% title2 | html %] [% FOREACH subtitl2 IN subtitle2 %][% subtitl2 | html %][% END %] (<a
|
||||
href="/cgi-bin/koha/authorities/detail.pl?authid=[% recordid2 | uri %]"
|
||||
title="MARC"
|
||||
|
|
@ -166,11 +166,15 @@
|
|||
if( $("#tabs .tab-pane.active").length < 1 ){
|
||||
$("#tabs a:first").tab("show");
|
||||
}
|
||||
$(".change_framework").on("click", function () {
|
||||
let framework = $(this).data("framework");
|
||||
changeFramework(framework);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
function changeFramework(fw) {
|
||||
$("#Frameworks").val(fw);
|
||||
$("#frameworkcode").val(fw);
|
||||
}
|
||||
</script>
|
||||
[% END %]
|
||||
|
|
|
|||
Loading…
Reference in New Issue