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

(-)a/C4/Circulation.pm (+2 lines)
Lines 154-159 Will do some manipulation of the barcode for systems that deliver a barcode Link Here
154
to circulation.pl that differs from the barcode stored for the item.
154
to circulation.pl that differs from the barcode stored for the item.
155
For proper functioning of this filter, calling the function on the 
155
For proper functioning of this filter, calling the function on the 
156
correct barcode string (items.barcode) should return an unaltered barcode.
156
correct barcode string (items.barcode) should return an unaltered barcode.
157
Barcode is going to be automatically trimmed of leading/trailing whitespaces.
157
158
158
The optional $filter argument is to allow for testing or explicit 
159
The optional $filter argument is to allow for testing or explicit 
159
behavior that ignores the System Pref.  Valid values are the same as the 
160
behavior that ignores the System Pref.  Valid values are the same as the 
Lines 167-172 System Pref options. Link Here
167
sub barcodedecode {
168
sub barcodedecode {
168
    my ($barcode, $filter) = @_;
169
    my ($barcode, $filter) = @_;
169
    my $branch = C4::Context::mybranch();
170
    my $branch = C4::Context::mybranch();
171
    $barcode =~ s/^\s+|\s+$//g;
170
    $filter = C4::Context->preference('itemBarcodeInputFilter') unless $filter;
172
    $filter = C4::Context->preference('itemBarcodeInputFilter') unless $filter;
171
    Koha::Plugins->call('item_barcode_transform',  \$barcode );
173
    Koha::Plugins->call('item_barcode_transform',  \$barcode );
172
    $filter or return $barcode;     # ensure filter is defined, else return untouched barcode
174
    $filter or return $barcode;     # ensure filter is defined, else return untouched barcode
(-)a/circ/circulation.pl (-1 lines)
Lines 158-164 if (C4::Context->preference("DisplayClearScreenButton")) { Link Here
158
}
158
}
159
159
160
for my $barcode ( @$barcodes ) {
160
for my $barcode ( @$barcodes ) {
161
    $barcode =~ s/^\s*|\s*$//g; # remove leading/trailing whitespace
162
    $barcode = barcodedecode( $barcode ) if $barcode;
161
    $barcode = barcodedecode( $barcode ) if $barcode;
163
}
162
}
164
163
(-)a/circ/renew.pl (-1 lines)
Lines 43-49 my $schema = Koha::Database->new()->schema(); Link Here
43
43
44
my $barcode        = $cgi->param('barcode') // '';
44
my $barcode        = $cgi->param('barcode') // '';
45
my $unseen         = $cgi->param('unseen') || 0;
45
my $unseen         = $cgi->param('unseen') || 0;
46
$barcode =~ s/^\s*|\s*$//g; # remove leading/trailing whitespae
47
$barcode = barcodedecode($barcode) if $barcode;
46
$barcode = barcodedecode($barcode) if $barcode;
48
my $override_limit = $cgi->param('override_limit');
47
my $override_limit = $cgi->param('override_limit');
49
my $override_holds = $cgi->param('override_holds');
48
my $override_holds = $cgi->param('override_holds');
(-)a/circ/returns.pl (-1 lines)
Lines 119-125 foreach ( $query->param ) { Link Here
119
    $counter++;
119
    $counter++;
120
120
121
    # decode barcode    ## Didn't we already decode them before passing them back last time??
121
    # decode barcode    ## Didn't we already decode them before passing them back last time??
122
    $barcode =~ s/^\s*|\s*$//g; # remove leading/trailing whitespace
123
    $barcode = barcodedecode($barcode) if $barcode;
122
    $barcode = barcodedecode($barcode) if $barcode;
124
123
125
    ######################
124
    ######################
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (-2 / +1 lines)
Lines 35-41 Circulation: Link Here
35
                  T-prefix: Remove the first number from T-prefix style
35
                  T-prefix: Remove the first number from T-prefix style
36
                  libsuite8: Convert from Libsuite8 form
36
                  libsuite8: Convert from Libsuite8 form
37
                  EAN13: EAN-13 or zero-padded UPC-A form
37
                  EAN13: EAN-13 or zero-padded UPC-A form
38
            - scanned item barcodes.
38
            - scanned item barcodes. Mind that barcode whitespaces always trimmed from both ends before this filter.
39
        -
39
        -
40
            - pref: itemBarcodeFallbackSearch
40
            - pref: itemBarcodeFallbackSearch
41
              choices:
41
              choices:
42
- 

Return to bug 30409