Bug 34478: Manual fix - Rename action with op change to post - merge-patrons

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Nick Clemens 2024-01-26 10:52:54 -05:00 committed by Jonathan Druart
parent c4ad20ce10
commit 9f99265f34
Signed by: jonathan.druart
GPG key ID: A085E712BEF0E0F0
2 changed files with 9 additions and 8 deletions

View file

@ -102,7 +102,7 @@
[% INCLUDE 'messages.inc' %]
<h1>Merge patron records</h1>
[% IF action == 'show' %]
[% IF op == 'show' %]
[% IF patrons.count > 1 %]
[% IF ( patrons.count == 2 ) %]
<div id="toolbar" class="btn-toolbar">
@ -116,7 +116,8 @@
<p>Select patron to keep. Data from the other patrons will be transferred to this patron record and the remaining patron records will be deleted.</p>
<form method="get" type="post" action="merge-patrons.pl" id="patron-merge-form">
<form method="post" action="merge-patrons.pl" id="patron-merge-form">
[% INCLUDE 'csrf-token.inc' %]
<table id="patron-merge-table" class="datatable">
<thead>
<tr>
@ -157,7 +158,7 @@
[% FOREACH p IN patrons %]
<input type="hidden" name="id" value="[% p.id | html %]" />
[% END %]
<input type="hidden" name="action" value="merge" />
<input type="hidden" name="op" value="cud-merge" />
<input type="submit" id="merge-patrons" class="btn btn-primary" value="Merge patrons" />
[% PROCESS 'members-patron-selections.inc' id="patron-merge-form" %]
</fieldset>
@ -166,7 +167,7 @@
<div class="dialog alert">Error: Two or more patrons need to be selected for merging</div>
[% END %]
</form>
[% ELSIF action == 'merge' %]
[% ELSIF op == 'cud-merge' %]
<h4>Results</h4>
[% IF error %]
[% IF error == 'INVALID_KEEPER' %]

View file

@ -37,13 +37,13 @@ my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user(
}
);
my $action = $cgi->param('action') || 'cud-show';
my $op = $cgi->param('op') || 'show';
my @ids = $cgi->multi_param('id');
if ( $action eq 'cud-show' ) {
if ( $op eq 'show' ) {
my $patrons = Koha::Patrons->search({ borrowernumber => { -in => \@ids } });
$template->param( patrons => $patrons );
} elsif ( $action eq 'merge' ) {
} elsif ( $op eq 'cud-merge' ) {
my $keeper_id = $cgi->param('keeper');
my $results;
@ -65,7 +65,7 @@ if ( $action eq 'cud-show' ) {
}
}
$template->param( action => $action );
$template->param( op => $op );
output_html_with_http_headers $cgi, $cookie, $template->output;