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

(-)a/C4/Circulation.pm (+2 lines)
Lines 59-64 use Koha::Config::SysPrefs; Link Here
59
use Koha::Charges::Fees;
59
use Koha::Charges::Fees;
60
use Koha::Util::SystemPreferences;
60
use Koha::Util::SystemPreferences;
61
use Koha::Checkouts::ReturnClaims;
61
use Koha::Checkouts::ReturnClaims;
62
use Koha::Plugins;
62
use Carp;
63
use Carp;
63
use List::MoreUtils qw( uniq any );
64
use List::MoreUtils qw( uniq any );
64
use Scalar::Util qw( looks_like_number );
65
use Scalar::Util qw( looks_like_number );
Lines 173-178 sub barcodedecode { Link Here
173
    my ($barcode, $filter) = @_;
174
    my ($barcode, $filter) = @_;
174
    my $branch = C4::Context::mybranch();
175
    my $branch = C4::Context::mybranch();
175
    $filter = C4::Context->preference('itemBarcodeInputFilter') unless $filter;
176
    $filter = C4::Context->preference('itemBarcodeInputFilter') unless $filter;
177
    ($barcode) = Koha::Plugins->call('barcode_transform', 'item', $barcode );
176
    $filter or return $barcode;     # ensure filter is defined, else return untouched barcode
178
    $filter or return $barcode;     # ensure filter is defined, else return untouched barcode
177
	if ($filter eq 'whitespace') {
179
	if ($filter eq 'whitespace') {
178
		$barcode =~ s/\s//g;
180
		$barcode =~ s/\s//g;
(-)a/C4/ILSDI/Services.pm (+2 lines)
Lines 34-39 use CGI qw ( -utf8 ); Link Here
34
use DateTime;
34
use DateTime;
35
use C4::Auth;
35
use C4::Auth;
36
use Koha::DateUtils;
36
use Koha::DateUtils;
37
use Koha::Plugins;
37
38
38
use Koha::Biblios;
39
use Koha::Biblios;
39
use Koha::Checkouts;
40
use Koha::Checkouts;
Lines 613-618 sub GetServices { Link Here
613
    # Issuing management
614
    # Issuing management
614
    my $barcode = $item->barcode || '';
615
    my $barcode = $item->barcode || '';
615
    $barcode = barcodedecode($barcode) if ( $barcode && C4::Context->preference('itemBarcodeInputFilter') );
616
    $barcode = barcodedecode($barcode) if ( $barcode && C4::Context->preference('itemBarcodeInputFilter') );
617
    ($barcode) = Koha::Plugins->call('barcode_transform', 'item', $barcode );
616
    if ($barcode) {
618
    if ($barcode) {
617
        my ( $issuingimpossible, $needsconfirmation ) = CanBookBeIssued( $patron, $barcode );
619
        my ( $issuingimpossible, $needsconfirmation ) = CanBookBeIssued( $patron, $barcode );
618
620
(-)a/C4/Items.pm (+1 lines)
Lines 72-77 use Koha::ItemTypes; Link Here
72
use Koha::SearchEngine;
72
use Koha::SearchEngine;
73
use Koha::SearchEngine::Search;
73
use Koha::SearchEngine::Search;
74
use Koha::Libraries;
74
use Koha::Libraries;
75
use Koha::Plugins;
75
76
76
=head1 NAME
77
=head1 NAME
77
78
(-)a/C4/SIP/Sip/MsgType.pm (+16 lines)
Lines 19-24 use CGI qw ( -utf8 ); Link Here
19
use C4::Auth qw(&check_api_auth);
19
use C4::Auth qw(&check_api_auth);
20
20
21
use Koha::Patron::Attributes;
21
use Koha::Patron::Attributes;
22
use Koha::Plugins;
22
use Koha::Items;
23
use Koha::Items;
23
24
24
use UNIVERSAL::can;
25
use UNIVERSAL::can;
Lines 519-524 sub handle_checkout { Link Here
519
    $fields = $self->{fields};
520
    $fields = $self->{fields};
520
521
521
    $patron_id = $fields->{ (FID_PATRON_ID) };
522
    $patron_id = $fields->{ (FID_PATRON_ID) };
523
    ($patron_id) = Koha::Plugins->call('barcode_transform', 'patron', $patron_id );
522
    $item_id   = $fields->{ (FID_ITEM_ID) };
524
    $item_id   = $fields->{ (FID_ITEM_ID) };
523
    my $fee_ack = $fields->{ (FID_FEE_ACK) };
525
    my $fee_ack = $fields->{ (FID_FEE_ACK) };
524
526
Lines 732-737 sub handle_block_patron { Link Here
732
    $patron_id        = $fields->{ (FID_PATRON_ID) };
734
    $patron_id        = $fields->{ (FID_PATRON_ID) };
733
    $terminal_pwd     = $fields->{ (FID_TERMINAL_PWD) };
735
    $terminal_pwd     = $fields->{ (FID_TERMINAL_PWD) };
734
736
737
    ($patron_id) = Koha::Plugins->call('barcode_transform', 'patron', $patron_id );
738
735
    # Terminal passwords are different from account login
739
    # Terminal passwords are different from account login
736
    # passwords, but I have no idea what to do with them.  So,
740
    # passwords, but I have no idea what to do with them.  So,
737
    # I'll just ignore them for now.
741
    # I'll just ignore them for now.
Lines 956-961 sub handle_patron_info { Link Here
956
    $start        = $fields->{ (FID_START_ITEM) };
960
    $start        = $fields->{ (FID_START_ITEM) };
957
    $end          = $fields->{ (FID_END_ITEM) };
961
    $end          = $fields->{ (FID_END_ITEM) };
958
962
963
    ($patron_id) = Koha::Plugins->call('barcode_transform', 'patron', $patron_id );
964
959
    $patron = $ils->find_patron($patron_id);
965
    $patron = $ils->find_patron($patron_id);
960
966
961
    $resp = (PATRON_INFO_RESP);
967
    $resp = (PATRON_INFO_RESP);
Lines 1113-1118 sub handle_fee_paid { Link Here
1113
    $fee_id     = $fields->{ (FID_FEE_ID) };
1119
    $fee_id     = $fields->{ (FID_FEE_ID) };
1114
    $trans_id   = $fields->{ (FID_TRANSACTION_ID) };
1120
    $trans_id   = $fields->{ (FID_TRANSACTION_ID) };
1115
1121
1122
    ($patron_id) = Koha::Plugins->call('barcode_transform', 'patron', $patron_id );
1123
1116
    $ils->check_inst_id( $inst_id, "handle_fee_paid" );
1124
    $ils->check_inst_id( $inst_id, "handle_fee_paid" );
1117
1125
1118
    my $pay_result = $ils->pay_fee( $patron_id, $patron_pwd, $fee_amt, $fee_type, $pay_type, $fee_id, $trans_id, $currency, $is_writeoff, $disallow_overpayment, $register_id );
1126
    my $pay_result = $ils->pay_fee( $patron_id, $patron_pwd, $fee_amt, $fee_type, $pay_type, $fee_id, $trans_id, $currency, $is_writeoff, $disallow_overpayment, $register_id );
Lines 1301-1306 sub handle_patron_enable { Link Here
1301
    $patron_id  = $fields->{ (FID_PATRON_ID) };
1309
    $patron_id  = $fields->{ (FID_PATRON_ID) };
1302
    $patron_pwd = $fields->{ (FID_PATRON_PWD) };
1310
    $patron_pwd = $fields->{ (FID_PATRON_PWD) };
1303
1311
1312
    ($patron_id) = Koha::Plugins->call('barcode_transform', 'patron', $patron_id );
1313
1304
    siplog( "LOG_DEBUG", "handle_patron_enable: patron_id: '%s', patron_pwd: '%s'", $patron_id, $patron_pwd );
1314
    siplog( "LOG_DEBUG", "handle_patron_enable: patron_id: '%s', patron_pwd: '%s'", $patron_id, $patron_pwd );
1305
1315
1306
    $patron = $ils->find_patron($patron_id);
1316
    $patron = $ils->find_patron($patron_id);
Lines 1364-1369 sub handle_hold { Link Here
1364
    $title_id    = $fields->{ (FID_TITLE_ID) } || '';
1374
    $title_id    = $fields->{ (FID_TITLE_ID) } || '';
1365
    $fee_ack     = $fields->{ (FID_FEE_ACK) } || 'N';
1375
    $fee_ack     = $fields->{ (FID_FEE_ACK) } || 'N';
1366
1376
1377
    ($patron_id) = Koha::Plugins->call('barcode_transform', 'patron', $patron_id );
1378
1367
    if ( $hold_mode eq '+' ) {
1379
    if ( $hold_mode eq '+' ) {
1368
        $status = $ils->add_hold( $patron_id, $patron_pwd, $item_id, $title_id, $expiry_date, $pickup_locn, $hold_type, $fee_ack );
1380
        $status = $ils->add_hold( $patron_id, $patron_pwd, $item_id, $title_id, $expiry_date, $pickup_locn, $hold_type, $fee_ack );
1369
    } elsif ( $hold_mode eq '-' ) {
1381
    } elsif ( $hold_mode eq '-' ) {
Lines 1429-1434 sub handle_renew { Link Here
1429
    $item_props = $fields->{ (FID_ITEM_PROPS) };
1441
    $item_props = $fields->{ (FID_ITEM_PROPS) };
1430
    $fee_ack    = $fields->{ (FID_FEE_ACK) };
1442
    $fee_ack    = $fields->{ (FID_FEE_ACK) };
1431
1443
1444
    ($patron_id) = Koha::Plugins->call('barcode_transform', 'patron', $patron_id );
1445
1432
    $status = $ils->renew( $patron_id, $patron_pwd, $item_id, $title_id, $no_block, $nb_due_date, $third_party, $item_props, $fee_ack );
1446
    $status = $ils->renew( $patron_id, $patron_pwd, $item_id, $title_id, $no_block, $nb_due_date, $third_party, $item_props, $fee_ack );
1433
1447
1434
    $patron = $status->patron;
1448
    $patron = $status->patron;
Lines 1510-1515 sub handle_renew_all { Link Here
1510
    $terminal_pwd = $fields->{ (FID_TERMINAL_PWD) };
1524
    $terminal_pwd = $fields->{ (FID_TERMINAL_PWD) };
1511
    $fee_ack      = $fields->{ (FID_FEE_ACK) };
1525
    $fee_ack      = $fields->{ (FID_FEE_ACK) };
1512
1526
1527
    ($patron_id) = Koha::Plugins->call('barcode_transform', 'patron', $patron_id );
1528
1513
    $status = $ils->renew_all( $patron_id, $patron_pwd, $fee_ack );
1529
    $status = $ils->renew_all( $patron_id, $patron_pwd, $fee_ack );
1514
1530
1515
    $resp .= $status->ok ? '1' : '0';
1531
    $resp .= $status->ok ? '1' : '0';
(-)a/Koha/Item.pm (+3 lines)
Lines 87-92 sub store { Link Here
87
        $self->itype($self->biblio->biblioitem->itemtype);
87
        $self->itype($self->biblio->biblioitem->itemtype);
88
    }
88
    }
89
89
90
    my ($transformed_barcode) = Koha::Plugins->call( 'barcode_transform', 'item', $self->barcode );
91
    $self->barcode($transformed_barcode);
92
90
    my $today = dt_from_string;
93
    my $today = dt_from_string;
91
    unless ( $self->in_storage ) { #AddItem
94
    unless ( $self->in_storage ) { #AddItem
92
        unless ( $self->permanent_location ) {
95
        unless ( $self->permanent_location ) {
(-)a/Koha/Patron.pm (-1 / +7 lines)
Lines 110-116 Autogenerate next cardnumber from highest value found in database Link Here
110
110
111
sub fixup_cardnumber {
111
sub fixup_cardnumber {
112
    my ( $self ) = @_;
112
    my ( $self ) = @_;
113
    my $max = Koha::Patrons->search({
113
114
    my ( $max ) = Koha::Plugins->call( 'barcode_generate', 'patron', $self );
115
116
    $max ||= Koha::Patrons->search({
114
        cardnumber => {-regexp => '^-?[0-9]+$'}
117
        cardnumber => {-regexp => '^-?[0-9]+$'}
115
    }, {
118
    }, {
116
        select => \'CAST(cardnumber AS SIGNED)',
119
        select => \'CAST(cardnumber AS SIGNED)',
Lines 197-202 sub store { Link Here
197
200
198
            $self->trim_whitespaces;
201
            $self->trim_whitespaces;
199
202
203
            my ( $new_cardnumber ) = Koha::Plugins->call( 'barcode_transform', 'patron', $self->cardnumber );
204
            $self->cardnumber( $new_cardnumber );
205
200
            # Set surname to uppercase if uppercasesurname is true
206
            # Set surname to uppercase if uppercasesurname is true
201
            $self->surname( uc($self->surname) )
207
            $self->surname( uc($self->surname) )
202
                if C4::Context->preference("uppercasesurnames");
208
                if C4::Context->preference("uppercasesurnames");
(-)a/Koha/Patron/Attribute.pm (+1 lines)
Lines 20-25 use Modern::Perl; Link Here
20
use Koha::Database;
20
use Koha::Database;
21
use Koha::Exceptions::Patron::Attribute;
21
use Koha::Exceptions::Patron::Attribute;
22
use Koha::Patron::Attribute::Types;
22
use Koha::Patron::Attribute::Types;
23
use Koha::Plugins;
23
use Koha::AuthorisedValues;
24
use Koha::AuthorisedValues;
24
25
25
use base qw(Koha::Object);
26
use base qw(Koha::Object);
(-)a/cataloguing/additem.pl (+4 lines)
Lines 35-40 use Koha::Items; Link Here
35
use Koha::ItemTypes;
35
use Koha::ItemTypes;
36
use Koha::Libraries;
36
use Koha::Libraries;
37
use Koha::Patrons;
37
use Koha::Patrons;
38
use Koha::Plugins;
38
use List::MoreUtils qw/any/;
39
use List::MoreUtils qw/any/;
39
use C4::Search;
40
use C4::Search;
40
use Storable qw(thaw freeze);
41
use Storable qw(thaw freeze);
Lines 486-491 if ($op eq "additem") { Link Here
486
        $record = _increment_barcode($record, $frameworkcode);
487
        $record = _increment_barcode($record, $frameworkcode);
487
    }
488
    }
488
489
490
    my ( $new_barcode ) = Koha::Plugins->call( 'barcode_transform', 'item', $addedolditem->{'barcode'} );
491
    $addedolditem->{'barcode'} = $new_barcode;
492
489
    my $addedolditem = TransformMarcToKoha( $record );
493
    my $addedolditem = TransformMarcToKoha( $record );
490
494
491
    # If we have to add or add & duplicate, we add the item
495
    # If we have to add or add & duplicate, we add the item
(-)a/circ/circulation.pl (+3 lines)
Lines 46-51 use Koha::AuthorisedValues; Link Here
46
use Koha::CsvProfiles;
46
use Koha::CsvProfiles;
47
use Koha::Patrons;
47
use Koha::Patrons;
48
use Koha::Patron::Debarments qw(GetDebarments);
48
use Koha::Patron::Debarments qw(GetDebarments);
49
use Koha::Plugins;
49
use Koha::DateUtils;
50
use Koha::DateUtils;
50
use Koha::Database;
51
use Koha::Database;
51
use Koha::BiblioFrameworks;
52
use Koha::BiblioFrameworks;
Lines 166-171 for my $barcode ( @$barcodes ) { Link Here
166
    $barcode =~ s/^\s*|\s*$//g; # remove leading/trailing whitespace
167
    $barcode =~ s/^\s*|\s*$//g; # remove leading/trailing whitespace
167
    $barcode = barcodedecode($barcode)
168
    $barcode = barcodedecode($barcode)
168
        if( $barcode && C4::Context->preference('itemBarcodeInputFilter'));
169
        if( $barcode && C4::Context->preference('itemBarcodeInputFilter'));
170
    ( $barcode ) = Koha::Plugins->call( 'barcode_transform', 'item', $barcode );
169
}
171
}
170
172
171
my $stickyduedate  = $query->param('stickyduedate') || $session->param('stickyduedate');
173
my $stickyduedate  = $query->param('stickyduedate') || $session->param('stickyduedate');
Lines 227-232 if ( @$barcodes == 0 && $charges eq 'yes' ) { Link Here
227
#
229
#
228
my $message;
230
my $message;
229
if ($findborrower) {
231
if ($findborrower) {
232
    ( $findborrower ) = Koha::Plugins->call( 'barcode_transform', 'patron', $findborrower );
230
    my $patron = Koha::Patrons->find( { cardnumber => $findborrower } );
233
    my $patron = Koha::Patrons->find( { cardnumber => $findborrower } );
231
    if ( $patron ) {
234
    if ( $patron ) {
232
        $borrowernumber = $patron->borrowernumber;
235
        $borrowernumber = $patron->borrowernumber;
(-)a/circ/returns.pl (+3 lines)
Lines 56-61 use Koha::DateUtils; Link Here
56
use Koha::Holds;
56
use Koha::Holds;
57
use Koha::Items;
57
use Koha::Items;
58
use Koha::Patrons;
58
use Koha::Patrons;
59
use Koha::Plugins;
59
60
60
my $query = new CGI;
61
my $query = new CGI;
61
62
Lines 114-119 foreach ( $query->param ) { Link Here
114
115
115
    # decode barcode    ## Didn't we already decode them before passing them back last time??
116
    # decode barcode    ## Didn't we already decode them before passing them back last time??
116
    $barcode =~ s/^\s*|\s*$//g; # remove leading/trailing whitespace
117
    $barcode =~ s/^\s*|\s*$//g; # remove leading/trailing whitespace
118
    ( $barcode ) = Koha::Plugins->call( 'barcode_transform', 'item', $barcode );
117
    $barcode = barcodedecode($barcode) if(C4::Context->preference('itemBarcodeInputFilter'));
119
    $barcode = barcodedecode($barcode) if(C4::Context->preference('itemBarcodeInputFilter'));
118
120
119
    ######################
121
    ######################
Lines 246-251 if ($canceltransfer){ Link Here
246
my $returnbranch;
248
my $returnbranch;
247
if ($barcode) {
249
if ($barcode) {
248
    $barcode =~ s/^\s*|\s*$//g; # remove leading/trailing whitespace
250
    $barcode =~ s/^\s*|\s*$//g; # remove leading/trailing whitespace
251
    ( $barcode ) = Koha::Plugins->call( 'barcode_transform', 'item', $barcode );
249
    $barcode = barcodedecode($barcode) if C4::Context->preference('itemBarcodeInputFilter');
252
    $barcode = barcodedecode($barcode) if C4::Context->preference('itemBarcodeInputFilter');
250
    my $item = Koha::Items->find({ barcode => $barcode });
253
    my $item = Koha::Items->find({ barcode => $barcode });
251
254
(-)a/members/memberentry.pl (+4 lines)
Lines 45-50 use Koha::Patron::Attribute::Types; Link Here
45
use Koha::Patron::Categories;
45
use Koha::Patron::Categories;
46
use Koha::Patron::HouseboundRole;
46
use Koha::Patron::HouseboundRole;
47
use Koha::Patron::HouseboundRoles;
47
use Koha::Patron::HouseboundRoles;
48
use Koha::Plugins;
48
use Koha::Token;
49
use Koha::Token;
49
use Email::Valid;
50
use Email::Valid;
50
use Koha::SMS::Providers;
51
use Koha::SMS::Providers;
Lines 324-329 if ($op eq 'save' || $op eq 'insert'){ Link Here
324
    # If the cardnumber is blank, treat it as null.
325
    # If the cardnumber is blank, treat it as null.
325
    $newdata{'cardnumber'} = undef if $newdata{'cardnumber'} =~ /^\s*$/;
326
    $newdata{'cardnumber'} = undef if $newdata{'cardnumber'} =~ /^\s*$/;
326
327
328
    my ( $new_barcode ) = Koha::Plugins->call( 'barcode_transform', 'patron', $newdata{'cardnumber'} );
329
    $newdata{'cardnumber'} = $new_barcode;
330
327
    if (my $error_code = checkcardnumber($newdata{cardnumber},$newdata{borrowernumber})){
331
    if (my $error_code = checkcardnumber($newdata{cardnumber},$newdata{borrowernumber})){
328
        push @errors, $error_code == 1
332
        push @errors, $error_code == 1
329
            ? 'ERROR_cardnumber_already_exists'
333
            ? 'ERROR_cardnumber_already_exists'
(-)a/offline_circ/process_koc.pl (+9 lines)
Lines 38-43 use Koha::UploadedFiles; Link Here
38
use Koha::Account;
38
use Koha::Account;
39
use Koha::Checkouts;
39
use Koha::Checkouts;
40
use Koha::Patrons;
40
use Koha::Patrons;
41
use Koha::Plugins;
41
42
42
use Date::Calc qw( Add_Delta_Days Date_to_Days );
43
use Date::Calc qw( Add_Delta_Days Date_to_Days );
43
44
Lines 247-252 sub kocIssueItem { Link Here
247
    my $circ = shift;
248
    my $circ = shift;
248
249
249
    $circ->{ 'barcode' } = barcodedecode($circ->{'barcode'}) if( $circ->{'barcode'} && C4::Context->preference('itemBarcodeInputFilter'));
250
    $circ->{ 'barcode' } = barcodedecode($circ->{'barcode'}) if( $circ->{'barcode'} && C4::Context->preference('itemBarcodeInputFilter'));
251
252
    my ( $new_barcode ) = Koha::Plugins->call( 'barcode_transform', 'item', $circ->{barcode} );
253
    $circ->{barcode} = $new_barcode;
254
250
    my $branchcode = C4::Context->userenv->{branch};
255
    my $branchcode = C4::Context->userenv->{branch};
251
    my $patron = Koha::Patrons->find( { cardnumber => $circ->{cardnumber} } );
256
    my $patron = Koha::Patrons->find( { cardnumber => $circ->{cardnumber} } );
252
    my $borrower = $patron->unblessed;
257
    my $borrower = $patron->unblessed;
Lines 327-332 sub kocIssueItem { Link Here
327
sub kocReturnItem {
332
sub kocReturnItem {
328
    my ( $circ ) = @_;
333
    my ( $circ ) = @_;
329
    $circ->{'barcode'} = barcodedecode($circ->{'barcode'}) if( $circ->{'barcode'} && C4::Context->preference('itemBarcodeInputFilter'));
334
    $circ->{'barcode'} = barcodedecode($circ->{'barcode'}) if( $circ->{'barcode'} && C4::Context->preference('itemBarcodeInputFilter'));
335
336
    my ( $new_barcode ) = Koha::Plugins->call( 'barcode_transform', 'item', $circ->{barcode} );
337
    $circ->{barcode} = $new_barcode;
338
330
    my $item = Koha::Items->find({ barcode => $circ->{barcode} });
339
    my $item = Koha::Items->find({ barcode => $circ->{barcode} });
331
    my $biblio = $item->biblio;
340
    my $biblio = $item->biblio;
332
    my $borrowernumber = _get_borrowernumber_from_barcode( $circ->{'barcode'} );
341
    my $borrowernumber = _get_borrowernumber_from_barcode( $circ->{'barcode'} );
(-)a/opac/sco/sco-main.pl (+4 lines)
Lines 49-54 use Koha::Items; Link Here
49
use Koha::Patrons;
49
use Koha::Patrons;
50
use Koha::Patron::Images;
50
use Koha::Patron::Images;
51
use Koha::Patron::Messages;
51
use Koha::Patron::Messages;
52
use Koha::Plugins;
52
use Koha::Token;
53
use Koha::Token;
53
54
54
my $query = new CGI;
55
my $query = new CGI;
Lines 110-115 my ($op, $patronid, $patronlogin, $patronpw, $barcode, $confirmed, $newissues) = Link Here
110
    $query->param("newissues")  || '',
111
    $query->param("newissues")  || '',
111
);
112
);
112
113
114
( $barcode ) = Koha::Plugins->call( 'barcode_transform', 'item', $barcode );
115
113
my @newissueslist = split /,/, $newissues;
116
my @newissueslist = split /,/, $newissues;
114
my $issuenoconfirm = 1; #don't need to confirm on issue.
117
my $issuenoconfirm = 1; #don't need to confirm on issue.
115
my $issuer   = Koha::Patrons->find( $issuerid )->unblessed;
118
my $issuer   = Koha::Patrons->find( $issuerid )->unblessed;
Lines 122-127 if (C4::Context->preference('SelfCheckoutByLogin') && !$patronid) { Link Here
122
125
123
my ( $borrower, $patron );
126
my ( $borrower, $patron );
124
if ( $patronid ) {
127
if ( $patronid ) {
128
    ( $patronid ) = Koha::Plugins->call( 'barcode_transform', 'patron', $patronid );
125
    $patron = Koha::Patrons->find( { cardnumber => $patronid } );
129
    $patron = Koha::Patrons->find( { cardnumber => $patronid } );
126
    $borrower = $patron->unblessed if $patron;
130
    $borrower = $patron->unblessed if $patron;
127
}
131
}
(-)a/t/db_dependent/Koha/Plugins/Plugins.t (-1 / +3 lines)
Lines 25-31 use File::Temp qw( tempdir tempfile ); Link Here
25
use FindBin qw($Bin);
25
use FindBin qw($Bin);
26
use Module::Load::Conditional qw(can_load);
26
use Module::Load::Conditional qw(can_load);
27
use Test::MockModule;
27
use Test::MockModule;
28
use Test::More tests => 52;
28
use Test::More tests => 54;
29
29
30
use C4::Context;
30
use C4::Context;
31
use Koha::Database;
31
use Koha::Database;
Lines 175-180 ok( $plugin->can('opac_head'), 'Test plugin can opac_head' ); Link Here
175
ok( $plugin->can('opac_js'), 'Test plugin can opac_js' );
175
ok( $plugin->can('opac_js'), 'Test plugin can opac_js' );
176
ok( $plugin->can('intranet_head'), 'Test plugin can intranet_head' );
176
ok( $plugin->can('intranet_head'), 'Test plugin can intranet_head' );
177
ok( $plugin->can('intranet_js'), 'Test plugin can intranet_js' );
177
ok( $plugin->can('intranet_js'), 'Test plugin can intranet_js' );
178
ok( $plugin->can('barcode_transform'), 'Test plugin can barcode_transform' );
179
ok( $plugin->can('barcode_create'), 'Test plugin can barcode_create' );
178
ok( $plugin->can('configure'), 'Test plugin can configure' );
180
ok( $plugin->can('configure'), 'Test plugin can configure' );
179
ok( $plugin->can('install'), 'Test plugin can install' );
181
ok( $plugin->can('install'), 'Test plugin can install' );
180
ok( $plugin->can('upgrade'), 'Test plugin can upgrade' );
182
ok( $plugin->can('upgrade'), 'Test plugin can upgrade' );
(-)a/t/lib/Koha/Plugin/Test.pm (+9 lines)
Lines 93-98 sub intranet_js { Link Here
93
    return "Koha::Plugin::Test::intranet_js";
93
    return "Koha::Plugin::Test::intranet_js";
94
}
94
}
95
95
96
sub barcode_transform {
97
    my ( $self, $type, $barcode ) = @_;
98
    return "Koha::Plugin::Test::barcode_transform";
99
}
100
101
sub barcode_generate {
102
    my ( $self, $type, $object )
103
}
104
96
sub configure {
105
sub configure {
97
    my ( $self, $args ) = @_;
106
    my ( $self, $args ) = @_;
98
    return "Koha::Plugin::Test::configure";;
107
    return "Koha::Plugin::Test::configure";;
(-)a/tools/batchMod.pl (+4 lines)
Lines 44-49 use Koha::DateUtils; Link Here
44
use Koha::Items;
44
use Koha::Items;
45
use Koha::ItemTypes;
45
use Koha::ItemTypes;
46
use Koha::Patrons;
46
use Koha::Patrons;
47
use Koha::Plugins;
47
48
48
my $input = new CGI;
49
my $input = new CGI;
49
my $dbh = C4::Context->dbh;
50
my $dbh = C4::Context->dbh;
Lines 364-369 if ($op eq "show"){ Link Here
364
        if ( my $list = $input->param('barcodelist') ) {
365
        if ( my $list = $input->param('barcodelist') ) {
365
            my @barcodelist = grep /\S/, ( split /[$split_chars]/, $list );
366
            my @barcodelist = grep /\S/, ( split /[$split_chars]/, $list );
366
            @barcodelist = uniq @barcodelist;
367
            @barcodelist = uniq @barcodelist;
368
369
            @barcodelist = map { ( Koha::Plugins->call( 'barcode_transform', 'item', $barcode ) )[0] } @barcodelist;
370
367
            # Note: adding lc for case insensitivity
371
            # Note: adding lc for case insensitivity
368
            my %itemdata = map { lc($_->{barcode}) => $_->{itemnumber} } @{ Koha::Items->search({ barcode => \@barcodelist }, { columns => [ 'itemnumber', 'barcode' ] } )->unblessed };
372
            my %itemdata = map { lc($_->{barcode}) => $_->{itemnumber} } @{ Koha::Items->search({ barcode => \@barcodelist }, { columns => [ 'itemnumber', 'barcode' ] } )->unblessed };
369
            @itemnumbers = map { exists $itemdata{lc $_} ? $itemdata{lc $_} : () } @barcodelist;
373
            @itemnumbers = map { exists $itemdata{lc $_} ? $itemdata{lc $_} : () } @barcodelist;
(-)a/tools/inventory.pl (-1 / +5 lines)
Lines 41-46 use Koha::AuthorisedValues; Link Here
41
use Koha::BiblioFrameworks;
41
use Koha::BiblioFrameworks;
42
use Koha::ClassSources;
42
use Koha::ClassSources;
43
use Koha::Items;
43
use Koha::Items;
44
use Koha::Plugins;
45
44
use List::MoreUtils qw( none );
46
use List::MoreUtils qw( none );
45
47
46
my $minlocation=$input->param('minlocation') || '';
48
my $minlocation=$input->param('minlocation') || '';
Lines 171-176 if ( $uploadbarcodes && length($uploadbarcodes) > 0 ) { Link Here
171
    }
173
    }
172
    for my $barcode (@uploadedbarcodes) {
174
    for my $barcode (@uploadedbarcodes) {
173
        next unless $barcode;
175
        next unless $barcode;
176
177
        ($barcode) = Koha::Plugins->call('barcode_transform', 'item', $barcode );
178
174
        ++$lines_read;
179
        ++$lines_read;
175
        if (length($barcode)>$barcode_size) {
180
        if (length($barcode)>$barcode_size) {
176
            $err_length += 1;
181
            $err_length += 1;
177
- 

Return to bug 25712