View | Details | Raw Unified | Return to bug 6681
Collapse All | Expand All

(-)a/C4/Biblio.pm (+38 lines)
Lines 133-138 BEGIN { Link Here
133
      &TransformHtmlToXml
133
      &TransformHtmlToXml
134
      &PrepareItemrecordDisplay
134
      &PrepareItemrecordDisplay
135
      &GetNoZebraIndexes
135
      &GetNoZebraIndexes
136
      &RemoveItemsAndAuthidsFromRecord
136
    );
137
    );
137
}
138
}
138
139
Lines 2831-2836 sub GetNoZebraIndexes { Link Here
2831
    return %indexes;
2832
    return %indexes;
2832
}
2833
}
2833
2834
2835
=head2 RemoveItemsAndAuthidsFromRecord
2836
2837
  RemoveItemsAndAuthidsFromRecord($record);
2838
2839
  Remove all items (952) from the record.
2840
  Also removes all authids (subfield 9 in headings)
2841
2842
=cut
2843
2844
sub RemoveItemsAndAuthidsFromRecord {
2845
    my $record = shift;
2846
    my $frameworkcode = shift || '';
2847
2848
    my $marcflavour = C4::Context->preference("marcflavour");
2849
    my ( $itemtag, $itemsubfield ) = GetMarcFromKohaField( "items.itemnumber", $frameworkcode );
2850
2851
    # Remove all the items from the record
2852
    foreach my $item ($record->field($itemtag)) {
2853
        $record->delete_field($item);
2854
    }
2855
2856
    # Remove all authid links ($9) in the record (MARC21 Version)
2857
    if ( $marcflavour eq "MARC21" ) {
2858
        foreach my $heading qw(100 110 111 130 440 600 610 611 630 648 650 651 655 700 710 711 730 800 810 811 830) {
2859
            foreach my $field ($record->field($heading)) {
2860
                $field->delete_subfield(code => '9');
2861
                unless($field->subfields()) {
2862
                    $record->delete_field($field);
2863
                }
2864
            }
2865
        }
2866
    }
2867
2868
    # TODO : Add code to remove authority links for other marcflavours
2869
2870
}
2871
2834
=head2 EmbedItemsInMarcBiblio
2872
=head2 EmbedItemsInMarcBiblio
2835
2873
2836
    EmbedItemsInMarcBiblio($marc, $biblionumber);
2874
    EmbedItemsInMarcBiblio($marc, $biblionumber);
(-)a/acqui/neworderempty.pl (-4 / +2 lines)
Lines 132-141 if ( $ordernumber eq '' and defined $params->{'breedingid'}){ Link Here
132
    my ($marcrecord, $encoding) = MARCfindbreeding($params->{'breedingid'});
132
    my ($marcrecord, $encoding) = MARCfindbreeding($params->{'breedingid'});
133
    die("Could not find the selected record in the reservoir, bailing") unless $marcrecord;
133
    die("Could not find the selected record in the reservoir, bailing") unless $marcrecord;
134
134
135
    # Remove all the items (952) from the imported record
135
    # Do a cleanup on the imported record
136
    foreach my $item ($marcrecord->field('952')) {
136
    RemoveItemsAndAuthidsFromRecord($marcrecord, $params->{'frameworkcode'});
137
        $marcrecord->delete_field($item);
138
    }
139
137
140
    my $duplicatetitle;
138
    my $duplicatetitle;
141
#look for duplicates
139
#look for duplicates
(-)a/cataloguing/addbiblio.pl (-1 / +1 lines)
Lines 909-914 if (($biblionumber) && !($breedingid)){ Link Here
909
}
909
}
910
if ($breedingid) {
910
if ($breedingid) {
911
    ( $record, $encoding ) = MARCfindbreeding( $breedingid ) ;
911
    ( $record, $encoding ) = MARCfindbreeding( $breedingid ) ;
912
    RemoveItemsAndAuthidsFromRecord($record, $frameworkcode) if $record;
912
}
913
}
913
#populate hostfield if hostbiblionumber is available
914
#populate hostfield if hostbiblionumber is available
914
if ($hostbiblionumber){
915
if ($hostbiblionumber){
915
- 

Return to bug 6681