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 2828-2833
sub GetNoZebraIndexes {
Link Here
|
2828 |
return %indexes; |
2829 |
return %indexes; |
2829 |
} |
2830 |
} |
2830 |
|
2831 |
|
|
|
2832 |
=head2 RemoveItemsAndAuthidsFromRecord |
2833 |
|
2834 |
RemoveItemsAndAuthidsFromRecord($record); |
2835 |
|
2836 |
Remove all items (952) from the record. |
2837 |
Also removes all authids (subfield 9 in headings) |
2838 |
|
2839 |
=cut |
2840 |
|
2841 |
sub RemoveItemsAndAuthidsFromRecord { |
2842 |
my $record = shift; |
2843 |
my $frameworkcode = shift || ''; |
2844 |
|
2845 |
my $marcflavour = C4::Context->preference("marcflavour"); |
2846 |
my ( $itemtag, $itemsubfield ) = GetMarcFromKohaField( "items.itemnumber", $frameworkcode ); |
2847 |
|
2848 |
# Remove all the items from the record |
2849 |
foreach my $item ($record->field($itemtag)) { |
2850 |
$record->delete_field($item); |
2851 |
} |
2852 |
|
2853 |
# Remove all authid links ($9) in the record (MARC21 Version) |
2854 |
if ( $marcflavour eq "MARC21" ) { |
2855 |
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) { |
2856 |
foreach my $field ($record->field($heading)) { |
2857 |
$field->delete_subfield(code => '9'); |
2858 |
unless($field->subfields()) { |
2859 |
$record->delete_field($field); |
2860 |
} |
2861 |
} |
2862 |
} |
2863 |
} |
2864 |
|
2865 |
# TODO : Add code to remove authority links for other marcflavours |
2866 |
|
2867 |
} |
2868 |
|
2831 |
=head2 EmbedItemsInMarcBiblio |
2869 |
=head2 EmbedItemsInMarcBiblio |
2832 |
|
2870 |
|
2833 |
EmbedItemsInMarcBiblio($marc, $biblionumber); |
2871 |
EmbedItemsInMarcBiblio($marc, $biblionumber); |