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

(-)a/C4/Items.pm (-3 / +4 lines)
Lines 144-150 sub CartToShelf { Link Here
144
=head2 AddItemFromMarc
144
=head2 AddItemFromMarc
145
145
146
  my ($biblionumber, $biblioitemnumber, $itemnumber) 
146
  my ($biblionumber, $biblioitemnumber, $itemnumber) 
147
      = AddItemFromMarc($source_item_marc, $biblionumber);
147
      = AddItemFromMarc($source_item_marc, $biblionumber[, $dbh]);
148
148
149
Given a MARC::Record object containing an embedded item
149
Given a MARC::Record object containing an embedded item
150
record and a biblionumber, create a new item record.
150
record and a biblionumber, create a new item record.
Lines 152-159 record and a biblionumber, create a new item record. Link Here
152
=cut
152
=cut
153
153
154
sub AddItemFromMarc {
154
sub AddItemFromMarc {
155
    my ( $source_item_marc, $biblionumber ) = @_;
155
    my $source_item_marc        = shift;
156
    my $dbh = C4::Context->dbh;
156
    my $biblionumber            = shift;
157
    my $dbh                     = @_ ? shift : C4::Context->dbh;
157
158
158
    # parse item hash from MARC
159
    # parse item hash from MARC
159
    my $frameworkcode = C4::Biblio::GetFrameworkCode($biblionumber);
160
    my $frameworkcode = C4::Biblio::GetFrameworkCode($biblionumber);
(-)a/cataloguing/additem.pl (-3 / +2 lines)
Lines 501-507 if ($op eq "additem") { Link Here
501
501
502
        # if barcode exists, don't create, but report The problem.
502
        # if barcode exists, don't create, but report The problem.
503
        unless ($exist_itemnumber) {
503
        unless ($exist_itemnumber) {
504
            my ( $oldbiblionumber, $oldbibnum, $oldbibitemnum ) = AddItemFromMarc( $record, $biblionumber );
504
            my ( $oldbiblionumber, $oldbibnum, $oldbibitemnum ) = AddItemFromMarc( $record, $biblionumber, $dbh );
505
            set_item_default_location($oldbibitemnum);
505
            set_item_default_location($oldbibitemnum);
506
506
507
            # Pushing the last created item cookie back
507
            # Pushing the last created item cookie back
Lines 600-606 if ($op eq "additem") { Link Here
600
600
601
		# Adding the item
601
		# Adding the item
602
        if (!$exist_itemnumber) {
602
        if (!$exist_itemnumber) {
603
            my ($oldbiblionumber,$oldbibnum,$oldbibitemnum) = AddItemFromMarc($record,$biblionumber);
603
            my ($oldbiblionumber,$oldbibnum,$oldbibitemnum) = AddItemFromMarc( $record, $biblionumber, $dbh);
604
            set_item_default_location($oldbibitemnum);
604
            set_item_default_location($oldbibitemnum);
605
605
606
            # We count the item only if it was really added
606
            # We count the item only if it was really added
607
- 

Return to bug 24027