From f8086712952b7cf6dadcecf2a2c7486f228ecca6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Joonas=20Kylm=C3=A4l=C3=A4?= Date: Sun, 26 Sep 2021 08:10:15 +0000 Subject: [PATCH] Bug 29111: Remove unused indicator modification code for items MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The indicator value for 952 was hard coded in every case to " ". In order to achieve that we can simply pass undef to TransformHtmlToXml() and it will set the indicator values to " ". To test: 1) Make sure the submission of (at least some) the modified files still work, e.g. test that making a new item via cataloguing/additem.pl works. Signed-off-by: Petro Vashchuk Signed-off-by: Katrin Fischer Rebased-by: Joonas Kylmälä Signed-off-by: Jonathan Druart --- acqui/addorder.pl | 8 ++------ acqui/addorderiso2709.pl | 4 +--- acqui/finishreceive.pl | 8 ++------ .../intranet-tmpl/prog/en/modules/cataloguing/additem.tt | 2 -- serials/serials-edit.pl | 8 ++------ tools/batchMod.pl | 5 +---- 6 files changed, 8 insertions(+), 27 deletions(-) diff --git a/acqui/addorder.pl b/acqui/addorder.pl index e62cfe4710..318b148c8a 100755 --- a/acqui/addorder.pl +++ b/acqui/addorder.pl @@ -360,8 +360,6 @@ if ( $basket->{is_standing} || $orderinfo->{quantity} ne '0' ) { my @field_values = $input->multi_param('field_value'); my @serials = $input->multi_param('serial'); my @itemid = $input->multi_param('itemid'); - my @ind_tag = $input->multi_param('ind_tag'); - my @indicator = $input->multi_param('indicator'); #Rebuilding ALL the data for items into a hash # parting them on $itemid. @@ -375,15 +373,13 @@ if ( $basket->{is_standing} || $orderinfo->{quantity} ne '0' ) { push @{$itemhash{$itemid[$i]}->{'tags'}},$tags[$i]; push @{$itemhash{$itemid[$i]}->{'subfields'}},$subfields[$i]; push @{$itemhash{$itemid[$i]}->{'field_values'}},$field_values[$i]; - push @{$itemhash{$itemid[$i]}->{'ind_tag'}},$ind_tag[$i]; - push @{$itemhash{$itemid[$i]}->{'indicator'}},$indicator[$i]; } foreach my $item (keys %itemhash){ my $xml = TransformHtmlToXml( $itemhash{$item}->{'tags'}, $itemhash{$item}->{'subfields'}, $itemhash{$item}->{'field_values'}, - $itemhash{$item}->{'indicator'}, - $itemhash{$item}->{'ind_tag'}, + undef, + undef, 'ITEM'); my $record=MARC::Record::new_from_xml($xml, 'UTF-8'); my ($barcodefield,$barcodesubfield) = GetMarcFromKohaField('items.barcode'); diff --git a/acqui/addorderiso2709.pl b/acqui/addorderiso2709.pl index 47c2ff2cca..fd38741c20 100755 --- a/acqui/addorderiso2709.pl +++ b/acqui/addorderiso2709.pl @@ -376,9 +376,7 @@ if ($op eq ""){ my @subfields = $input->multi_param('subfield'); my @field_values = $input->multi_param('field_value'); my @serials = $input->multi_param('serial'); - my @ind_tag = $input->multi_param('ind_tag'); - my @indicator = $input->multi_param('indicator'); - my $xml = TransformHtmlToXml( \@tags, \@subfields, \@field_values, \@indicator, \@ind_tag ); + my $xml = TransformHtmlToXml( \@tags, \@subfields, \@field_values ); my $record = MARC::Record::new_from_xml( $xml, 'UTF-8' ); for (my $qtyloop=1;$qtyloop <= $c_quantity;$qtyloop++) { my ( $biblionumber, $bibitemnum, $itemnumber ) = AddItemFromMarc( $record, $biblionumber ); diff --git a/acqui/finishreceive.pl b/acqui/finishreceive.pl index 93391e8fad..94b73d53a4 100755 --- a/acqui/finishreceive.pl +++ b/acqui/finishreceive.pl @@ -139,8 +139,6 @@ if ($quantityrec > $origquantityrec ) { my @field_values = $input->multi_param('field_value'); my @serials = $input->multi_param('serial'); my @itemid = $input->multi_param('itemid'); - my @ind_tag = $input->multi_param('ind_tag'); - my @indicator = $input->multi_param('indicator'); #Rebuilding ALL the data for items into a hash # parting them on $itemid. my %itemhash; @@ -153,16 +151,14 @@ if ($quantityrec > $origquantityrec ) { push @{$itemhash{$itemid[$i]}->{'tags'}},$tags[$i]; push @{$itemhash{$itemid[$i]}->{'subfields'}},$subfields[$i]; push @{$itemhash{$itemid[$i]}->{'field_values'}},$field_values[$i]; - push @{$itemhash{$itemid[$i]}->{'ind_tag'}},$ind_tag[$i]; - push @{$itemhash{$itemid[$i]}->{'indicator'}},$indicator[$i]; } my $new_order = Koha::Acquisition::Orders->find( $new_ordernumber ); foreach my $item (keys %itemhash){ my $xml = TransformHtmlToXml( $itemhash{$item}->{'tags'}, $itemhash{$item}->{'subfields'}, $itemhash{$item}->{'field_values'}, - $itemhash{$item}->{'indicator'}, - $itemhash{$item}->{'ind_tag'}, + undef, + undef, 'ITEM' ); my $record=MARC::Record::new_from_xml($xml, 'UTF-8'); my (undef,$bibitemnum,$itemnumber) = AddItemFromMarc($record,$biblionumber); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt index da46f867cc..e86726141e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt @@ -247,8 +247,6 @@ [% END %] - - [% IF op != 'add_item' %] [% END %] diff --git a/serials/serials-edit.pl b/serials/serials-edit.pl index 76a6bf0b25..8c5720e88f 100755 --- a/serials/serials-edit.pl +++ b/serials/serials-edit.pl @@ -285,8 +285,6 @@ if ( $op and $op eq 'serialchangestatus' ) { my @serials = $query->multi_param('serial'); my @bibnums = $query->multi_param('bibnum'); my @itemid = $query->multi_param('itemid'); - my @ind_tag = $query->multi_param('ind_tag'); - my @indicator = $query->multi_param('indicator'); my @num_copies = $query->multi_param('number_of_copies'); #Rebuilding ALL the data for items into a hash @@ -313,8 +311,6 @@ if ( $op and $op eq 'serialchangestatus' ) { push @{ $itemhash{ $itemid[$i] }->{'subfields'} }, $subfields[$i]; push @{ $itemhash{ $itemid[$i] }->{'field_values'} }, $field_values[$i]; - push @{ $itemhash{ $itemid[$i] }->{'ind_tag'} }, $ind_tag[$i]; - push @{ $itemhash{ $itemid[$i] }->{'indicator'} }, $indicator[$i]; } foreach my $item ( keys %itemhash ) { @@ -334,8 +330,8 @@ if ( $op and $op eq 'serialchangestatus' ) { $itemhash{$item}->{'tags'}, $itemhash{$item}->{'subfields'}, $itemhash{$item}->{'field_values'}, - $itemhash{$item}->{'indicator'}, - $itemhash{$item}->{'ind_tag'} + undef, + undef ); # warn $xml; diff --git a/tools/batchMod.pl b/tools/batchMod.pl index e3d26c60ff..16e0e1ac31 100755 --- a/tools/batchMod.pl +++ b/tools/batchMod.pl @@ -117,9 +117,6 @@ if ($op eq "action") { my @replaces = $input->multi_param('regex_replace'); my @modifiers = $input->multi_param('regex_modifiers'); my @disabled = $input->multi_param('disable_input'); - # build indicator hash. - my @ind_tag = $input->multi_param('ind_tag'); - my @indicator = $input->multi_param('indicator'); # Is there something to modify ? # TODO : We shall use this var to warn the user in case no modification was done to the items @@ -131,7 +128,7 @@ if ($op eq "action") { #initializing values for updates my ( $itemtagfield, $itemtagsubfield) = &GetMarcFromKohaField( "items.itemnumber" ); if ($values_to_modify){ - my $xml = TransformHtmlToXml(\@tags,\@subfields,\@values,\@indicator,\@ind_tag, 'ITEM'); + my $xml = TransformHtmlToXml(\@tags,\@subfields,\@values,undef,undef, 'ITEM'); $marcitem = MARC::Record::new_from_xml($xml, 'UTF-8'); } if ($values_to_blank){ -- 2.39.5