View | Details | Raw Unified | Return to bug 18816
Collapse All | Expand All

(-)a/C4/Items.pm (-13 / +6 lines)
Lines 510-516 sub ModItemFromMarc { Link Here
510
    }
510
    }
511
    my $unlinked_item_subfields = _get_unlinked_item_subfields( $localitemmarc, $frameworkcode );
511
    my $unlinked_item_subfields = _get_unlinked_item_subfields( $localitemmarc, $frameworkcode );
512
512
513
    ModItem($item, $biblionumber, $itemnumber, { frameworkcode => $frameworkcode, unlinked_item_subfields => $unlinked_item_subfields } );
513
    ModItem( $item, $biblionumber, $itemnumber, { unlinked_item_subfields => $unlinked_item_subfields } );
514
    return $item;
514
    return $item;
515
}
515
}
516
516
Lines 522-528 ModItem( Link Here
522
    $itemnumber,
522
    $itemnumber,
523
    {
523
    {
524
        [ unlinked_item_subfields => $unlinked_item_subfields, ]
524
        [ unlinked_item_subfields => $unlinked_item_subfields, ]
525
        [ frameworkcode => $frameworkcode, ]
526
        [ log_action => 1, ]
525
        [ log_action => 1, ]
527
    }
526
    }
528
);
527
);
Lines 533-541 the MARC representation of the item. Link Here
533
The first argument is a hashref mapping from item column
532
The first argument is a hashref mapping from item column
534
names to the new values.  The second and third arguments
533
names to the new values.  The second and third arguments
535
are the biblionumber and itemnumber, respectively.
534
are the biblionumber and itemnumber, respectively.
535
The fourth, optional parameter (additional_params) may contain the keys
536
unlinked_item_subfields and log_action.
536
537
537
The fourth, optional parameter, C<$unlinked_item_subfields>, contains
538
C<$unlinked_item_subfields> contains an arrayref containing
538
an arrayref containing subfields present in the original MARC
539
subfields present in the original MARC
539
representation of the item (e.g., from the item editor) that are
540
representation of the item (e.g., from the item editor) that are
540
not mapped to C<items> columns directly but should instead
541
not mapped to C<items> columns directly but should instead
541
be stored in C<items.more_subfields_xml> and included in 
542
be stored in C<items.more_subfields_xml> and included in 
Lines 552-567 If log_action is true or undefined, the action will be logged. Link Here
552
=cut
553
=cut
553
554
554
sub ModItem {
555
sub ModItem {
555
    my $item              = shift;
556
    my ( $item, $biblionumber, $itemnumber, $additional_params ) = @_;
556
    my $biblionumber      = shift;
557
    my $itemnumber        = shift;
558
    my $additional_params = shift;
559
560
    my $dbh = C4::Context->dbh;
561
562
    my $log_action = $additional_params->{log_action} // 1;
557
    my $log_action = $additional_params->{log_action} // 1;
563
    my $unlinked_item_subfields = $additional_params->{unlinked_item_subfields};
558
    my $unlinked_item_subfields = $additional_params->{unlinked_item_subfields};
564
    my $frameworkcode = $additional_params->{frameworkcode} || C4::Biblio::GetFrameworkCode($biblionumber);
565
559
566
    # if $biblionumber is undefined, get it from the current item
560
    # if $biblionumber is undefined, get it from the current item
567
    unless (defined $biblionumber) {
561
    unless (defined $biblionumber) {
568
- 

Return to bug 18816