Lines 153-158
Will do some manipulation of the barcode for systems that deliver a barcode
Link Here
|
153 |
to circulation.pl that differs from the barcode stored for the item. |
153 |
to circulation.pl that differs from the barcode stored for the item. |
154 |
For proper functioning of this filter, calling the function on the |
154 |
For proper functioning of this filter, calling the function on the |
155 |
correct barcode string (items.barcode) should return an unaltered barcode. |
155 |
correct barcode string (items.barcode) should return an unaltered barcode. |
|
|
156 |
Barcode is going to be automatically trimmed of leading/trailing whitespaces. |
156 |
|
157 |
|
157 |
The optional $filter argument is to allow for testing or explicit |
158 |
The optional $filter argument is to allow for testing or explicit |
158 |
behavior that ignores the System Pref. Valid values are the same as the |
159 |
behavior that ignores the System Pref. Valid values are the same as the |
Lines 166-171
System Pref options.
Link Here
|
166 |
sub barcodedecode { |
167 |
sub barcodedecode { |
167 |
my ($barcode, $filter) = @_; |
168 |
my ($barcode, $filter) = @_; |
168 |
my $branch = C4::Context::mybranch(); |
169 |
my $branch = C4::Context::mybranch(); |
|
|
170 |
$barcode =~ s/^\s+|\s+$//g; |
169 |
$filter = C4::Context->preference('itemBarcodeInputFilter') unless $filter; |
171 |
$filter = C4::Context->preference('itemBarcodeInputFilter') unless $filter; |
170 |
Koha::Plugins->call('item_barcode_transform', \$barcode ); |
172 |
Koha::Plugins->call('item_barcode_transform', \$barcode ); |
171 |
$filter or return $barcode; # ensure filter is defined, else return untouched barcode |
173 |
$filter or return $barcode; # ensure filter is defined, else return untouched barcode |