Lines 2039-2044
sub link_marc_bundled_item {
Link Here
|
2039 |
return $self; |
2039 |
return $self; |
2040 |
} |
2040 |
} |
2041 |
|
2041 |
|
|
|
2042 |
=head3 unlink_marc_bundled_item |
2043 |
|
2044 |
$biblio->unlink_marc_bundled_item({ bundled_item => $item }); |
2045 |
$biblio->unlink_marc_bundled_item({ bundled_item => $itemnumber }); |
2046 |
|
2047 |
Remove the link to the child created by link_marc_bundled_item. Expects either the item object or itemnumber of the host to link to. |
2048 |
|
2049 |
=cut |
2050 |
|
2051 |
sub unlink_marc_bundled_item { |
2052 |
my ( $self, $params ) = @_; |
2053 |
my $bundled_item_itemnumber; |
2054 |
if ( ref( $params->{bundled_item} ) eq 'Koha::Item' ) { |
2055 |
$bundled_item_itemnumber = $params->{bundled_item}->itemnumber; |
2056 |
} else { |
2057 |
$bundled_item_itemnumber = $params->{bundled_item}; |
2058 |
} |
2059 |
|
2060 |
my $record = $self->metadata->record; |
2061 |
my $field_number = C4::Context->preference('marcflavour') eq 'MARC21' ? '774' : '462'; |
2062 |
my @fields = $record->field($field_number); |
2063 |
|
2064 |
foreach my $field (@fields) { |
2065 |
my $subfield_itemnumber = $field->subfield('9') // q{}; |
2066 |
if ( $bundled_item_itemnumber eq $subfield_itemnumber ) { |
2067 |
$record->delete_field($field); |
2068 |
} |
2069 |
} |
2070 |
|
2071 |
C4::Biblio::ModBiblio( $record, $self->biblionumber ); |
2072 |
} |
2073 |
|
2042 |
=head3 recalls |
2074 |
=head3 recalls |
2043 |
|
2075 |
|
2044 |
my $recalls = $biblio->recalls; |
2076 |
my $recalls = $biblio->recalls; |