Bug 34478: Regression - fix change auth type

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Jonathan Druart 2024-02-15 10:24:02 +01:00
parent 3f2a8ecf3c
commit 5567a1a6d4
Signed by: jonathan.druart
GPG key ID: A085E712BEF0E0F0
2 changed files with 8 additions and 4 deletions

View file

@ -543,8 +543,12 @@ my $myindex = $input->param('index');
my $linkid=$input->param('linkid');
my $authtypecode = $input->param('authtypecode');
my $breedingid = $input->param('breedingid');
my $changed_authtype = $input->param('changed_authtype') // q{};
my $changed_authtype;
if ( $op eq 'cud-change-framework' ) {
$op = $input->param('original_op');
$changed_authtype = 1;
}
my $dbh = C4::Context->dbh;
if(!$authtypecode) {
@ -636,7 +640,7 @@ if ($op eq "cud-add") {
$authid = "";
}
if ( $changed_authtype eq "changed" ) {
if ( $changed_authtype ) {
$record = TransformHtmlToMarc( $input, 0 );
}

View file

@ -106,9 +106,8 @@
$(".change-authtype").on("click", function(){
var authtypecode = $(this).data("authtypecode");
var f = document.f;
f.op.value = "[% op | html %]";
f.op.value = "cud-change-framework";
f.authid.value = "[% authid | html %]";
f.changed_authtype.value = "changed";
f.authtypecode.value = authtypecode;
f.submit();
});
@ -431,6 +430,7 @@
<form method="post" id="f" name="f" action="/cgi-bin/koha/authorities/authorities.pl">
[% INCLUDE 'csrf-token.inc' %]
<input type="hidden" name="op" value="cud-add" />
<input type="hidden" name="original_op" value="[% op | html %]" />
<input type="hidden" name="addfield_field" value="" />
<input type="hidden" name="repeat_field" value="" />
<input type="hidden" name="authtypecode" value="[% authtypecode | html%]" />