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

(-)a/cataloguing/additem.pl (-8 / +7 lines)
Lines 62-68 sub add_item_to_item_group { Link Here
62
    if ( $item_group eq 'create' ) {
62
    if ( $item_group eq 'create' ) {
63
        my $item_group = Koha::Biblio::ItemGroup->new(
63
        my $item_group = Koha::Biblio::ItemGroup->new(
64
            {
64
            {
65
                biblionumber => $biblionumber,
65
                biblio_id => $biblionumber,
66
                description  => $item_group_description,
66
                description  => $item_group_description,
67
            }
67
            }
68
        )->store();
68
        )->store();
Lines 75-81 sub add_item_to_item_group { Link Here
75
75
76
    my $item_group_item = Koha::Biblio::ItemGroup::Item->new(
76
    my $item_group_item = Koha::Biblio::ItemGroup::Item->new(
77
        {
77
        {
78
            itemnumber => $itemnumber,
78
            item_id => $itemnumber,
79
            item_group_id  => $item_group_id,
79
            item_group_id  => $item_group_id,
80
        }
80
        }
81
    )->store();
81
    )->store();
Lines 134-141 my $fa_barcode = $input->param('barcode'); Link Here
134
my $fa_branch             = $input->param('branch');
134
my $fa_branch             = $input->param('branch');
135
my $fa_stickyduedate      = $input->param('stickyduedate');
135
my $fa_stickyduedate      = $input->param('stickyduedate');
136
my $fa_duedatespec        = $input->param('duedatespec');
136
my $fa_duedatespec        = $input->param('duedatespec');
137
my $volume                = $input->param('volume');
137
my $item_group                = $input->param('item_group');
138
my $volume_description    = $input->param('volume_description');
138
my $item_group_description    = $input->param('item_group_description');
139
139
140
our $frameworkcode = &GetFrameworkCode($biblionumber);
140
our $frameworkcode = &GetFrameworkCode($biblionumber);
141
141
Lines 330-338 if ($op eq "additem") { Link Here
330
330
331
            $current_item = $item->unblessed; # Restore edit form for the same item
331
            $current_item = $item->unblessed; # Restore edit form for the same item
332
        }
332
        }
333
        else {
333
        unless ( @errors ) {
334
            $item->store->discard_changes;
334
            $item->store->discard_changes;
335
            add_item_to_item_group( $item->biblionumber, $item->biblioitemnumber, $volume, $volume_description );
335
            add_item_to_item_group( $item->biblionumber, $item->itemnumber, $item_group, $item_group_description );
336
336
337
            # This is a bit tricky : if there is a cookie for the last created item and
337
            # This is a bit tricky : if there is a cookie for the last created item and
338
            # we just added an item, the cookie value is not correct yet (it will be updated
338
            # we just added an item, the cookie value is not correct yet (it will be updated
Lines 443-449 if ($op eq "additem") { Link Here
443
                        { skip_record_index => 1 } );
443
                        { skip_record_index => 1 } );
444
                    $current_item->discard_changes; # Cannot chain discard_changes
444
                    $current_item->discard_changes; # Cannot chain discard_changes
445
                    $current_item = $current_item->unblessed;
445
                    $current_item = $current_item->unblessed;
446
                    add_item_to_item_group( $item->biblionumber, $item->biblioitemnumber, $volume, $volume_description );
446
                    add_item_to_item_group( $item->biblionumber, $item->biblioitemnumber, $item_group, $item_group_description );
447
447
448
# We count the item only if it was really added
448
# We count the item only if it was really added
449
# That way, all items are added, even if there was some already existing barcodes
449
# That way, all items are added, even if there was some already existing barcodes
450
- 

Return to bug 33639