Bug 29111: Remove unused indicator modification code for items
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 <stalkernoid@gmail.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Rebased-by: Joonas Kylmälä <joonas.kylmala@iki.fi> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
parent
39f7b7140d
commit
f808671295
|
|
@ -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');
|
||||
|
|
|
|||
|
|
@ -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 );
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -247,8 +247,6 @@
|
|||
[% END %]
|
||||
</ol>
|
||||
</fieldset>
|
||||
<input type="hidden" name="indicator" value=" " />
|
||||
<input type="hidden" name="indicator" value=" " />
|
||||
[% IF op != 'add_item' %]
|
||||
<input type="hidden" name="itemnumber" value="[% itemnumber | html %]" />
|
||||
[% END %]
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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){
|
||||
|
|
|
|||
Loading…
Reference in New Issue