Bug 34478: Add 'op' to authorities/merge

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Jonathan Druart 2024-02-08 09:56:39 +01:00
parent 77f43b1a63
commit a8cc3b3db5
No known key found for this signature in database
GPG Key ID: A085E712BEF0E0F0
2 changed files with 7 additions and 5 deletions

View File

@ -30,7 +30,7 @@ use Koha::MetadataRecord::Authority;
my $input = CGI->new;
my @authid = $input->multi_param('authid');
my $merge = $input->param('merge');
my $op = $input->param('op') || q{};
my @errors;
@ -46,7 +46,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
#------------------------
# Merging
#------------------------
if ($merge) {
if ($op eq 'cud-merge') {
# Creating a new record from the html code
my $record = TransformHtmlToMarc($input, 0);

View File

@ -68,8 +68,7 @@ div#result { margin-top: 1em; }
[% ELSIF ( choosereference ) %]
<p>Please choose which record will be the reference for the merge. The record chosen as reference will be kept, and the other will be deleted.</p>
<form id="mergeform" action="/cgi-bin/koha/authorities/merge.pl" method="post">
[% INCLUDE 'csrf-token.inc' %]
<form id="mergeform_ref" action="/cgi-bin/koha/authorities/merge.pl" method="get">
<fieldset class="rows">
<legend>Merge reference</legend>
<ol>
@ -119,7 +118,10 @@ div#result { margin-top: 1em; }
<input type="hidden" name="mergereference" value="[% mergereference | html %]" />
<input type="hidden" name="frameworkcode" value="[% framework | html %]" />
<fieldset class="action"><input type="submit" name="merge" class="btn btn-primary" value="Merge" /></fieldset>
<fieldset class="action">
<input type="hidden" name="op" value="cud-merge" />
<input type="submit" class="btn btn-primary" value="Merge" />
</fieldset>
</form>
[% END %]