This bug adds support for barcode filters on the inputs in the course reserves module.
To test:
1 - Set itemBarcodeInputFilter to 'Remove spaces from'
2 - Find a barcode in your system and add spaces between each characters
e.g. 3 9 9 9 9 0 0 0 0 0 0 8 1 8
3 - Past that barcode into the checkin box, success
4 - Browse to course reserves, ensure you have a course or create on
5 - Test adding a reserve, batch adding a reserve, and batch removing reserves
6 - The pasted barcode does not in any
7 - Apply patch and restart
8 - Pasted barcode with spaces can now successfuly be added, batch added, and batch removed from courses
Signed-off-by: Jason Robb <jrobb@sekls.org>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit
b8a18702d291210f9d62ca9daa747ec06f2cc8f6)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
use CGI qw ( -utf8 );
use C4::Auth qw( get_template_and_user );
+use C4::Circulation qw( barcodedecode );
use C4::Output qw( output_html_with_http_headers );
use C4::Koha qw( GetAuthorisedValues );
use Koha::Items;
my $biblionumber = $cgi->param('biblionumber') || '';
$barcode =~ s/^\s*|\s*$//g; #remove leading/trailing whitespace
+$barcode = barcodedecode($barcode) if $barcode;
$biblionumber =~ s/^\s*|\s*$//g; #remove leading/trailing whitespace
my ( $item, $biblio );
use List::MoreUtils qw( uniq );
use C4::Auth qw( get_template_and_user );
+use C4::Circulation qw( barcodedecode );
use C4::Output qw( output_html_with_http_headers );
use C4::CourseReserves qw( GetCourse ModCourse ModCourseItem ModCourseReserve );
my @items;
my @invalid_barcodes;
for my $b (@barcodes) {
+ $b = barcodedecode($b) if $b;
my $item = Koha::Items->find( { barcode => $b } );
if ($item) {
use List::MoreUtils qw( uniq );
use C4::Auth qw( get_template_and_user );
+use C4::Circulation qw( barcodedecode );
use C4::Output qw( output_html_with_http_headers );
use C4::CourseReserves qw( GetCourse GetCourseItem GetItemCourseReservesInfo DelCourse DelCourseReserve );
my @item_and_count;
foreach my $bar (@barcodes) {
+ $bar = barcodedecode($bar) if $bar;
my $item = Koha::Items->find( { barcode => $bar } );
if($item) {
my $courseitem = GetCourseItem(itemnumber => $item->id);