Lines 497-503
sub ModItemFromMarc {
Link Here
|
497 |
my $biblionumber = shift; |
497 |
my $biblionumber = shift; |
498 |
my $itemnumber = shift; |
498 |
my $itemnumber = shift; |
499 |
|
499 |
|
500 |
my $dbh = C4::Context->dbh; |
|
|
501 |
my $frameworkcode = C4::Biblio::GetFrameworkCode($biblionumber); |
500 |
my $frameworkcode = C4::Biblio::GetFrameworkCode($biblionumber); |
502 |
my ( $itemtag, $itemsubfield ) = C4::Biblio::GetMarcFromKohaField( "items.itemnumber", $frameworkcode ); |
501 |
my ( $itemtag, $itemsubfield ) = C4::Biblio::GetMarcFromKohaField( "items.itemnumber", $frameworkcode ); |
503 |
|
502 |
|
Lines 511-523
sub ModItemFromMarc {
Link Here
|
511 |
} |
510 |
} |
512 |
my $unlinked_item_subfields = _get_unlinked_item_subfields( $localitemmarc, $frameworkcode ); |
511 |
my $unlinked_item_subfields = _get_unlinked_item_subfields( $localitemmarc, $frameworkcode ); |
513 |
|
512 |
|
514 |
ModItem($item, $biblionumber, $itemnumber, $dbh, $frameworkcode, $unlinked_item_subfields); |
513 |
ModItem($item, $biblionumber, $itemnumber, { frameworkcode => $frameworkcode, unlinked_item_subfields => $unlinked_item_subfields } ); |
515 |
return $item; |
514 |
return $item; |
516 |
} |
515 |
} |
517 |
|
516 |
|
518 |
=head2 ModItem |
517 |
=head2 ModItem |
519 |
|
518 |
|
520 |
ModItem({ column => $newvalue }, $biblionumber, $itemnumber, $log_action ); |
519 |
ModItem( |
|
|
520 |
{ column => $newvalue }, |
521 |
$biblionumber, |
522 |
$itemnumber, |
523 |
[$frameworkcode,], |
524 |
{ |
525 |
[ log_action => 1, ] |
526 |
[ unlinked_item_subfields => $unlinked_item_subfields, ] |
527 |
} |
528 |
); |
521 |
|
529 |
|
522 |
Change one or more columns in an item record and update |
530 |
Change one or more columns in an item record and update |
523 |
the MARC representation of the item. |
531 |
the MARC representation of the item. |
Lines 544-567
If log_action is true or undefined, the action will be logged.
Link Here
|
544 |
=cut |
552 |
=cut |
545 |
|
553 |
|
546 |
sub ModItem { |
554 |
sub ModItem { |
547 |
my $item = shift; |
555 |
my $item = shift; |
548 |
my $biblionumber = shift; |
556 |
my $biblionumber = shift; |
549 |
my $itemnumber = shift; |
557 |
my $itemnumber = shift; |
550 |
my $additional_params = shift; |
558 |
my $additional_params = shift; |
551 |
|
559 |
|
|
|
560 |
my $dbh = C4::Context->dbh; |
561 |
|
552 |
my $log_action = $additional_params->{log_action} // 1; |
562 |
my $log_action = $additional_params->{log_action} // 1; |
|
|
563 |
my $unlinked_item_subfields = $additional_params->{unlinked_item_subfields}; |
564 |
my $frameworkcode = $additional_params->{frameworkcode} || C4::Biblio::GetFrameworkCode($biblionumber); |
553 |
|
565 |
|
554 |
# if $biblionumber is undefined, get it from the current item |
566 |
# if $biblionumber is undefined, get it from the current item |
555 |
unless (defined $biblionumber) { |
567 |
unless (defined $biblionumber) { |
556 |
$biblionumber = _get_single_item_column('biblionumber', $itemnumber); |
568 |
$biblionumber = _get_single_item_column('biblionumber', $itemnumber); |
557 |
} |
569 |
} |
558 |
|
570 |
|
559 |
my $dbh = @_ ? shift : C4::Context->dbh; |
571 |
if ($unlinked_item_subfields) { |
560 |
my $frameworkcode = @_ ? shift : C4::Biblio::GetFrameworkCode( $biblionumber ); |
|
|
561 |
|
562 |
my $unlinked_item_subfields; |
563 |
if (@_) { |
564 |
$unlinked_item_subfields = shift; |
565 |
$item->{'more_subfields_xml'} = _get_unlinked_subfields_xml($unlinked_item_subfields); |
572 |
$item->{'more_subfields_xml'} = _get_unlinked_subfields_xml($unlinked_item_subfields); |
566 |
}; |
573 |
}; |
567 |
|
574 |
|
568 |
- |
|
|