|
Lines 70-75
use Koha::Biblioitems;
Link Here
|
| 70 |
use Koha::Items; |
70 |
use Koha::Items; |
| 71 |
use Koha::ItemTypes; |
71 |
use Koha::ItemTypes; |
| 72 |
use Koha::SearchEngine; |
72 |
use Koha::SearchEngine; |
|
|
73 |
use Koha::SearchEngine::Indexer; |
| 73 |
use Koha::SearchEngine::Search; |
74 |
use Koha::SearchEngine::Search; |
| 74 |
use Koha::Libraries; |
75 |
use Koha::Libraries; |
| 75 |
|
76 |
|
|
Lines 144-151
record and a biblionumber, create a new item record.
Link Here
|
| 144 |
|
145 |
|
| 145 |
The final optional parameter, C<$params>, expected to contain |
146 |
The final optional parameter, C<$params>, expected to contain |
| 146 |
'skip_modzebra_update' key, which relayed down to Koha::Item/store, |
147 |
'skip_modzebra_update' key, which relayed down to Koha::Item/store, |
| 147 |
there it prevents calling of ModZebra (and Elasticsearch update), |
148 |
there it prevents calling of index_records, |
| 148 |
which takes most of the time in batch adds/deletes: ModZebra better |
149 |
which takes most of the time in batch adds/deletes: index_records |
| 149 |
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. |
| 150 |
|
151 |
|
| 151 |
$params: |
152 |
$params: |
|
Lines 281-290
sub AddItemBatchFromMarc {
Link Here
|
| 281 |
return (\@itemnumbers, \@errors); |
282 |
return (\@itemnumbers, \@errors); |
| 282 |
} |
283 |
} |
| 283 |
|
284 |
|
|
|
285 |
=head2 ModItemFromMarc |
| 286 |
|
| 287 |
my $item = ModItemFromMarc($item_marc, $biblionumber, $itemnumber[, $params]); |
| 288 |
|
| 289 |
The final optional parameter, C<$params>, expected to contain |
| 290 |
'skip_modzebra_update' key, which relayed down to Koha::Item/store, |
| 291 |
there it prevents calling of index_records, |
| 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. |
| 294 |
|
| 295 |
$params: |
| 296 |
skip_modzebra_update => 1|0 |
| 297 |
|
| 298 |
=cut |
| 299 |
|
| 284 |
sub ModItemFromMarc { |
300 |
sub ModItemFromMarc { |
| 285 |
my $item_marc = shift; |
301 |
my ( $item_marc, $biblionumber, $itemnumber, $params ) = @_; |
| 286 |
my $biblionumber = shift; |
|
|
| 287 |
my $itemnumber = shift; |
| 288 |
|
302 |
|
| 289 |
my $frameworkcode = C4::Biblio::GetFrameworkCode($biblionumber); |
303 |
my $frameworkcode = C4::Biblio::GetFrameworkCode($biblionumber); |
| 290 |
my ( $itemtag, $itemsubfield ) = C4::Biblio::GetMarcFromKohaField( "items.itemnumber" ); |
304 |
my ( $itemtag, $itemsubfield ) = C4::Biblio::GetMarcFromKohaField( "items.itemnumber" ); |
|
Lines 313-319
sub ModItemFromMarc {
Link Here
|
| 313 |
$item_object = $item_object->set_or_blank($item); |
327 |
$item_object = $item_object->set_or_blank($item); |
| 314 |
my $unlinked_item_subfields = _get_unlinked_item_subfields( $localitemmarc, $frameworkcode ); |
328 |
my $unlinked_item_subfields = _get_unlinked_item_subfields( $localitemmarc, $frameworkcode ); |
| 315 |
$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)); |
| 316 |
$item_object->store; |
330 |
$item_object->store({ skip_modzebra_update => $params->{skip_modzebra_update} }); |
| 317 |
|
331 |
|
| 318 |
return $item_object->unblessed; |
332 |
return $item_object->unblessed; |
| 319 |
} |
333 |
} |
|
Lines 1094-1101
sub MoveItemFromBiblio {
Link Here
|
| 1094 |
AND biblionumber = ? |
1108 |
AND biblionumber = ? |
| 1095 |
|, undef, $tobiblioitem, $tobiblio, $itemnumber, $frombiblio ); |
1109 |
|, undef, $tobiblioitem, $tobiblio, $itemnumber, $frombiblio ); |
| 1096 |
if ($return == 1) { |
1110 |
if ($return == 1) { |
| 1097 |
ModZebra( $tobiblio, "specialUpdate", "biblioserver" ); |
1111 |
my $indexer = Koha::SearchEngine::Indexer->new({ index => $Koha::SearchEngine::BIBLIOS_INDEX }); |
| 1098 |
ModZebra( $frombiblio, "specialUpdate", "biblioserver" ); |
1112 |
$indexer->index_records( $tobiblio, "specialUpdate", "biblioserver" ); |
|
|
1113 |
$indexer->index_records( $frombiblio, "specialUpdate", "biblioserver" ); |
| 1099 |
# Checking if the item we want to move is in an order |
1114 |
# Checking if the item we want to move is in an order |
| 1100 |
require C4::Acquisition; |
1115 |
require C4::Acquisition; |
| 1101 |
my $order = C4::Acquisition::GetOrderFromItemnumber($itemnumber); |
1116 |
my $order = C4::Acquisition::GetOrderFromItemnumber($itemnumber); |