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

(-)a/cataloguing/additem.pl (-1 / +15 lines)
Lines 84-89 sub get_item_from_barcode { Link Here
84
    return($result);
84
    return($result);
85
}
85
}
86
86
87
sub _trim_barcode {
88
    my ($record) = @_;
89
90
    my ($tagfield, $tagsubfield) = GetMarcFromKohaField('items.barcode');
91
    my $item_field = $record->field($tagfield);
92
    my $barcode = $item_field->subfield($tagsubfield);
93
    if ($barcode) {
94
        $barcode =~ s/^\s+//;
95
        $barcode =~ s/\s+$//;
96
        $item_field->update($tagsubfield => $barcode);
97
    }
98
}
99
87
# NOTE: This code is subject to change in the future with the implemenation of ajax based autobarcode code
100
# NOTE: This code is subject to change in the future with the implemenation of ajax based autobarcode code
88
# NOTE: 'incremental' is the ONLY autoBarcode option available to those not using javascript
101
# NOTE: 'incremental' is the ONLY autoBarcode option available to those not using javascript
89
sub _increment_barcode {
102
sub _increment_barcode {
Lines 512-517 if ($op eq "additem") { Link Here
512
    $add_duplicate_submit = 1 if ($prefillitem);
525
    $add_duplicate_submit = 1 if ($prefillitem);
513
    $justaddeditem = 1;
526
    $justaddeditem = 1;
514
527
528
    _trim_barcode($record);
529
515
    # if autoBarcode is set to 'incremental', calculate barcode...
530
    # if autoBarcode is set to 'incremental', calculate barcode...
516
    if ( C4::Context->preference('autoBarcode') eq 'incremental' ) {
531
    if ( C4::Context->preference('autoBarcode') eq 'incremental' ) {
517
        $record = _increment_barcode($record, $frameworkcode);
532
        $record = _increment_barcode($record, $frameworkcode);
518
- 

Return to bug 22204