Lines 2095-2100
sub link_marc_bundled_item {
Link Here
|
2095 |
return $self; |
2095 |
return $self; |
2096 |
} |
2096 |
} |
2097 |
|
2097 |
|
|
|
2098 |
=head3 unlink_marc_bundled_item |
2099 |
|
2100 |
$biblio->unlink_marc_bundled_item({ bundled_item => $item }); |
2101 |
$biblio->unlink_marc_bundled_item({ bundled_item => $itemnumber }); |
2102 |
|
2103 |
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. |
2104 |
|
2105 |
=cut |
2106 |
|
2107 |
sub unlink_marc_bundled_item { |
2108 |
my ( $self, $params ) = @_; |
2109 |
my $bundled_item_itemnumber; |
2110 |
if ( ref( $params->{bundled_item} ) eq 'Koha::Item' ) { |
2111 |
$bundled_item_itemnumber = $params->{bundled_item}->itemnumber; |
2112 |
} else { |
2113 |
$bundled_item_itemnumber = $params->{bundled_item}; |
2114 |
} |
2115 |
|
2116 |
my $record = $self->metadata->record; |
2117 |
my $field_number = C4::Context->preference('marcflavour') eq 'MARC21' ? '774' : '462'; |
2118 |
my @fields = $record->field($field_number); |
2119 |
|
2120 |
foreach my $field (@fields) { |
2121 |
my $subfield_itemnumber = $field->subfield('9') // q{}; |
2122 |
if ( $bundled_item_itemnumber eq $subfield_itemnumber ) { |
2123 |
$record->delete_field($field); |
2124 |
} |
2125 |
} |
2126 |
|
2127 |
C4::Biblio::ModBiblio( $record, $self->biblionumber ); |
2128 |
} |
2129 |
|
2098 |
=head3 recalls |
2130 |
=head3 recalls |
2099 |
|
2131 |
|
2100 |
my $recalls = $biblio->recalls; |
2132 |
my $recalls = $biblio->recalls; |