From 3f2a8ecf3c9f3421260657bfc779029e6ae75f2c Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 15 Feb 2024 10:18:37 +0100 Subject: [PATCH] Bug 34478: Regression - fix change framework Signed-off-by: Jonathan Druart --- cataloguing/addbiblio.pl | 28 +++++++++++-------- .../prog/en/modules/cataloguing/addbiblio.tt | 5 ++-- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/cataloguing/addbiblio.pl b/cataloguing/addbiblio.pl index 69c6d6e303..a340c6ebbf 100755 --- a/cataloguing/addbiblio.pl +++ b/cataloguing/addbiblio.pl @@ -63,7 +63,7 @@ if ( C4::Context->preference('marcflavour') eq 'UNIMARC' ) { MARC::File::XML->default_record_format('UNIMARC'); } -our($tagslib,$authorised_values_sth,$is_a_modif,$usedTagsLib,$mandatory_z3950); +our($tagslib,$authorised_values_sth,$is_a_modif,$usedTagsLib,$mandatory_z3950,$op,$changed_framework); =head1 FUNCTIONS @@ -316,8 +316,8 @@ sub build_tabs { index_tag => $index_tag, record => $record, hostitemnumber => scalar $input->param('hostitemnumber'), - op => scalar $input->param('op'), - changed_framework => scalar $input->param('changed_framework'), + op => $op, + changed_framework => $changed_framework, breedingid => scalar $input->param('breedingid'), tagslib => $tagslib, mandatory_z3950 => $mandatory_z3950, @@ -342,8 +342,8 @@ sub build_tabs { index_tag => $index_tag, record => $record, hostitemnumber => scalar $input->param('hostitemnumber'), - op => scalar $input->param('op'), - changed_framework => scalar $input->param('changed_framework'), + op => $op, + changed_framework => $changed_framework, breedingid => scalar $input->param('breedingid'), tagslib => $tagslib, mandatory_z3950 => $mandatory_z3950, @@ -383,8 +383,8 @@ sub build_tabs { index_tag => $index_tag, record => $record, hostitemnumber => scalar $input->param('hostitemnumber'), - op => scalar $input->param('op'), - changed_framework => scalar $input->param('changed_framework'), + op => $op, + changed_framework => $changed_framework, breedingid => scalar $input->param('breedingid'), tagslib => $tagslib, mandatory_z3950 => $mandatory_z3950, @@ -450,8 +450,8 @@ sub build_tabs { index_tag => $index_tag, record => $record, hostitemnumber => scalar $input->param('hostitemnumber'), - op => scalar $input->param('op'), - changed_framework => scalar $input->param('changed_framework'), + op => $op, + changed_framework => $changed_framework, breedingid => scalar $input->param('breedingid'), tagslib => $tagslib, mandatory_z3950 => $mandatory_z3950, @@ -498,7 +498,7 @@ my $biblionumber = $input->param('biblionumber'); # if biblionumber exists, it' my $parentbiblio = $input->param('parentbiblionumber'); my $breedingid = $input->param('breedingid'); my $z3950 = $input->param('z3950'); -my $op = $input->param('op') // q{}; +$op = $input->param('op') // q{}; my $mode = $input->param('mode') // q{}; my $frameworkcode = $input->param('frameworkcode'); my $redirect = $input->param('redirect'); @@ -515,7 +515,11 @@ my $fa_duedatespec = $input->param('duedatespec'); my $userflags = 'edit_catalogue'; -my $changed_framework = $input->param('changed_framework') // q{}; +if ( $op eq 'cud-change-framework' ) { + $op = $input->param('original_op'); + $changed_framework = 1; +} + $frameworkcode = &GetFrameworkCode($biblionumber) if ( $biblionumber and not( defined $frameworkcode) and $op ne 'cud-addbiblio' ); @@ -786,7 +790,7 @@ elsif ( $op eq "cud-delete" ) { $biblionumber = ""; } - if($changed_framework eq "changed"){ + if($changed_framework){ $record = TransformHtmlToMarc( $input, 1 ); } elsif( $record ne -1 ) { diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt index 669c751c15..63149a19ff 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt @@ -801,9 +801,8 @@ $(document).ready(function(){ function Changefwk() { var f = document.f; - f.op.value = "[% op | html %]"; + f.op.value = "cud-change-framework"; f.biblionumber.value = "[% biblionumberdata | html %]"; - f.changed_framework.value = "changed"; f.submit(); } @@ -925,6 +924,7 @@ $(document).ready(function(){ [% INCLUDE 'csrf-token.inc' %] + [% END %] @@ -1058,7 +1058,6 @@ $(document).ready(function(){ - [% WRAPPER tabs id= "addbibliotabs" %] [% WRAPPER tab_panels %] -- 2.39.5