Lines 144-156
Given a MARC::Record object containing an embedded item
Link Here
|
144 |
record and a biblionumber, create a new item record. |
144 |
record and a biblionumber, create a new item record. |
145 |
|
145 |
|
146 |
The final optional parameter, C<$params>, expected to contain |
146 |
The final optional parameter, C<$params>, expected to contain |
147 |
'skip_modzebra_update' key, which relayed down to Koha::Item/store, |
147 |
'skip_record_index' key, which relayed down to Koha::Item/store, |
148 |
there it prevents calling of index_records, |
148 |
there it prevents calling of index_records, |
149 |
which takes most of the time in batch adds/deletes: index_records |
149 |
which takes most of the time in batch adds/deletes: index_records |
150 |
to be called later in C<additem.pl> after the whole loop. |
150 |
to be called later in C<additem.pl> after the whole loop. |
151 |
|
151 |
|
152 |
$params: |
152 |
$params: |
153 |
skip_modzebra_update => 1|0 |
153 |
skip_record_index => 1|0 |
154 |
|
154 |
|
155 |
=cut |
155 |
=cut |
156 |
|
156 |
|
Lines 174-180
sub AddItemFromMarc {
Link Here
|
174 |
$item_values->{biblionumber} = $biblionumber; |
174 |
$item_values->{biblionumber} = $biblionumber; |
175 |
$item_values->{cn_source} = delete $item_values->{'items.cn_source'}; # Because of C4::Biblio::_disambiguate |
175 |
$item_values->{cn_source} = delete $item_values->{'items.cn_source'}; # Because of C4::Biblio::_disambiguate |
176 |
$item_values->{cn_sort} = delete $item_values->{'items.cn_sort'}; # Because of C4::Biblio::_disambiguate |
176 |
$item_values->{cn_sort} = delete $item_values->{'items.cn_sort'}; # Because of C4::Biblio::_disambiguate |
177 |
my $item = Koha::Item->new( $item_values )->store({ skip_modzebra_update => $params->{skip_modzebra_update} }); |
177 |
my $item = Koha::Item->new( $item_values )->store({ skip_record_index => $params->{skip_record_index} }); |
178 |
return ( $item->biblionumber, $item->biblioitemnumber, $item->itemnumber ); |
178 |
return ( $item->biblionumber, $item->biblioitemnumber, $item->itemnumber ); |
179 |
} |
179 |
} |
180 |
|
180 |
|
Lines 287-299
sub AddItemBatchFromMarc {
Link Here
|
287 |
my $item = ModItemFromMarc($item_marc, $biblionumber, $itemnumber[, $params]); |
287 |
my $item = ModItemFromMarc($item_marc, $biblionumber, $itemnumber[, $params]); |
288 |
|
288 |
|
289 |
The final optional parameter, C<$params>, expected to contain |
289 |
The final optional parameter, C<$params>, expected to contain |
290 |
'skip_modzebra_update' key, which relayed down to Koha::Item/store, |
290 |
'skip_record_index' key, which relayed down to Koha::Item/store, |
291 |
there it prevents calling of index_records, |
291 |
there it prevents calling of index_records, |
292 |
which takes most of the time in batch adds/deletes: index_records better |
292 |
which takes most of the time in batch adds/deletes: index_records better |
293 |
to be called later in C<additem.pl> after the whole loop. |
293 |
to be called later in C<additem.pl> after the whole loop. |
294 |
|
294 |
|
295 |
$params: |
295 |
$params: |
296 |
skip_modzebra_update => 1|0 |
296 |
skip_record_index => 1|0 |
297 |
|
297 |
|
298 |
=cut |
298 |
=cut |
299 |
|
299 |
|
Lines 327-333
sub ModItemFromMarc {
Link Here
|
327 |
$item_object = $item_object->set_or_blank($item); |
327 |
$item_object = $item_object->set_or_blank($item); |
328 |
my $unlinked_item_subfields = _get_unlinked_item_subfields( $localitemmarc, $frameworkcode ); |
328 |
my $unlinked_item_subfields = _get_unlinked_item_subfields( $localitemmarc, $frameworkcode ); |
329 |
$item_object->more_subfields_xml(_get_unlinked_subfields_xml($unlinked_item_subfields)); |
329 |
$item_object->more_subfields_xml(_get_unlinked_subfields_xml($unlinked_item_subfields)); |
330 |
$item_object->store({ skip_modzebra_update => $params->{skip_modzebra_update} }); |
330 |
$item_object->store({ skip_record_index => $params->{skip_record_index} }); |
331 |
|
331 |
|
332 |
return $item_object->unblessed; |
332 |
return $item_object->unblessed; |
333 |
} |
333 |
} |