Lines 222-231
sub AddItemFromMarc {
Link Here
|
222 |
# parse item hash from MARC |
222 |
# parse item hash from MARC |
223 |
my $frameworkcode = C4::Biblio::GetFrameworkCode( $biblionumber ); |
223 |
my $frameworkcode = C4::Biblio::GetFrameworkCode( $biblionumber ); |
224 |
my ($itemtag,$itemsubfield)=C4::Biblio::GetMarcFromKohaField("items.itemnumber",$frameworkcode); |
224 |
my ($itemtag,$itemsubfield)=C4::Biblio::GetMarcFromKohaField("items.itemnumber",$frameworkcode); |
225 |
|
225 |
|
226 |
my $localitemmarc=MARC::Record->new; |
226 |
my $localitemmarc=MARC::Record->new; |
227 |
$localitemmarc->append_fields($source_item_marc->field($itemtag)); |
227 |
$localitemmarc->append_fields($source_item_marc->field($itemtag)); |
228 |
my $item = TransformMarcToKoha( $localitemmarc, $frameworkcode ,'items'); |
228 |
my $item = C4::Biblio::TransformMarcToKoha( $localitemmarc, $frameworkcode ,'items'); |
229 |
my $unlinked_item_subfields = _get_unlinked_item_subfields($localitemmarc, $frameworkcode); |
229 |
my $unlinked_item_subfields = _get_unlinked_item_subfields($localitemmarc, $frameworkcode); |
230 |
return AddItem($item, $biblionumber, $dbh, $frameworkcode, $unlinked_item_subfields); |
230 |
return AddItem($item, $biblionumber, $dbh, $frameworkcode, $unlinked_item_subfields); |
231 |
} |
231 |
} |
Lines 284-290
sub AddItem {
Link Here
|
284 |
|
284 |
|
285 |
$item->{'itemnumber'} = $itemnumber; |
285 |
$item->{'itemnumber'} = $itemnumber; |
286 |
|
286 |
|
287 |
ModZebra( $item->{biblionumber}, "specialUpdate", "biblioserver" ); |
287 |
C4::Biblio::ModZebra( $item->{biblionumber}, "specialUpdate", "biblioserver" ); |
288 |
|
288 |
|
289 |
logaction( "CATALOGUING", "ADD", $itemnumber, "item" ) |
289 |
logaction( "CATALOGUING", "ADD", $itemnumber, "item" ) |
290 |
if C4::Context->preference("CataloguingLog"); |
290 |
if C4::Context->preference("CataloguingLog"); |
Lines 2032-2038
sub _get_unlinked_item_subfields {
Link Here
|
2032 |
my $original_item_marc = shift; |
2032 |
my $original_item_marc = shift; |
2033 |
my $frameworkcode = shift; |
2033 |
my $frameworkcode = shift; |
2034 |
|
2034 |
|
2035 |
my $marcstructure = GetMarcStructure(1, $frameworkcode, { unsafe => 1 }); |
2035 |
my $marcstructure = C4::Biblio::GetMarcStructure(1, $frameworkcode, { unsafe => 1 }); |
2036 |
|
2036 |
|
2037 |
# assume that this record has only one field, and that that |
2037 |
# assume that this record has only one field, and that that |
2038 |
# field contains only the item information |
2038 |
# field contains only the item information |