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

(-)a/cataloguing/additem.pl (-1 / +14 lines)
Lines 88-93 sub set_item_default_location { Link Here
88
    $item->store;
88
    $item->store;
89
}
89
}
90
90
91
sub _barcodedecode {
92
    my ($record) = @_;
93
94
    my ($tagfield, $tagsubfield) = GetMarcFromKohaField('items.barcode');
95
    my $item_field = $record->field($tagfield);
96
    my $barcode = $item_field->subfield($tagsubfield);
97
    if ($barcode) {
98
        $barcode = barcodedecode($barcode);
99
        $item_field->update($tagsubfield => $barcode);
100
    }
101
}
102
91
# NOTE: This code is subject to change in the future with the implemenation of ajax based autobarcode code
103
# NOTE: This code is subject to change in the future with the implemenation of ajax based autobarcode code
92
# NOTE: 'incremental' is the ONLY autoBarcode option available to those not using javascript
104
# NOTE: 'incremental' is the ONLY autoBarcode option available to those not using javascript
93
sub _increment_barcode {
105
sub _increment_barcode {
Lines 511-516 if ($op eq "additem") { Link Here
511
    $add_duplicate_submit = 1 if ($prefillitem);
523
    $add_duplicate_submit = 1 if ($prefillitem);
512
    $justaddeditem = 1;
524
    $justaddeditem = 1;
513
525
526
    _barcodedecode($record);
527
514
    # if autoBarcode is set to 'incremental', calculate barcode...
528
    # if autoBarcode is set to 'incremental', calculate barcode...
515
    if ( C4::Context->preference('autoBarcode') eq 'incremental' ) {
529
    if ( C4::Context->preference('autoBarcode') eq 'incremental' ) {
516
        $record = _increment_barcode($record, $frameworkcode);
530
        $record = _increment_barcode($record, $frameworkcode);
517
- 

Return to bug 22204