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

(-)a/C4/Items.pm (-5 / +8 lines)
Lines 1525-1531 sub _find_value { Link Here
1525
1525
1526
=head2 PrepareItemrecordDisplay
1526
=head2 PrepareItemrecordDisplay
1527
1527
1528
  PrepareItemrecordDisplay($bibnum,$itemumber,$defaultvalues,$frameworkcode);
1528
  PrepareItemrecordDisplay($bibnum,$itemumber,$defaultvalues,$frameworkcode, $use_defaults);
1529
1529
1530
Returns a hash with all the fields for Display a given item data in a template
1530
Returns a hash with all the fields for Display a given item data in a template
1531
1531
Lines 1533-1543 $defaultvalues should either contain a hashref of values for the new item, or be Link Here
1533
1533
1534
The $frameworkcode returns the item for the given frameworkcode, ONLY if bibnum is not provided
1534
The $frameworkcode returns the item for the given frameworkcode, ONLY if bibnum is not provided
1535
1535
1536
If $use_defaults is true, the returned item values will be generated from the default values only.
1537
1536
=cut
1538
=cut
1537
1539
1538
sub PrepareItemrecordDisplay {
1540
sub PrepareItemrecordDisplay {
1539
1541
1540
    my ( $bibnum, $itemnum, $defaultvalues, $frameworkcode ) = @_;
1542
    my ( $bibnum, $itemnum, $defaultvalues, $frameworkcode, $use_defaults ) = @_;
1541
1543
1542
    my $dbh = C4::Context->dbh;
1544
    my $dbh = C4::Context->dbh;
1543
    $frameworkcode = C4::Biblio::GetFrameworkCode($bibnum) if $bibnum;
1545
    $frameworkcode = C4::Biblio::GetFrameworkCode($bibnum) if $bibnum;
Lines 1557-1567 sub PrepareItemrecordDisplay { Link Here
1557
    # return nothing if we don't have found an existing framework.
1559
    # return nothing if we don't have found an existing framework.
1558
    return q{} unless $tagslib;
1560
    return q{} unless $tagslib;
1559
    my $itemrecord;
1561
    my $itemrecord;
1560
    if ($itemnum) {
1562
    if ($use_defaults) {
1561
        $itemrecord = C4::Items::GetMarcItem( $bibnum, $itemnum );
1562
    }elsif ($defaultvalues && $defaultvalues->{'itemrecord'} ) {
1563
        $itemrecord = $defaultvalues->{'itemrecord'};
1563
        $itemrecord = $defaultvalues->{'itemrecord'};
1564
    }
1564
    }
1565
    elsif ($itemnum) {
1566
        $itemrecord = C4::Items::GetMarcItem( $bibnum, $itemnum );
1567
    }
1565
    my @loop_data;
1568
    my @loop_data;
1566
1569
1567
    my $branch_limit = C4::Context->userenv ? C4::Context->userenv->{"branch"} : "";
1570
    my $branch_limit = C4::Context->userenv ? C4::Context->userenv->{"branch"} : "";
(-)a/acqui/neworderempty.pl (-2 / +1 lines)
Lines 675-681 sub staged_items_field { Link Here
675
                    'branchcode'=>_trim($iteminfos->{homebranch})
675
                    'branchcode'=>_trim($iteminfos->{homebranch})
676
                );
676
                );
677
                $all_items_quantity++;
677
                $all_items_quantity++;
678
                my $itemprocessed = PrepareItemrecordDisplay('', '', \%defaultvalues , 'ACQ');
678
                my $itemprocessed = PrepareItemrecordDisplay('', '', \%defaultvalues , 'ACQ', 1);
679
                push @itemlist, $itemprocessed->{'iteminformation'};
679
                push @itemlist, $itemprocessed->{'iteminformation'};
680
            }
680
            }
681
        }
681
        }
682
- 

Return to bug 20817