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 |